Linux GNU 11.4.0 Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 7 / 0 / 7
Functions: 100.0% 2 / 0 / 2
Branches: 62.5% 5 / 0 / 8

OMCompiler/SimulationRuntime/cpp/Core/System/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 coreSystem
29 *
30 * @{
31 */
32 #include <Core/ModelicaDefine.h>
33 #include <Core/Modelica.h>
34 #if defined(__vxworks) || defined(__TRICORE__)
35
36
37 #include <SimCoreFactory/VxWorksFactory/VxWorksFactory.h>
38 #include <Core/System/AlgLoopSolverFactory.h>
39
40 extern "C" IAlgLoopSolverFactory* createAlgLoopSolverFactoryFunction(IGlobalSettings* globalSettings,PATH library_path,PATH modelicasystem_path)
41 //shared_ptr<IAlgLoopSolverFactory> createAlgLoopSolverFactoryFunction(IGlobalSettings* globalSettings,PATH library_path,PATH modelicasystem_path)
42 {
43 //shared_ptr<IAlgLoopSolverFactory> algloopSolverFactory = shared_ptr<IAlgLoopSolverFactory>(new AlgLoopSolverFactory(globalSettings,library_path,modelicasystem_path));
44 //return algloopSolverFactory;
45 return new AlgLoopSolverFactory(globalSettings,library_path,modelicasystem_path);
46 }
47
48 #elif defined(SIMSTER_BUILD)
49
50 #include <SimCoreFactory/OMCFactory/OMCFactory.h>
51 #include <Core/System/AlgLoopSolverFactory.h>
52
53 /*Simster factory*/
54 extern "C" void BOOST_EXTENSION_EXPORT_DECL extension_export_system(boost::extensions::factory_map & fm)
55 {
56 fm.get<IAlgLoopSolverFactory,int,IGlobalSettings*,PATH,PATH>()[1].set<AlgLoopSolverFactory>();
57 }
58
59 #elif defined(OMC_BUILD) && !defined(RUNTIME_STATIC_LINKING)
60
61 #include <Core/System/FactoryExport.h>
62 #include <SimCoreFactory/OMCFactory/OMCFactory.h>
63 #include <Core/System/AlgLoopSolverFactory.h>
64 #include <Core/System/SimVars.h>
65 /*OMC factory*/
66 using boost::extensions::factory;
67
68 80 BOOST_EXTENSION_TYPE_MAP_FUNCTION {
69
70 types.get<std::map<std::string, factory<IAlgLoopSolverFactory,IGlobalSettings*,PATH,PATH> > >()
71
1/1
✓ Branch 2 taken 80 times.
160 ["AlgLoopSolverFactory"].set<AlgLoopSolverFactory>();
72 types.get<std::map<std::string, factory<ISimVars,size_t,size_t,size_t,size_t,size_t,size_t,size_t> > >()
73
1/1
✓ Branch 2 taken 80 times.
80 ["SimVars"].set<SimVars>();
74 80 }
75 #elif defined(OMC_BUILD) && defined(RUNTIME_STATIC_LINKING)
76
77 #include <Core/System/FactoryExport.h>
78 #include <Core/System/AlgLoopSolverFactory.h>
79 1 shared_ptr<IAlgLoopSolverFactory> createStaticAlgLoopSolverFactory(IGlobalSettings* globalSettings,PATH library_path,PATH modelicasystem_path)
80 {
81
3/6
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 time.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
2 shared_ptr<IAlgLoopSolverFactory> algloopSolverFactory = shared_ptr<IAlgLoopSolverFactory>(new AlgLoopSolverFactory(globalSettings,library_path,modelicasystem_path));
82 1 return algloopSolverFactory;
83 }
84 #else
85 error "operating system not supported"
86 #endif
87
88 /** @} */ // end of coreSystem
89
90
91