OMSimulatorLib
The OMSimulator project is a FMI-based co-simulation environment.
Loading...
Searching...
No Matches
BusConnector.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenModelica.
3 *
4 * Copyright (c) 1998-2026, Open Source Modelica Consortium (OSMC),
5 * c/o Linköpings universitet, Department of Computer and Information Science,
6 * SE-58183 Linköping, Sweden.
7 *
8 * All rights reserved.
9 *
10 * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF AGPL VERSION 3 LICENSE OR
11 * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.8.
12 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES
13 * RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GNU AGPL
14 * VERSION 3, ACCORDING TO RECIPIENTS CHOICE.
15 *
16 * The OpenModelica software and the OSMC (Open Source Modelica Consortium)
17 * Public License (OSMC-PL) are obtained from OSMC, either from the above
18 * address, from the URLs:
19 * http://www.openmodelica.org or
20 * https://github.com/OpenModelica/ or
21 * http://www.ida.liu.se/projects/OpenModelica,
22 * and in the OpenModelica distribution.
23 *
24 * GNU AGPL version 3 is obtained from:
25 * https://www.gnu.org/licenses/licenses.html#GPL
26 *
27 * This program is distributed WITHOUT ANY WARRANTY; without
28 * even the implied warranty of MERCHANTABILITY or FITNESS
29 * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
30 * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL.
31 *
32 * See the full OSMC Public License conditions for more details.
33 *
34 */
35
36#ifndef BUSCONNECTOR_H
37#define BUSCONNECTOR_H
38
39
40#include "ComRef.h"
41#include "OMSimulator/Types.h"
42#include "Connector.h"
44
45#include <string>
46#include <vector>
47
48#include <pugixml.hpp>
49
50namespace oms
51{
55 class BusConnector : protected oms_busconnector_t
56 {
57 public:
58 BusConnector(const oms::ComRef& name);
60
61 oms_status_enu_t exportToSSD(pugi::xml_node& root) const;
62
63 // methods to copy the object
64 BusConnector(const BusConnector& rhs);
66
67 void setName(const oms::ComRef& name);
68 void setGeometry(const oms::ssd::ConnectorGeometry* newGeometry);
69
70 const oms::ComRef getName() const {return oms::ComRef(name);}
71 const oms::ssd::ConnectorGeometry* getGeometry() const {return reinterpret_cast<oms::ssd::ConnectorGeometry*>(geometry);}
72
73 oms_status_enu_t addConnector(const oms::ComRef& cref);
74 oms_status_enu_t deleteConnector(const oms::ComRef& cref);
75 std::vector<oms::ComRef> getConnectors() const {return conrefs;}
76
77 void updateConnectors();
78
79 private:
80 std::vector<oms::ComRef> conrefs;
81 };
82}
83
84#endif // BUSCONNECTOR_H
BusConnector.
Definition BusConnector.h:56
const oms::ssd::ConnectorGeometry * getGeometry() const
Definition BusConnector.h:71
std::vector< oms::ComRef > getConnectors() const
Definition BusConnector.h:75
void setGeometry(const oms::ssd::ConnectorGeometry *newGeometry)
Definition BusConnector.cpp:118
void updateConnectors()
Definition BusConnector.cpp:149
BusConnector & operator=(const BusConnector &rhs)
Definition BusConnector.cpp:92
oms_status_enu_t addConnector(const oms::ComRef &cref)
Definition BusConnector.cpp:130
const oms::ComRef getName() const
Definition BusConnector.h:70
oms_status_enu_t exportToSSD(pugi::xml_node &root) const
Definition BusConnector.cpp:63
~BusConnector()
Definition BusConnector.cpp:52
void setName(const oms::ComRef &name)
Definition BusConnector.cpp:108
oms_status_enu_t deleteConnector(const oms::ComRef &cref)
Definition BusConnector.cpp:137
std::vector< oms::ComRef > conrefs
Definition BusConnector.h:80
ComRef - component reference.
Definition ComRef.h:51
Definition ConnectorGeometry.h:50
Definition AlgLoop.h:49