#include <PhysiologyEngineThunk.h>

Inherits LoggerForward, and SEEventHandler.

Inherited by PulseEngineThunk.

Public Member Functions

 PhysiologyEngineThunk (const std::string &dataDir="./")
 
virtual ~PhysiologyEngineThunk ()
 
virtual void Clear ()
 
bool SerializeFromFile (std::string const &filename, std::string const &data_requests, eSerializationFormat data_requests_format)
 
bool SerializeToFile (std::string const &filename)
 
bool SerializeFromString (std::string const &state, std::string const &data_requests, eSerializationFormat format)
 
std::string SerializeToString (eSerializationFormat format)
 
bool InitializeEngine (std::string const &patient_configuration, std::string const &data_requests, eSerializationFormat format)
 
std::string GetInitialPatient (eSerializationFormat format)
 
std::string GetConditions (eSerializationFormat format)
 
void LogToConsole (bool b)
 
void KeepLogMessages (bool keep)
 
void SetLogFilename (std::string const &logfile)
 
std::string PullLogMessages (eSerializationFormat format)
 
void SetLoggerForward (LoggerForward *lf)
 
void KeepEventChanges (bool keep)
 
std::string PullEvents (eSerializationFormat format)
 
std::string PullActiveEvents (eSerializationFormat format)
 
std::string GetPatientAssessment (int type, eSerializationFormat format)
 
void SetEventHandler (SEEventHandler *eh)
 
bool ProcessActions (std::string const &actions, eSerializationFormat format)
 
std::string PullActiveActions (eSerializationFormat format)
 
bool AdvanceTimeStep ()
 
double GetTimeStep (std::string const &unit)
 
size_t DataLength () const
 
double * PullDataPtr ()
 
void PullData (std::vector< double > &data)
 
void ForwardDebug (const std::string &msg) override
 
void ForwardInfo (const std::string &msg) override
 
void ForwardWarning (const std::string &msg) override
 
void ForwardError (const std::string &msg) override
 
void ForwardFatal (const std::string &msg) override
 
void HandleEvent (eEvent type, bool active, const SEScalarTime *time=nullptr) override
 
- Public Member Functions inherited from LoggerForward
virtual ~LoggerForward ()=default
 
virtual void ForwardDebug (std::string const &)
 
virtual void ForwardInfo (std::string const &)
 
virtual void ForwardWarning (std::string const &)
 
virtual void ForwardError (std::string const &)
 
virtual void ForwardFatal (std::string const &)
 
- Public Member Functions inherited from SEEventHandler
 SEEventHandler ()
 
virtual ~SEEventHandler ()
 
virtual void HandleEvent (eEvent e, bool active, const SEScalarTime *simTime=nullptr)=0
 

Protected Member Functions

virtual void AllocateEngine ()=0
 
virtual void SetupDefaultDataRequests ()
 
virtual bool SetupRequests ()
 

Protected Attributes

std::unique_ptr< PhysiologyEnginem_engine
 
SESubstanceManagerm_subMgr = nullptr
 
bool m_keepLogMsgs = false
 
bool m_keepEventChanges = false
 
LoggerForwardm_ForwardLogs =nullptr
 
SEEventHandlerm_ForwardEvents =nullptr
 
LogMessages m_logMsgs
 
std::string m_dataDir
 
std::vector< const SEEventChange * > m_events
 
std::vector< const SEActiveEvent * > m_activeEvents
 
size_t m_length
 
double * m_requestedData = nullptr
 
std::vector< double > m_requestedValues
 

Detailed Description

An instance of an engine where the interface is define in stl and base data types. This interface is a thunk layer using serialized cdm objects to drive a Pulse engine.

Constructor & Destructor Documentation

◆ PhysiologyEngineThunk()

PhysiologyEngineThunk::PhysiologyEngineThunk ( const std::string &  dataDir = "./")

◆ ~PhysiologyEngineThunk()

PhysiologyEngineThunk::~PhysiologyEngineThunk ( )
virtual

Member Function Documentation

◆ AdvanceTimeStep()

bool PhysiologyEngineThunk::AdvanceTimeStep ( )

◆ AllocateEngine()

virtual void PhysiologyEngineThunk::AllocateEngine ( )
protectedpure virtual

Implemented in PulseEngineThunk.

◆ Clear()

void PhysiologyEngineThunk::Clear ( )
virtual

◆ DataLength()

size_t PhysiologyEngineThunk::DataLength ( ) const

◆ ForwardDebug()

void PhysiologyEngineThunk::ForwardDebug ( const std::string &  msg)
overridevirtual

Reimplemented from LoggerForward.

◆ ForwardError()

void PhysiologyEngineThunk::ForwardError ( const std::string &  msg)
overridevirtual

Reimplemented from LoggerForward.

◆ ForwardFatal()

void PhysiologyEngineThunk::ForwardFatal ( const std::string &  msg)
overridevirtual

Reimplemented from LoggerForward.

◆ ForwardInfo()

