DPsim
Loading...
Searching...
No Matches
DPsim::InterfaceQueued Class Reference
Inheritance diagram for DPsim::InterfaceQueued:
[legend]
Collaboration diagram for DPsim::InterfaceQueued:
[legend]

Classes

class  PostStep
 
class  PreStep
 
class  ReaderThread
 
class  WriterThread
 

Public Types

enum  AttributePacketFlags { PACKET_NO_FLAGS = 0 , PACKET_CLOSE_INTERFACE = 1 }
 
typedef std::shared_ptr< InterfaceQueuedPtr
 
using AttributePacket
 
- Public Types inherited from DPsim::Interface
typedef std::shared_ptr< InterfacePtr
 

Public Member Functions

 InterfaceQueued (std::shared_ptr< InterfaceWorker > intf, const String &name="", UInt downsampling=1)
 
virtual void open () override
 
virtual void close () override
 
virtual void pushDpsimAttrsToQueue ()
 
virtual void popDpsimAttrsFromQueue (bool isSync=false)
 
virtual void syncExports () override
 
virtual void syncImports () override
 Function called by the Simulation to perform interface synchronization.
 
virtual CPS::Task::List getTasks () override
 
virtual void setLogger (CPS::Logger::Log log) override
 
- Public Member Functions inherited from DPsim::Interface
 Interface (const String &name="", spdlog::level::level_enum logLevel=spdlog::level::level_enum::info)
 
virtual String & getName ()
 
virtual void addImport (CPS::AttributeBase::Ptr attr, bool blockOnRead=false, bool syncOnSimulationStart=true)
 
virtual void addExport (CPS::AttributeBase::Ptr attr)
 

Protected Attributes

std::shared_ptr< InterfaceWorkermInterfaceWorker
 
UInt mDownsampling
 
std::thread mInterfaceWriterThread
 
std::thread mInterfaceReaderThread
 
std::shared_ptr< moodycamel::BlockingReaderWriterQueue< AttributePacket > > mQueueDpsimToInterface
 
std::shared_ptr< moodycamel::BlockingReaderWriterQueue< AttributePacket > > mQueueInterfaceToDpsim
 
- Protected Attributes inherited from DPsim::Interface
CPS::Logger::Log mLog
 
String mName
 
bool mSyncOnSimulationStart
 
UInt mCurrentSequenceDpsimToInterface = 1
 
UInt mNextSequenceInterfaceToDpsim = 1
 
std::atomic< bool > mOpened
 

Additional Inherited Members

- Static Public Member Functions inherited from SharedFactory< Interface >
static std::shared_ptr< Interface > make (Args &&...args)
 
- Static Public Member Functions inherited from SharedFactory< InterfaceQueued >
static std::shared_ptr< InterfaceQueued > make (Args &&...args)
 
- Public Attributes inherited from DPsim::Interface
std::vector< std::tuple< CPS::AttributeBase::Ptr, UInt, bool, bool > > mImportAttrsDpsim
 
std::vector< std::tuple< CPS::AttributeBase::Ptr, UInt > > mExportAttrsDpsim
 

Detailed Description

Definition at line 24 of file InterfaceQueued.h.

Member Typedef Documentation

◆ AttributePacket

using DPsim::InterfaceQueued::AttributePacket
Initial value:
struct AttributePacket {
CPS::AttributeBase::Ptr value;
UInt
attributeId;
UInt
sequenceId;
unsigned char flags;
}

Definition at line 30 of file InterfaceQueued.h.

◆ Ptr

typedef std::shared_ptr<InterfaceQueued> DPsim::InterfaceQueued::Ptr

Definition at line 28 of file InterfaceQueued.h.

Member Enumeration Documentation

◆ AttributePacketFlags

enum DPsim::InterfaceQueued::AttributePacketFlags

Definition at line 39 of file InterfaceQueued.h.

Constructor & Destructor Documentation

◆ InterfaceQueued()

DPsim::InterfaceQueued::InterfaceQueued ( std::shared_ptr< InterfaceWorker > intf,
const String & name = "",
UInt downsampling = 1 )
inline

Definition at line 44 of file InterfaceQueued.h.

◆ ~InterfaceQueued()

virtual DPsim::InterfaceQueued::~InterfaceQueued ( )
inlinevirtual

Definition at line 72 of file InterfaceQueued.h.

Member Function Documentation

◆ close()

void DPsim::InterfaceQueued::close ( )
overridevirtual

Implements DPsim::Interface.

Definition at line 27 of file InterfaceQueued.cpp.

◆ getTasks()

CPS::Task::List DPsim::InterfaceQueued::getTasks ( )
overridevirtual

Implements DPsim::Interface.

Definition at line 42 of file InterfaceQueued.cpp.

◆ open()

void DPsim::InterfaceQueued::open ( )
overridevirtual

Implements DPsim::Interface.

Definition at line 13 of file InterfaceQueued.cpp.

◆ popDpsimAttrsFromQueue()

void DPsim::InterfaceQueued::popDpsimAttrsFromQueue ( bool isSync = false)
virtual

Definition at line 80 of file InterfaceQueued.cpp.

◆ pushDpsimAttrsToQueue()

void DPsim::InterfaceQueued::pushDpsimAttrsToQueue ( )
virtual

Definition at line 130 of file InterfaceQueued.cpp.

◆ setLogger()

void DPsim::InterfaceQueued::setLogger ( CPS::Logger::Log log)
overridevirtual

Reimplemented from DPsim::Interface.

Definition at line 63 of file InterfaceQueued.cpp.

◆ syncExports()

void DPsim::InterfaceQueued::syncExports ( )
overridevirtual

Implements DPsim::Interface.

Definition at line 75 of file InterfaceQueued.cpp.

◆ syncImports()

void DPsim::InterfaceQueued::syncImports ( )
overridevirtual

Function called by the Simulation to perform interface synchronization.

Implements DPsim::Interface.

Definition at line 70 of file InterfaceQueued.cpp.

Member Data Documentation

◆ mDownsampling

UInt DPsim::InterfaceQueued::mDownsampling
protected

Definition at line 79 of file InterfaceQueued.h.

◆ mInterfaceReaderThread

std::thread DPsim::InterfaceQueued::mInterfaceReaderThread
protected

Definition at line 81 of file InterfaceQueued.h.

◆ mInterfaceWorker

std::shared_ptr<InterfaceWorker> DPsim::InterfaceQueued::mInterfaceWorker
protected

Definition at line 78 of file InterfaceQueued.h.

◆ mInterfaceWriterThread

std::thread DPsim::InterfaceQueued::mInterfaceWriterThread
protected

Definition at line 80 of file InterfaceQueued.h.

◆ mQueueDpsimToInterface

std::shared_ptr<moodycamel::BlockingReaderWriterQueue<AttributePacket> > DPsim::InterfaceQueued::mQueueDpsimToInterface
protected

Definition at line 84 of file InterfaceQueued.h.

◆ mQueueInterfaceToDpsim

std::shared_ptr<moodycamel::BlockingReaderWriterQueue<AttributePacket> > DPsim::InterfaceQueued::mQueueInterfaceToDpsim
protected

Definition at line 86 of file InterfaceQueued.h.


The documentation for this class was generated from the following files: