DPsim
InterfaceWorker.h
1 // SPDX-License-Identifier: Apache-2.0
2 
3 #pragma once
4 
5 #include <typeinfo>
6 
7 #include <dpsim-models/Attribute.h>
8 #include <dpsim-models/Logger.h>
9 #include <dpsim-models/Task.h>
10 #include <dpsim/Config.h>
11 #include <dpsim/Definitions.h>
12 #include <dpsim/Interface.h>
13 #include <dpsim/Scheduler.h>
14 
15 namespace DPsim {
16 
18 
19 protected:
20  bool mOpened;
21  UInt mCurrentSequenceInterfaceToDpsim = 1;
22 
23 public:
24  using Ptr = std::shared_ptr<InterfaceWorker>;
25 
26  CPS::Logger::Log mLog;
27 
28  InterfaceWorker() = default;
29  virtual ~InterfaceWorker() = default;
30 
36  virtual void
37  readValuesFromEnv(std::vector<Interface::AttributePacket> &updatedAttrs) = 0;
38 
45  virtual void
46  writeValuesToEnv(std::vector<Interface::AttributePacket> &updatedAttrs) = 0;
47 
52  virtual void open() = 0;
53 
58  virtual void close() = 0;
59 };
60 } // namespace DPsim
virtual void writeValuesToEnv(std::vector< Interface::AttributePacket > &updatedAttrs)=0
virtual void open()=0
virtual void close()=0
virtual void readValuesFromEnv(std::vector< Interface::AttributePacket > &updatedAttrs)=0