COPASI API
4.40.278
|
#include <CAnnotation.h>
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 |
UnsupportedAnnotation & | getUnsupportedAnnotations () |
const UnsupportedAnnotation & | getUnsupportedAnnotations () 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 ¬es) |
CData | toData () const |
virtual | ~CAnnotation () |
Static Public Member Functions | |
static CMIRIAMInfo * | allocateMiriamInfo (CDataContainer *pParent) |
static CAnnotation * | castObject (CDataObject *pObject) |
static const CAnnotation * | castObject (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 |
typedef std::map< std::string, std::string > CAnnotation::UnsupportedAnnotation |
CAnnotation::CAnnotation | ( | ) |
Default constructor
CAnnotation::CAnnotation | ( | const CAnnotation & | src | ) |
Copy constructor
const | CAnnotation & src |
|
virtual |
Destructor
References CRootContainer::getKeyFactory(), mKey, and CKeyFactory::remove().
bool CAnnotation::addUnsupportedAnnotation | ( | const std::string & | name, |
const std::string & | xml | ||
) |
Add an unsupported annotation
const | std::string & name |
const | std::string & xml |
References CCopasiMessage::ERROR, isValidXML(), MCAnnotation, and mUnsupportedAnnotations.
Referenced by SBMLImporter::importNotes().
|
static |
Allocat a MIRIAM Info object for the given CDataContainer * pParent. The ownership is with the parent
CDataContainer | * pParent |
References Container2Info.
Referenced by CDataContainer::getObject().
bool CAnnotation::applyData | ( | const CData & | data, |
CUndoData::CChangeSet & | changes | ||
) |
Apply the provided data to the annotation
const | CData & data |
References CData::getProperty(), CData::isSetProperty(), mMiriamAnnotation, mNotes, and CDataValue::toString().
Referenced by CFunction::applyData(), CEvent::applyData(), CModelParameterSet::applyData(), CReaction::applyData(), CUnitDefinition::applyData(), and CModelEntity::applyData().
|
static |
|
static |
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.
CUndoData | & undoData |
const | CUndoData::Type & type |
const | CData & oldData (default: empty data) |
const | CCore::Framework & framework (default: CCore::Framework::ParticleNumbers) |
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().
|
static |
Free if possible an existing MIRIAM Info object for the given CDataContainer * pParent.
References Container2Info.
Referenced by CMIRIAMInfo::~CMIRIAMInfo().
|
virtual |
Retrieve the key
Reimplemented in CModelEntity, CUnitDefinition, CReaction, CModelParameterSet, CModel, CEvent, and CFunction.
References mKey.
Referenced by CFunction::getKey(), CMIRIAMInfo::getKey(), CEvent::getKey(), CReaction::getKey(), CUnitDefinition::getKey(), CModelEntity::getKey(), SBMLImporter::importMIRIAM(), and CMIRIAMInfo::save().
const std::string & CAnnotation::getMiriamAnnotation | ( | ) | const |
Retrieve the RDF/XML representation of the MIRIAM annotation
References mMiriamAnnotation.
Referenced by CEvent::CEvent(), CFunction::CFunction(), CModelEntity::CModelEntity(), CModelParameterSet::CModelParameterSet(), CReaction::CReaction(), CUnitDefinition::CUnitDefinition(), CModelExpansion::duplicateCompartment(), CModelExpansion::duplicateEvent(), CModelExpansion::duplicateGlobalQuantity(), CModelExpansion::duplicateMetab(), CModelExpansion::duplicateReaction(), SBMLImporter::importMIRIAM(), CMIRIAMInfo::load(), CCopasiXML::saveAnnotation(), and CSBMLExporter::updateMIRIAMAnnotation().
const std::string & CAnnotation::getNotes | ( | ) | const |
Retrieve the XHTML notes
References mNotes.
Referenced by CModelExpansion::duplicateCompartment(), CModelExpansion::duplicateEvent(), CModelExpansion::duplicateGlobalQuantity(), CModelExpansion::duplicateMetab(), CModelExpansion::duplicateReaction(), CModel::initObjects(), CCopasiXML::saveAnnotation(), and CSBMLExporter::setSBMLNotes().
CAnnotation::UnsupportedAnnotation & CAnnotation::getUnsupportedAnnotations | ( | ) |
Retrieve the unsupported annotations in xml format.
References mUnsupportedAnnotations.
Referenced by CompartmentHandler::processEnd(), EventHandler::processEnd(), FunctionHandler::processEnd(), MetaboliteHandler::processEnd(), ModelHandler::processEnd(), ModelValueHandler::processEnd(), ReactionHandler::processEnd(), UnitDefinitionHandler::processEnd(), CCopasiXML::saveAnnotation(), and CSBMLExporter::setSBMLNotes().
const CAnnotation::UnsupportedAnnotation & CAnnotation::getUnsupportedAnnotations | ( | ) | const |
References mUnsupportedAnnotations.
void CAnnotation::initMiriamAnnotation | ( | const std::string & | newId | ) |
References mMiriamAnnotation, and mXMLId.
Referenced by CEvent::CEvent(), CFunction::CFunction(), CModelEntity::CModelEntity(), CModelParameterSet::CModelParameterSet(), CReaction::CReaction(), and CUnitDefinition::CUnitDefinition().
|
staticprivate |
References BUFFER_SIZE, CCopasiMessage::getLastMessage(), CExpatTemplate< CType >::parse(), and CCopasiMessage::size().
Referenced by addUnsupportedAnnotation(), and replaceUnsupportedAnnotation().
bool CAnnotation::operator== | ( | const CAnnotation & | rhs | ) | const |
Comparison operator
const | CAnnotation & rhs |
References CRDFUtilities::fixLocalFileAboutReference(), mMiriamAnnotation, mNotes, and mXMLId.
bool CAnnotation::removeUnsupportedAnnotation | ( | const std::string & | name | ) |
Remove an unsupported annotation
const | std::string & name |
References mUnsupportedAnnotations.
bool CAnnotation::replaceUnsupportedAnnotation | ( | const std::string & | name, |
const std::string & | xml | ||
) |
Replace an unsupported annotation
const | std::string & name |
const | std::string & xml |
References CCopasiMessage::ERROR, isValidXML(), MCAnnotation, and mUnsupportedAnnotations.
void CAnnotation::setMiriamAnnotation | ( | const std::string & | miriamAnnotation, |
const std::string & | newId, | ||
const std::string & | oldId | ||
) |
Set the RDF/XML representation of the MIRIAM annotation
const | std::string & miriamAnnotation |
const | std::string & newId |
const | std::string & oldId |
References CRDFUtilities::fixLocalFileAboutReference(), mMiriamAnnotation, and mXMLId.
Referenced by CEvent::CEvent(), CFunction::CFunction(), CModelEntity::CModelEntity(), CModelParameterSet::CModelParameterSet(), CReaction::CReaction(), CUnitDefinition::CUnitDefinition(), CModelExpansion::duplicateCompartment(), CModelExpansion::duplicateEvent(), CModelExpansion::duplicateGlobalQuantity(), CModelExpansion::duplicateMetab(), CModelExpansion::duplicateReaction(), SBMLImporter::importMIRIAM(), CompartmentHandler::processEnd(), EventHandler::processEnd(), FunctionHandler::processEnd(), MetaboliteHandler::processEnd(), ModelHandler::processEnd(), ModelParameterSetHandler::processEnd(), ModelValueHandler::processEnd(), ReactionHandler::processEnd(), UnitDefinitionHandler::processEnd(), and CMIRIAMInfo::save().
void CAnnotation::setNotes | ( | const std::string & | notes | ) |
Set the XHTML Notes
const | std::string & notes |
References mNotes.
Referenced by CModelVersion::CModelVersion(), CModelExpansion::duplicateCompartment(), CModelExpansion::duplicateEvent(), CModelExpansion::duplicateGlobalQuantity(), CModelExpansion::duplicateMetab(), CModelExpansion::duplicateReaction(), SBMLImporter::importNotes(), CModel::load(), CompartmentHandler::processEnd(), EventHandler::processEnd(), FunctionHandler::processEnd(), MetaboliteHandler::processEnd(), ModelHandler::processEnd(), ModelValueHandler::processEnd(), ReactionHandler::processEnd(), and UnitDefinitionHandler::processEnd().
CData CAnnotation::toData | ( | ) | const |
Retrieve the data describing the annotation
References CData::addProperty(), mMiriamAnnotation, and mNotes.
Referenced by CFunction::toData(), CEvent::toData(), CModelParameterSet::toData(), CReaction::toData(), CUnitDefinition::toData(), and CModelEntity::toData().
|
staticprivate |
Referenced by allocateMiriamInfo(), and freeMiriamInfo().
|
protected |
Key of the model entity. It is stored here, but constructed in the derived classes.
Referenced by CEvent::CEvent(), CFunction::CFunction(), CModelEntity::CModelEntity(), CReaction::CReaction(), CUnitDefinition::CUnitDefinition(), getKey(), CModel::getKey(), CUnitDefinition::setup(), ~CAnnotation(), CCompartment::~CCompartment(), CEvent::~CEvent(), CFunction::~CFunction(), CMetab::~CMetab(), CModel::~CModel(), CReaction::~CReaction(), and CUnitDefinition::~CUnitDefinition().
|
private |
MIRIAM compliant annotation in RDF/XML format
Referenced by applyData(), createUndoData(), getMiriamAnnotation(), initMiriamAnnotation(), operator==(), setMiriamAnnotation(), and toData().
|
private |
Notes in XHTML format
Referenced by applyData(), createUndoData(), getNotes(), operator==(), setNotes(), and toData().
|
private |
The annotations which are not supported by COPASI. Note, the name is enforced to be unique.
Referenced by addUnsupportedAnnotation(), getUnsupportedAnnotations(), removeUnsupportedAnnotation(), and replaceUnsupportedAnnotation().
|
private |
The XMLId used in the about statement
Referenced by initMiriamAnnotation(), operator==(), and setMiriamAnnotation().