COPASI API  4.40.278
CAnnotation Class Reference

#include <CAnnotation.h>

Inheritance diagram for CAnnotation:
[legend]

Public Types

typedef std::map< std::string, std::string > UnsupportedAnnotation
 

Public Member Functions

bool addUnsupportedAnnotation (const std::string &name, const std::string &xml)
 
bool applyData (const CData &data, CUndoData::CChangeSet &changes)
 
 CAnnotation ()
 
 CAnnotation (const CAnnotation &src)
 
void createUndoData (CUndoData &undoData, const CUndoData::Type &type, const CData &oldData=CData(), const CCore::Framework &framework=CCore::Framework::ParticleNumbers) const
 
virtual const std::string & getKey () const
 
const std::string & getMiriamAnnotation () const
 
const std::string & getNotes () const
 
UnsupportedAnnotationgetUnsupportedAnnotations ()
 
const UnsupportedAnnotationgetUnsupportedAnnotations () const
 
void initMiriamAnnotation (const std::string &newId)
 
bool operator== (const CAnnotation &rhs) const
 
bool removeUnsupportedAnnotation (const std::string &name)
 
bool replaceUnsupportedAnnotation (const std::string &name, const std::string &xml)
 
void setMiriamAnnotation (const std::string &miriamAnnotation, const std::string &newId, const std::string &oldId)
 
void setNotes (const std::string &notes)
 
CData toData () const
 
virtual ~CAnnotation ()
 

Static Public Member Functions

static CMIRIAMInfoallocateMiriamInfo (CDataContainer *pParent)
 
static CAnnotationcastObject (CDataObject *pObject)
 
static const CAnnotationcastObject (const CDataObject *pObject)
 
static void freeMiriamInfo (CDataContainer *pParent)
 

Protected Attributes

std::string mKey
 

Static Private Member Functions

static bool isValidXML (const std::string &xml)
 

Private Attributes

std::string mMiriamAnnotation
 
std::string mNotes
 
UnsupportedAnnotation mUnsupportedAnnotations
 
std::string mXMLId
 

Static Private Attributes

static std::map< CDataContainer *, CMIRIAMInfo * > Container2Info
 

Member Typedef Documentation

◆ UnsupportedAnnotation

typedef std::map< std::string, std::string > CAnnotation::UnsupportedAnnotation

Constructor & Destructor Documentation

◆ CAnnotation() [1/2]

CAnnotation::CAnnotation ( )

Default constructor

◆ CAnnotation() [2/2]

CAnnotation::CAnnotation ( const CAnnotation src)

Copy constructor

Parameters
constCAnnotation & src

◆ ~CAnnotation()

CAnnotation::~CAnnotation ( )
virtual

Member Function Documentation

◆ addUnsupportedAnnotation()

bool CAnnotation::addUnsupportedAnnotation ( const std::string &  name,
const std::string &  xml 
)

Add an unsupported annotation

Parameters
conststd::string & name
conststd::string & xml
Returns
bool success

References CCopasiMessage::ERROR, isValidXML(), MCAnnotation, and mUnsupportedAnnotations.

Referenced by SBMLImporter::importNotes().

◆ allocateMiriamInfo()

CMIRIAMInfo * CAnnotation::allocateMiriamInfo ( CDataContainer pParent)
static

Allocat a MIRIAM Info object for the given CDataContainer * pParent. The ownership is with the parent

Parameters
CDataContainer* pParent
Returns
CMIRIAMInfo * pMiriamInfo

References Container2Info.

Referenced by CDataContainer::getObject().

◆ applyData()

bool CAnnotation::applyData ( const CData data,
CUndoData::CChangeSet changes 
)

◆ castObject() [1/2]

◆ castObject() [2/2]

const CAnnotation * CAnnotation::castObject ( const CDataObject pObject)
static

◆ createUndoData()

