OMCompiler/SimulationRuntime/cpp/SimCoreFactory/ObjectFactory.h
| 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 | #pragma once | ||
| 29 | /** @defgroup simcorefactory SimCoreFactory | ||
| 30 | * Base module for all object factories | ||
| 31 | * @{ | ||
| 32 | */ | ||
| 33 | |||
| 34 | template<class T> | ||
| 35 | struct ObjectFactory | ||
| 36 | { | ||
| 37 | 201 | ObjectFactory(PATH library_path, PATH modelicasystem_path, PATH config_path) | |
| 38 |
2/3ObjectFactory<BaseOMCFactory>::ObjectFactory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >):
✓ Branch 1 taken 1 time.
ObjectFactory<OMCFactory>::ObjectFactory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >):
✓ Branch 1 taken 200 times.
✗ Branch 2 not taken.
|
201 | : _library_path(library_path) |
| 39 |
2/3ObjectFactory<BaseOMCFactory>::ObjectFactory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >):
✓ Branch 1 taken 1 time.
ObjectFactory<OMCFactory>::ObjectFactory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >):
✓ Branch 1 taken 200 times.
✗ Branch 2 not taken.
|
201 | , _modelicasystem_path(modelicasystem_path) |
| 40 |
4/6ObjectFactory<BaseOMCFactory>::ObjectFactory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >):
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
ObjectFactory<OMCFactory>::ObjectFactory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >):
✓ Branch 1 taken 200 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 200 times.
✗ Branch 5 not taken.
|
402 | , _config_path(config_path) |
| 41 | { | ||
| 42 |
7/21ObjectFactory<BaseOMCFactory>::ObjectFactory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >):
✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
ObjectFactory<OMCFactory>::ObjectFactory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >):
✓ Branch 1 taken 200 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 200 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 200 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 200 times.
✗ Branch 9 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
|
602 | _factory = shared_ptr<T>(new T(library_path, modelicasystem_path)); |
| 43 | 201 | } | |
| 44 | |||
| 45 |
2/4ObjectFactory<BaseOMCFactory>::~ObjectFactory():
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
ObjectFactory<OMCFactory>::~ObjectFactory():
✓ Branch 0 taken 200 times.
✗ Branch 1 not taken.
|
201 | virtual ~ObjectFactory() {}; |
| 46 | |||
| 47 | protected: | ||
| 48 | shared_ptr<T> _factory; | ||
| 49 | PATH _library_path; | ||
| 50 | PATH _modelicasystem_path; | ||
| 51 | PATH _config_path; | ||
| 52 | }; | ||
| 53 | /** @} */ // end of simcorefactoryBodas | ||
| 54 |