OMCompiler/SimulationRuntime/cpp/Core/SimController/FactoryExport.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * This file belongs to the OpenModelica Run-Time System | ||
| 3 | * | ||
| 4 | * Copyright (c) 1998-2026, Open Source Modelica Consortium (OSMC), c/o Linköpings | ||
| 5 | * universitet, Department of Computer and Information Science, SE-58183 Linköping, Sweden. All rights | ||
| 6 | * reserved. | ||
| 7 | * | ||
| 8 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF THE BSD NEW LICENSE OR THE | ||
| 9 | * AGPL VERSION 3 LICENSE OR THE OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.8. ANY | ||
| 10 | * USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S | ||
| 11 | * ACCEPTANCE OF THE BSD NEW LICENSE OR THE OSMC PUBLIC LICENSE OR THE AGPL | ||
| 12 | * VERSION 3, ACCORDING TO RECIPIENTS CHOICE. | ||
| 13 | * | ||
| 14 | * The OpenModelica software and the OSMC (Open Source Modelica Consortium) Public License | ||
| 15 | * (OSMC-PL) are obtained from OSMC, either from the above address, from the URLs: | ||
| 16 | * http://www.openmodelica.org or https://github.com/OpenModelica/ or | ||
| 17 | * http://www.ida.liu.se/projects/OpenModelica, and in the OpenModelica distribution. GNU | ||
| 18 | * AGPL version 3 is obtained from: https://www.gnu.org/licenses/licenses.html#GPL. The BSD NEW | ||
| 19 | * License is obtained from: http://www.opensource.org/licenses/BSD-3-Clause. | ||
| 20 | * | ||
| 21 | * This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY | ||
| 23 | * SET FORTH IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF | ||
| 24 | * OSMC-PL. | ||
| 25 | * | ||
| 26 | */ | ||
| 27 | |||
| 28 | /** @addtogroup coreSimcontroller | ||
| 29 | * | ||
| 30 | * @{ | ||
| 31 | */ | ||
| 32 | #include <Core/ModelicaDefine.h> | ||
| 33 | #include <Core/Modelica.h> | ||
| 34 | #if defined(__vxworks) || defined(__TRICORE__) | ||
| 35 | |||
| 36 | |||
| 37 | |||
| 38 | #include <Core/SimController/ISimController.h> | ||
| 39 | #include <Core/SimController/SimController.h> | ||
| 40 | #include <Core/SimController/SimObjects.h> | ||
| 41 | |||
| 42 | extern "C" ISimController* createSimController(PATH library_path, PATH modelicasystem_path) | ||
| 43 | { | ||
| 44 | return new SimController(library_path, modelicasystem_path); | ||
| 45 | } | ||
| 46 | |||
| 47 | shared_ptr<ISimObjects> createSimObjects(PATH library_path, PATH modelicasystem_path,IGlobalSettings* settings) | ||
| 48 | { | ||
| 49 | return shared_ptr<ISimObjects>(new SimObjects(library_path, modelicasystem_path,settings)); | ||
| 50 | } | ||
| 51 | |||
| 52 | #elif defined(SIMSTER_BUILD) | ||
| 53 | |||
| 54 | |||
| 55 | |||
| 56 | #include <Core/SimController/ISimController.h> | ||
| 57 | #include <Core/SimController/SimController.h> | ||
| 58 | /*Simster factory*/ | ||
| 59 | extern "C" void BOOST_EXTENSION_EXPORT_DECL extension_export_simcontroller(boost::extensions::factory_map & fm) | ||
| 60 | { | ||
| 61 | fm.get<ISimController,int,PATH,PATH>()[1].set<SimController>(); | ||
| 62 | // fm.get<ISimData,int>()[1].set<SimData>(); | ||
| 63 | } | ||
| 64 | |||
| 65 | #elif defined(OMC_BUILD) && !defined(RUNTIME_STATIC_LINKING) | ||
| 66 | |||
| 67 | #include <Core/SimController/ISimController.h> | ||
| 68 | #include <Core/SimController/SimController.h> | ||
| 69 | #include <Core/SimController/SimObjects.h> | ||
| 70 | /*OMC factory*/ | ||
| 71 | using boost::extensions::factory; | ||
| 72 | 40 | BOOST_EXTENSION_TYPE_MAP_FUNCTION { | |
| 73 | types.get<std::map<std::string, factory<ISimController,PATH,PATH> > >() | ||
| 74 |
1/1✓ Branch 2 taken 40 times.
|
80 | ["SimController"].set<SimController>(); |
| 75 | types.get<std::map<std::string, factory<ISimObjects,PATH,PATH,IGlobalSettings* > > >() | ||
| 76 |
1/1✓ Branch 2 taken 40 times.
|
40 | ["SimObjects"].set<SimObjects>(); |
| 77 | 40 | } | |
| 78 | |||
| 79 | #elif defined(OMC_BUILD) && defined(RUNTIME_STATIC_LINKING) | ||
| 80 | #include <Core/SimController/ISimController.h> | ||
| 81 | #include <Core/SimController/SimController.h> | ||
| 82 | #include <Core/SimController/SimObjects.h> | ||
| 83 | shared_ptr<ISimController> createSimController(PATH library_path, PATH modelicasystem_path) | ||
| 84 | { | ||
| 85 | return shared_ptr<ISimController>(new SimController(library_path, modelicasystem_path)); | ||
| 86 | } | ||
| 87 | |||
| 88 | shared_ptr<ISimObjects> createSimObjects(PATH library_path, PATH modelicasystem_path,IGlobalSettings* settings) | ||
| 89 | { | ||
| 90 | return shared_ptr<ISimObjects>(new SimObjects(library_path, modelicasystem_path,settings)); | ||
| 91 | } | ||
| 92 | #else | ||
| 93 | error "operating system not supported" | ||
| 94 | #endif | ||
| 95 | /** @} */ // end of coreSimcontroller | ||
| 96 |