COPASI API  4.40.278
CDataHandler Class Reference

#include <CDataHandler.h>

Inheritance diagram for CDataHandler:
[legend]

Public Member Functions

void addAfterName (const CRegisteredCommonName &name)
 
void addBeforeName (const CRegisteredCommonName &name)
 
void addDuringName (const CRegisteredCommonName &name)
 
bool addName (const CRegisteredCommonName &name, const Activity &activity)
 
 CDataHandler (bool separate=false)
 
 CDataHandler (const CDataHandler &src)
 
void cleanup ()
 
void clearNames (const Activity &activity)
 
virtual bool compile (CObjectInterface::ContainerList listOfContainer)
 
virtual void finish ()
 
const std::vector< C_FLOAT64 > & getAfterData () const
 
const std::vector< C_FLOAT64 > & getBeforeData () const
 
const std::vector< std::vector< C_FLOAT64 > > & getDuringData () const
 
std::vector< CRegisteredCommonName > * getNames (const Activity &activity)
 
bool getSeparate () const
 
virtual void output (const Activity &activity)
 
virtual void separate (const Activity &)
 
void setSeparate (bool separate)
 
 ~CDataHandler ()
 
- Public Member Functions inherited from COutputHandler
virtual void addInterface (COutputInterface *pInterface)
 
 COutputHandler ()
 
 COutputHandler (const COutputHandler &src)
 
std::set< COutputInterface * > getInterfaces () const
 
bool isMaster () const
 
virtual void removeInterface (COutputInterface *pInterface)
 
void setMaster (COutputHandler *pMaster)
 
virtual ~COutputHandler ()
 
- Public Member Functions inherited from COutputInterface
virtual void close ()
 
 COutputInterface ()
 
 COutputInterface (const COutputInterface &src)
 
virtual const CObjectInterface::ObjectSetgetObjects () const
 
virtual ~COutputInterface ()
 

Protected Attributes

std::vector< C_FLOAT64mAfterData
 
std::vector< CObjectInterface * > mAfterObjectList
 
std::vector< C_FLOAT64mBeforeData
 
std::vector< CObjectInterface * > mBeforeObjectList
 
std::vector< CRegisteredCommonNamemCNsAfter
 
std::vector< CRegisteredCommonNamemCNsBefore
 
std::vector< CRegisteredCommonNamemCNsDuring
 
std::vector< std::vector< C_FLOAT64 > > mDuringData
 
std::vector< CObjectInterface * > mDuringObjectList
 
bool mSeparate
 
- Protected Attributes inherited from COutputHandler
std::set< COutputInterface * > mInterfaces
 
const CMathContainermpContainer
 
COutputHandlermpMaster
 
CCore::CUpdateSequence mUpdateSequence
 
- Protected Attributes inherited from COutputInterface
CObjectInterface::ObjectSet mObjects
 

Private Member Functions

bool generateObjectsFromName (const CObjectInterface::ContainerList &listOfContainer, std::vector< CObjectInterface * > &objectList, const std::vector< CRegisteredCommonName > *nameVector)
 
void storeDataAfter ()
 
void storeDataBefore ()
 
void storeDataDuring ()
 

Additional Inherited Members

- Public Types inherited from COutputInterface
enum  Activity { BEFORE = 0x01 , DURING = 0x02 , AFTER = 0x04 , MONITORING = 0x08 }
 
- Protected Member Functions inherited from COutputHandler
void applyUpdateSequence ()
 
bool compileUpdateSequence (const CObjectInterface::ContainerList &listOfContainer)
 

Detailed Description

CDataHandler implements an output handler, that captures float for later.

Constructor & Destructor Documentation

◆ CDataHandler() [1/2]

CDataHandler::CDataHandler ( bool  separate = false)

Constructor

Parameters
separateboolean indicate whether NaN / empty vectors are added on calls to separate.

◆ CDataHandler() [2/2]

CDataHandler::CDataHandler ( const CDataHandler src)

Copy constructor.

Parameters
constCDataHandler & src

◆ ~CDataHandler()

CDataHandler::~CDataHandler ( )

Destructor.

References cleanup().

Member Function Documentation

◆ addAfterName()

void CDataHandler::addAfterName ( const CRegisteredCommonName name)

Adds the registered name to the list of names to be collected on Activity::AFTER.

Parameters
namea registered name to a float value reference.

References mCNsAfter.

Referenced by addName().

◆ addBeforeName()

void CDataHandler::addBeforeName ( const CRegisteredCommonName name)

Adds the registered name to the list of names to be collected on Activity::BEFORE.

Parameters
namea registered name to a float value reference.

References mCNsBefore.

Referenced by addName().

◆ addDuringName()

void CDataHandler::addDuringName ( const CRegisteredCommonName name)

Adds the registered name to the list of names to be collected on Activity::DURING.

Parameters
namea registered name to a float value reference.

References mCNsDuring.

Referenced by addName().

◆ addName()

bool CDataHandler::addName ( const CRegisteredCommonName name,
const Activity activity 
)

Adds the registered name to the list of names with the specified activity.

Parameters
namethe registered name to a float value reference
activitythe activity to collect
Returns
true, in case the name could be stored, false otherwise

References addAfterName(), addBeforeName(), addDuringName(), COutputInterface::AFTER, COutputInterface::BEFORE, and COutputInterface::DURING.

◆ cleanup()

void CDataHandler::cleanup ( )

◆ clearNames()