void PhysiologyEngineThunk::ForwardInfo ( const std::string &  msg)
overridevirtual

Reimplemented from LoggerForward.

◆ ForwardWarning()

void PhysiologyEngineThunk::ForwardWarning ( const std::string &  msg)
overridevirtual

Reimplemented from LoggerForward.

◆ GetConditions()

std::string PhysiologyEngineThunk::GetConditions ( eSerializationFormat  format)

◆ GetInitialPatient()

std::string PhysiologyEngineThunk::GetInitialPatient ( eSerializationFormat  format)

◆ GetPatientAssessment()

std::string PhysiologyEngineThunk::GetPatientAssessment ( int  type,
eSerializationFormat  format 
)

◆ GetTimeStep()

double PhysiologyEngineThunk::GetTimeStep ( std::string const &  unit)

◆ HandleEvent()

void PhysiologyEngineThunk::HandleEvent ( eEvent  type,
bool  active,
const SEScalarTime time = nullptr 
)
overridevirtual

Implements SEEventHandler.

◆ InitializeEngine()

bool PhysiologyEngineThunk::InitializeEngine ( std::string const &  patient_configuration,
std::string const &  data_requests,
eSerializationFormat  format 
)

◆ KeepEventChanges()

void PhysiologyEngineThunk::KeepEventChanges ( bool  keep)

◆ KeepLogMessages()

void PhysiologyEngineThunk::KeepLogMessages ( bool  keep)

◆ LogToConsole()

void PhysiologyEngineThunk::LogToConsole ( bool  b)

◆ ProcessActions()

bool PhysiologyEngineThunk::ProcessActions ( std::string const &  actions,
eSerializationFormat  format 
)

◆ PullActiveActions()

std::string PhysiologyEngineThunk::PullActiveActions ( eSerializationFormat  format)

◆ PullActiveEvents()

std::string PhysiologyEngineThunk::PullActiveEvents ( eSerializationFormat  format)

◆ PullData()

void PhysiologyEngineThunk::PullData ( std::vector< double > &  data)

◆ PullDataPtr()

double * PhysiologyEngineThunk::PullDataPtr ( )

◆ PullEvents()

std::string PhysiologyEngineThunk::PullEvents ( eSerializationFormat  format)

◆ PullLogMessages()

std::string PhysiologyEngineThunk::PullLogMessages ( eSerializationFormat  format)

◆ SerializeFromFile()

bool PhysiologyEngineThunk::SerializeFromFile ( std::string const &  filename,
std::string const &  data_requests,
eSerializationFormat  data_requests_format 
)

◆ SerializeFromString()

bool PhysiologyEngineThunk::SerializeFromString ( std::string const &  state,
std::string const &  data_requests,
eSerializationFormat  format 
)

◆ SerializeToFile()

bool PhysiologyEngineThunk::SerializeToFile ( std::string const &  filename)

◆ SerializeToString()

std::string PhysiologyEngineThunk::SerializeToString ( eSerializationFormat  format)

◆ SetEventHandler()

void PhysiologyEngineThunk::SetEventHandler ( SEEventHandler eh)
inline

◆ SetLogFilename()

void PhysiologyEngineThunk::SetLogFilename ( std::string const &  logfile)

◆ SetLoggerForward()

void PhysiologyEngineThunk::SetLoggerForward ( LoggerForward lf)
inline

◆ SetupDefaultDataRequests()

void PhysiologyEngineThunk::SetupDefaultDataRequests ( )
protectedvirtual

◆ SetupRequests()

bool PhysiologyEngineThunk::SetupRequests ( )
protectedvirtual

Member Data Documentation

◆ m_activeEvents

std::vector<const SEActiveEvent*> PhysiologyEngineThunk::m_activeEvents
protected

◆ m_dataDir

std::string PhysiologyEngineThunk::m_dataDir
protected

◆ m_engine

std::unique_ptr<PhysiologyEngine> PhysiologyEngineThunk::m_engine
protected

◆ m_events

std::vector<const SEEventChange*> PhysiologyEngineThunk::m_events
protected

◆ m_ForwardEvents

SEEventHandler* PhysiologyEngineThunk::m_ForwardEvents =nullptr
protected

◆ m_ForwardLogs

LoggerForward* PhysiologyEngineThunk::m_ForwardLogs =nullptr
protected

◆ m_keepEventChanges

bool PhysiologyEngineThunk::m_keepEventChanges = false
protected

◆ m_keepLogMsgs

bool PhysiologyEngineThunk::m_keepLogMsgs = false
protected

◆ m_length

size_t PhysiologyEngineThunk::m_length
protected

◆ m_logMsgs

LogMessages PhysiologyEngineThunk::m_logMsgs
protected

◆ m_requestedData

double* PhysiologyEngineThunk::m_requestedData = nullptr
protected

◆ m_requestedValues

std::vector<double> PhysiologyEngineThunk::m_requestedValues
protected

◆ m_subMgr

SESubstanceManager* PhysiologyEngineThunk::m_subMgr = nullptr
protected

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.