#include <DataTrack.h>

Inherits Loggable.

Classes

struct  Element
 

Public Member Functions

 DataTrack ()
 
 DataTrack (Logger *m_Log)
 
 ~DataTrack ()
 
void Clear ()
 
void Reset ()
 
void UseTabDelimiter ()
 
void UseCommaDelimiter ()
 
std::vector< double > const & GetTimes () const
 
size_t NumTracks ()
 
void SetFormatting (const std::string &name, const SEDecimalFormat &f)
 
void SetFormatting (const std::string &name, std::streamsize precision)
 
void SetDefaultFormatting (std::streamsize precision)
 
void Probe (size_t idx, double value)
 
size_t Probe (const std::string &name, double value)
 
size_t Probe (const std::string &name, double value, int i)
 
void Probe (const SEFluidCircuit &c)
 
void Probe (const SEElectricalCircuit &c)
 
void Probe (const SEThermalCircuit &c)
 
void Probe (const SELiquidCompartmentGraph &graph)
 
double GetProbe (size_t idx)
 
double GetProbe (const std::string &name)
 
void Track (size_t idx, double time, double value)
 
size_t Track (const std::string &name, double time, double value)
 
void Track (double time, const SEElectricalCircuit &circuit)
 
void Track (double time, const SEFluidCircuit &circuit)
 
void Track (double time, const SEThermalCircuit &circuit)
 
void Track (double time, const SEGasCompartmentGraph &graph, std::vector< SESubstance *> *substances=nullptr)
 
void Track (double time, const SELiquidCompartmentGraph &graph, std::vector< SESubstance *> *substances=nullptr)
 
double GetTrack (size_t idx, double time)
 
double GetTrack (const std::string &name, double time)
 
std::vector< std::string > ReadTrackFromFile (const char *fileName)
 
std::vector< std::string > StreamDataFromFile (const char *fileName)
 
double StreamDataFromFile (std::vector< std::string > *headings)
 
void CreateFile (const char *fileName, std::ofstream &newFile)
 
void WriteTrackToFile (const char *fileName)
 
void StreamTrackToFile (std::ofstream &file)
 
void StreamProbesToFile (double time, std::ofstream &file)
 
- Public Member Functions inherited from Loggable
 Loggable (Logger *logger=nullptr)
 
 Loggable (std::string const &logfile)
 
virtual ~Loggable ()
 
virtual LoggerGetLogger () const
 
virtual void SetLogger (Logger &logger)
 
virtual void Debug (std::string const &msg, std::string const &origin=empty) const
 