void CDataHandler::clearNames ( const Activity activity)

empties the list of names for the specified activity

Parameters
activitythe activity for which to clear the list of names

References COutputInterface::AFTER, COutputInterface::BEFORE, COutputInterface::DURING, mCNsAfter, mCNsBefore, and mCNsDuring.

◆ compile()

bool CDataHandler::compile ( CObjectInterface::ContainerList  listOfContainer)
virtual

compile the object list from name vector

Parameters
CObjectInterface::ContainerListlistOfContainer
Returns
bool success

Reimplemented from COutputHandler.

References generateObjectsFromName(), mAfterObjectList, mBeforeObjectList, mCNsAfter, mCNsBefore, mCNsDuring, mDuringObjectList, and COutputInterface::mObjects.

◆ finish()

void CDataHandler::finish ( )
virtual

Finish the output

Reimplemented from COutputHandler.

References storeDataAfter().

Referenced by cleanup().

◆ generateObjectsFromName()

bool CDataHandler::generateObjectsFromName ( const CObjectInterface::ContainerList listOfContainer,
std::vector< CObjectInterface * > &  objectList,
const std::vector< CRegisteredCommonName > *  nameVector 
)
private

transfer every individual object list from name vector

References C_INT32, CObjectInterface::GetObjectFromCN(), CDataObject::hasFlag(), MCCopasiTask, COutputInterface::mObjects, and CCopasiMessage::WARNING.

Referenced by compile().

◆ getAfterData()

const std::vector< C_FLOAT64 > & CDataHandler::getAfterData ( ) const
Returns
the data collected for Activity::AFTER

References mAfterData.

◆ getBeforeData()

const std::vector< C_FLOAT64 > & CDataHandler::getBeforeData ( ) const
Returns
the data collected for Activity::BEFORE

References mBeforeData.

◆ getDuringData()

const std::vector< std::vector< C_FLOAT64 > > & CDataHandler::getDuringData ( ) const
Returns
the data collected for Activity::DURING

References mDuringData.

◆ getNames()

std::vector< CRegisteredCommonName > * CDataHandler::getNames ( const Activity activity)

Returns the list of names registered for the given activity

Parameters
activitythe activity for which to return the names
Returns
a pointer to the registered names, or NULL

References COutputInterface::AFTER, COutputInterface::BEFORE, COutputInterface::DURING, mCNsAfter, mCNsBefore, and mCNsDuring.

◆ getSeparate()

bool CDataHandler::getSeparate ( ) const
Returns
the boolean, indicating whether calls to separate will add NaN values (for BEFORE / AFTER), empty vector (DURING)

References mSeparate.

◆ output()

void CDataHandler::output ( const Activity activity)
virtual

Perform an output event for the current activity

Parameters
constActivity & activity

Reimplemented from COutputHandler.

References COutputInterface::AFTER, COutputInterface::BEFORE, COutputInterface::DURING, storeDataAfter(), storeDataBefore(), and storeDataDuring().

◆ separate()

void CDataHandler::separate ( const Activity activity)
virtual

Introduce an additional separator into the output

Parameters
constActivity & activity

Reimplemented from COutputHandler.

References COutputInterface::AFTER, COutputInterface::BEFORE, COutputInterface::DURING, mAfterData, mBeforeData, mDuringData, and mSeparate.

Referenced by setSeparate().

◆ setSeparate()

void CDataHandler::setSeparate ( bool  separate)

Sets what will happen on a call to separate

Parameters
separatethe value to set, true will add NaN values for separate(BEFORE) / separate(AFTER) and an empty vector on separate(DURING).

References mSeparate, and separate().

◆ storeDataAfter()

void CDataHandler::storeDataAfter ( )
private

References getValue(), mAfterData, and mAfterObjectList.

Referenced by finish(), and output().

◆ storeDataBefore()

void CDataHandler::storeDataBefore ( )
private

References getValue(), mBeforeData, and mBeforeObjectList.

Referenced by output().

◆ storeDataDuring()

void CDataHandler::storeDataDuring ( )
private

References getValue(), mDuringData, and mDuringObjectList.

Referenced by output().

Member Data Documentation

◆ mAfterData

std::vector< C_FLOAT64 > CDataHandler::mAfterData
protected

◆ mAfterObjectList

std::vector< CObjectInterface * > CDataHandler::mAfterObjectList
protected

Referenced by cleanup(), compile(), and storeDataAfter().

◆ mBeforeData

std::vector< C_FLOAT64 > CDataHandler::mBeforeData
protected

◆ mBeforeObjectList

std::vector< CObjectInterface * > CDataHandler::mBeforeObjectList
protected

Referenced by cleanup(), compile(), and storeDataBefore().

◆ mCNsAfter

std::vector< CRegisteredCommonName > CDataHandler::mCNsAfter
protected

◆ mCNsBefore

std::vector< CRegisteredCommonName > CDataHandler::mCNsBefore
protected

◆ mCNsDuring

std::vector< CRegisteredCommonName > CDataHandler::mCNsDuring
protected

◆ mDuringData

std::vector< std::vector< C_FLOAT64 > > CDataHandler::mDuringData
protected

◆ mDuringObjectList

std::vector< CObjectInterface * > CDataHandler::mDuringObjectList
protected

Referenced by cleanup(), compile(), and storeDataDuring().

◆ mSeparate

bool CDataHandler::mSeparate
protected

Referenced by getSeparate(), separate(), and setSeparate().


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