DPsim
Loading...
Searching...
No Matches
Interface.cpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2
3#include <dpsim/Interface.h>
4
5using namespace CPS;
6
7namespace DPsim {
8
9void Interface::addImport(CPS::AttributeBase::Ptr attr, bool blockOnRead,
10 bool syncOnSimulationStart) {
11 if (mOpened) {
12 SPDLOG_LOGGER_ERROR(
13 mLog, "Cannot modify interface configuration after simulation start!");
14 std::exit(1);
15 }
16
17 mImportAttrsDpsim.emplace_back(attr, 0, blockOnRead, syncOnSimulationStart);
18}
19
21 if (mOpened) {
22 SPDLOG_LOGGER_ERROR(
23 mLog, "Cannot modify interface configuration after simulation start!");
24 std::exit(1);
25 }
26
27 mExportAttrsDpsim.emplace_back(attr, 0);
28}
29
31
32} // namespace DPsim
AttributePointer< AttributeBase > Ptr
Definition Attribute.h:122
std::shared_ptr< spdlog::logger > Log
Definition Logger.h:34
std::vector< std::tuple< CPS::AttributeBase::Ptr, UInt, bool, bool > > mImportAttrsDpsim
Definition Interface.h:49
std::atomic< bool > mOpened
Definition Interface.h:63
virtual void addImport(CPS::AttributeBase::Ptr attr, bool blockOnRead=false, bool syncOnSimulationStart=true)
Definition Interface.cpp:9
virtual void setLogger(CPS::Logger::Log log)
Definition Interface.cpp:30
virtual void addExport(CPS::AttributeBase::Ptr attr)
Definition Interface.cpp:20
CPS::Logger::Log mLog
Definition Interface.h:58
std::vector< std::tuple< CPS::AttributeBase::Ptr, UInt > > mExportAttrsDpsim
Definition Interface.h:51