void CAnnotation::createUndoData ( CUndoData undoData,
const CUndoData::Type type,
const CData oldData = CData(),
const CCore::Framework framework = CCore::Framework::ParticleNumbers 
) const

Create the undo data which represents the changes recording the differences between the provided oldData and the current data.

Parameters
CUndoData& undoData
constCUndoData::Type & type
constCData & oldData (default: empty data)
constCCore::Framework & framework (default: CCore::Framework::ParticleNumbers)
Returns
CUndoData undoData

References CUndoData::addProperty(), CUndoData::CHANGE, CData::getProperty(), CUndoData::INSERT, mMiriamAnnotation, mNotes, and CUndoData::REMOVE.

Referenced by CFunction::createUndoData(), CEvent::createUndoData(), CModelParameterSet::createUndoData(), CReaction::createUndoData(), CUnitDefinition::createUndoData(), and CModelEntity::createUndoData().

◆ freeMiriamInfo()

void CAnnotation::freeMiriamInfo ( CDataContainer pParent)
static

Free if possible an existing MIRIAM Info object for the given CDataContainer * pParent.

Returns
CMIRIAMInfo * pMiriamInfo

References Container2Info.

Referenced by CMIRIAMInfo::~CMIRIAMInfo().

◆ getKey()

const std::string & CAnnotation::getKey ( ) const
virtual

◆ getMiriamAnnotation()

◆ getNotes()

◆ getUnsupportedAnnotations() [1/2]

◆ getUnsupportedAnnotations() [2/2]

const CAnnotation::UnsupportedAnnotation & CAnnotation::getUnsupportedAnnotations ( ) const

◆ initMiriamAnnotation()

◆ isValidXML()

bool CAnnotation::isValidXML ( const std::string &  xml)
staticprivate

◆ operator==()

bool CAnnotation::operator== ( const CAnnotation rhs) const

Comparison operator

Parameters
constCAnnotation & rhs
Returns
bool equal

References CRDFUtilities::fixLocalFileAboutReference(), mMiriamAnnotation, mNotes, and mXMLId.

◆ removeUnsupportedAnnotation()

bool CAnnotation::removeUnsupportedAnnotation ( const std::string &  name)

Remove an unsupported annotation

Parameters
conststd::string & name
Returns
bool success

References mUnsupportedAnnotations.

◆ replaceUnsupportedAnnotation()

bool CAnnotation::replaceUnsupportedAnnotation ( const std::string &  name,
const std::string &  xml 
)

Replace an unsupported annotation

Parameters
conststd::string & name
conststd::string & xml
Returns
bool success

References CCopasiMessage::ERROR, isValidXML(), MCAnnotation, and mUnsupportedAnnotations.

◆ setMiriamAnnotation()

◆ setNotes()

◆ toData()

CData CAnnotation::toData ( ) const

Member Data Documentation

◆ Container2Info

std::map< CDataContainer *, CMIRIAMInfo * > CAnnotation::Container2Info
staticprivate

◆ mKey

◆ mMiriamAnnotation

std::string CAnnotation::mMiriamAnnotation
private

MIRIAM compliant annotation in RDF/XML format

Referenced by applyData(), createUndoData(), getMiriamAnnotation(), initMiriamAnnotation(), operator==(), setMiriamAnnotation(), and toData().

◆ mNotes

std::string CAnnotation::mNotes
private

Notes in XHTML format

Referenced by applyData(), createUndoData(), getNotes(), operator==(), setNotes(), and toData().

◆ mUnsupportedAnnotations

UnsupportedAnnotation CAnnotation::mUnsupportedAnnotations
private

The annotations which are not supported by COPASI. Note, the name is enforced to be unique.

Referenced by addUnsupportedAnnotation(), getUnsupportedAnnotations(), removeUnsupportedAnnotation(), and replaceUnsupportedAnnotation().

◆ mXMLId

std::string CAnnotation::mXMLId
private

The XMLId used in the about statement

Referenced by initMiriamAnnotation(), operator==(), and setMiriamAnnotation().


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