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"
43#include "ssd/ConnectorGeometry.h"
44
45#include <string>
46#include <vector>
47
48#include <pugixml.hpp>
49
50 namespace oms
51{
55 class BusConnector : protected oms_busconnector_t
56 {
57 public:
58 BusConnector(const oms::ComRef& name);
59 ~BusConnector();
60
61 oms_status_enu_t exportToSSD(pugi::xml_node& root) const;
62
63 // methods to copy the object
64 BusConnector(const BusConnector& rhs);
65 BusConnector& operator=(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
ComRef.h
ConnectorGeometry.h
Connector.h
oms::BusConnector
BusConnector.
Definition BusConnector.h:56
oms::BusConnector::getGeometry
const oms::ssd::ConnectorGeometry * getGeometry() const
Definition BusConnector.h:71
oms::BusConnector::getConnectors
std::vector< oms::ComRef > getConnectors() const
Definition BusConnector.h:75
oms::BusConnector::setGeometry
void setGeometry(const oms::ssd::ConnectorGeometry *newGeometry)
Definition BusConnector.cpp:118
oms::BusConnector::updateConnectors
void updateConnectors()
Definition BusConnector.cpp:149
oms::BusConnector::operator=
BusConnector & operator=(const BusConnector &rhs)
Definition BusConnector.cpp:92
oms::BusConnector::addConnector
oms_status_enu_t addConnector(const oms::ComRef &cref)
Definition BusConnector.cpp:130
oms::BusConnector::getName
const oms::ComRef getName() const
Definition BusConnector.h:70
oms::BusConnector::exportToSSD
oms_status_enu_t exportToSSD(pugi::xml_node &root) const
Definition BusConnector.cpp:63
oms::BusConnector::~BusConnector
~BusConnector()
Definition BusConnector.cpp:52
oms::BusConnector::setName
void setName(const oms::ComRef &name)
Definition BusConnector.cpp:108
oms::BusConnector::deleteConnector
oms_status_enu_t deleteConnector(const oms::ComRef &cref)
Definition BusConnector.cpp:137
oms::BusConnector::conrefs
std::vector< oms::ComRef > conrefs
Definition BusConnector.h:80
oms::ComRef
ComRef - component reference.
Definition ComRef.h:51
oms::ssd::ConnectorGeometry
Definition ConnectorGeometry.h:50
oms
Definition AlgLoop.h:49