virtual void Debug (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Debug (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Info (std::string const &msg, std::string const &origin=empty) const
 
virtual void Info (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Info (const std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Info (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Warning (std::string const &msg, std::string const &origin=empty) const
 
virtual void Warning (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Warning (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Error (std::string const &msg, std::string const &origin=empty) const
 
virtual void Error (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Error (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::string const &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::ostream &msg, std::string const &origin=empty) const
 

Protected Types

typedef std::vector< ElementElementVector
 

Protected Member Functions

ElementGetElement (size_t idx)
 
ElementGetElement (std::string const &name)
 

Protected Attributes

ElementVector m_Elements
 
char m_Delimiter
 
double m_LastTime = -1.0
 
std::vector< double > m_Times
 
std::streamsize m_DefaultPrecision = 3
 
std::ifstream m_FileStream
 
- Protected Attributes inherited from Loggable
bool myLogger
 
Loggerm_Logger
 

Additional Inherited Members

- Static Public Attributes inherited from Loggable
static const std::string empty
 

Member Typedef Documentation

◆ ElementVector

typedef std::vector<Element> DataTrack::ElementVector
protected

Constructor & Destructor Documentation

◆ DataTrack() [1/2]

DataTrack::DataTrack ( )

◆ DataTrack() [2/2]

DataTrack::DataTrack ( Logger m_Log)

◆ ~DataTrack()

DataTrack::~DataTrack ( )

Member Function Documentation

◆ Clear()

void DataTrack::Clear ( )

◆ CreateFile()

void DataTrack::CreateFile ( const char *  fileName,
std::ofstream &  newFile 
)

◆ GetElement() [1/2]

DataTrack::Element & DataTrack::GetElement ( size_t  idx)
protected

◆ GetElement() [2/2]

DataTrack::Element & DataTrack::GetElement ( std::string const &  name)
protected

◆ GetProbe() [1/2]

double DataTrack::GetProbe ( size_t  idx)

◆ GetProbe() [2/2]

double DataTrack::GetProbe ( const std::string &  name)

◆ GetTimes()

std::vector< double > const & DataTrack::GetTimes ( ) const

◆ GetTrack() [1/2]

double DataTrack::GetTrack ( size_t  idx,
double  time 
)

◆ GetTrack() [2/2]

double DataTrack::GetTrack ( const std::string &  name,
double  time 
)

◆ NumTracks()

size_t DataTrack::NumTracks ( )
inline

◆ Probe() [1/7]

void DataTrack::Probe ( size_t  idx,
double  value 
)

◆ Probe() [2/7]

size_t DataTrack::Probe ( const std::string &  name,
double  value 
)

◆ Probe() [3/7]

size_t DataTrack::Probe ( const std::string &  name,
double  value,
int  i 
)

◆ Probe() [4/7]

void DataTrack::Probe ( const SEFluidCircuit c)

◆ Probe() [5/7]

void DataTrack::Probe ( const SEElectricalCircuit c)

◆ Probe() [6/7]

void DataTrack::Probe ( const SEThermalCircuit c)

◆ Probe() [7/7]

void DataTrack::Probe ( const SELiquidCompartmentGraph graph)

◆ ReadTrackFromFile()

std::vector< std::string > DataTrack::ReadTrackFromFile ( const char *  fileName)

◆ Reset()

void DataTrack::Reset ( )

◆ SetDefaultFormatting()

void DataTrack::SetDefaultFormatting ( std::streamsize  precision)

◆ SetFormatting() [1/2]

void DataTrack::SetFormatting ( const std::string &  name,
const SEDecimalFormat f 
)

◆ SetFormatting() [2/2]

void DataTrack::SetFormatting ( const std::string &  name,
std::streamsize  precision 
)

◆ StreamDataFromFile() [1/2]

std::vector< std::string > DataTrack::StreamDataFromFile ( const char *  fileName)

◆ StreamDataFromFile() [2/2]

double DataTrack::StreamDataFromFile ( std::vector< std::string > *  headings)

◆ StreamProbesToFile()

void DataTrack::StreamProbesToFile ( double  time,
std::ofstream &  file 
)

◆ StreamTrackToFile()

void DataTrack::StreamTrackToFile ( std::ofstream &  file)

◆ Track() [1/7]

void DataTrack::Track ( size_t  idx,
double  time,
double  value 
)

◆ Track() [2/7]

size_t DataTrack::Track ( const std::string &  name,
double  time,
double  value 
)

◆ Track() [3/7]

void DataTrack::Track ( double  time,
const SEElectricalCircuit circuit 
)

◆ Track() [4/7]

void DataTrack::Track ( double  time,
const SEFluidCircuit circuit 
)

◆ Track() [5/7]

void DataTrack::Track ( double  time,
const SEThermalCircuit circuit 
)

◆ Track() [6/7]

void DataTrack::Track ( double  time,
const SEGasCompartmentGraph graph,
std::vector< SESubstance *> *  substances = nullptr 
)

◆ Track() [7/7]

void DataTrack::Track ( double  time,
const SELiquidCompartmentGraph graph,
std::vector< SESubstance *> *  substances = nullptr 
)

◆ UseCommaDelimiter()

void DataTrack::UseCommaDelimiter ( )
inline

◆ UseTabDelimiter()

void DataTrack::UseTabDelimiter ( )
inline

◆ WriteTrackToFile()

void DataTrack::WriteTrackToFile ( const char *  fileName)

Member Data Documentation

◆ m_DefaultPrecision

std::streamsize DataTrack::m_DefaultPrecision = 3
protected

◆ m_Delimiter

char DataTrack::m_Delimiter
protected

◆ m_Elements

ElementVector DataTrack::m_Elements
protected

◆ m_FileStream

std::ifstream DataTrack::m_FileStream
protected

◆ m_LastTime

double DataTrack::m_LastTime = -1.0
protected

◆ m_Times

std::vector<double> DataTrack::m_Times
protected

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.