COPASI API  4.16.103
Public Member Functions | Private Attributes | List of all members
CReference Class Reference

#include <CReference.h>

Inheritance diagram for CReference:
Inheritance graph
[legend]
Collaboration diagram for CReference:
Collaboration graph
[legend]

Public Member Functions

void clearInvalidEntries ()
 
 CReference (const std::string &objectName, const CCopasiContainer *pParent=NULL)
 
 CReference (const CRDFTriplet &triplet, const std::string &objectName="", const CCopasiContainer *pParent=NULL)
 
 CReference (const CReference &src, const CCopasiContainer *pParent=NULL)
 
const std::string & getDescription () const
 
const std::string & getId () const
 
virtual const std::string & getKey () const
 
const CMIRIAMResourceObjectgetMIRIAMResourceObject () const
 
std::string getResource () const
 
const CRDFTripletgetTriplet () const
 
std::string getURI () const
 
void setDescription (const std::string &description)
 
void setId (const std::string &id)
 
void setResource (const std::string &resource)
 
 ~CReference ()
 
- Public Member Functions inherited from CCopasiContainer
virtual bool add (CCopasiObject *pObject, const bool &adopt=true)
 
 CCopasiContainer (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=CCopasiObject::Container)
 
 CCopasiContainer (const CCopasiContainer &src, const CCopasiContainer *pParent=NULL)
 
virtual std::string getChildObjectUnits (const CCopasiObject *pObject) const
 
virtual const CObjectInterfacegetObject (const CCopasiObjectName &cn) const
 
virtual const objectMapgetObjects () const
 
virtual std::string getUnits () const
 
virtual const CCopasiObjectgetValueObject () const
 
virtual bool remove (CCopasiObject *pObject)
 
virtual ~CCopasiContainer ()
 
- Public Member Functions inherited from CCopasiObject
void addDirectDependency (const CCopasiObject *pObject)
 
 CCopasiObject (const CCopasiObject &src, const CCopasiContainer *pParent=NULL)
 
void clearDirectDependencies ()
 
void clearRefresh ()
 
bool dependsOn (DataObjectSet candidates, const DataObjectSet &context=DataObjectSet()) const
 
void getAllDependencies (DataObjectSet &dependencies, const DataObjectSet &context) const
 
virtual CCopasiObjectName getCN () const
 
virtual const DataObjectSetgetDirectDependencies (const DataObjectSet &context=DataObjectSet()) const
 
CCopasiContainergetObjectAncestor (const std::string &type) const
 
CCopasiDataModelgetObjectDataModel ()
 
const CCopasiDataModelgetObjectDataModel () const
 
virtual std::string getObjectDisplayName (bool regular=true, bool richtext=false) const
 
const std::string & getObjectName () const
 
CCopasiContainergetObjectParent () const
 
const std::string & getObjectType () const
 
virtual const
CObjectInterface::ObjectSet
getPrerequisites () const
 
virtual RefreshgetRefresh () const
 
UpdateMethodgetUpdateMethod () const
 
virtual voidgetValuePointer () const
 
bool hasCircularDependencies (DataObjectSet &candidates, DataObjectSet &verified, const DataObjectSet &context) const
 
bool hasUpdateMethod () const
 
bool isArray () const
 
bool isContainer () const
 
bool isDataModel () const
 
bool isMatrix () const
 
bool isNameVector () const
 
bool isNonUniqueName () const
 
virtual bool isPrerequisiteForContext (const CObjectInterface *pObject, const CMath::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const
 
bool isReference () const
 
bool isRoot () const
 
bool isSeparator () const
 
bool isStaticString () const
 
bool isValueBool () const
 
bool isValueDbl () const
 
bool isValueInt () const
 
bool isValueInt64 () const
 
bool isValueString () const
 
bool isVector () const
 
virtual bool mustBeDeleted (const DataObjectSet &deletedObjects) const
 
virtual void print (std::ostream *ostream) const
 
void removeDirectDependency (const CCopasiObject *pObject)
 
void setDirectDependencies (const DataObjectSet &directDependencies)
 
bool setObjectName (const std::string &name)
 
virtual bool setObjectParent (const CCopasiContainer *pParent)
 
void setObjectValue (const C_FLOAT64 &value)
 
void setObjectValue (const C_INT32 &value)
 
void setObjectValue (const bool &value)
 
template<class CType >
void setRefresh (CType *pType, void(CType::*method)(void))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const C_FLOAT64 &))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const C_INT32 &))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const bool &))
 
virtual ~CCopasiObject ()
 
- Public Member Functions inherited from CObjectInterface
 CObjectInterface ()
 
virtual ~CObjectInterface ()
 

Private Attributes

CRDFTriplet mIdTriplet
 
std::string mKey
 
CRDFPredicate::Path mNodePath
 
CMIRIAMResourceObject mResource
 
CRDFTriplet mTriplet
 

Additional Inherited Members

- Public Types inherited from CCopasiContainer
typedef std::multimap
< std::string, CCopasiObject * > 
objectMap
 
- Public Types inherited from CCopasiObject
typedef std::set< const
CCopasiObject * > 
DataObjectSet
 
typedef std::vector< Refresh * > DataUpdateSequence
 
- Public Types inherited from CObjectInterface
typedef std::set< const
CObjectInterface * > 
ObjectSet
 
typedef std::vector
< CObjectInterface * > 
UpdateSequence
 
- Static Public Member Functions inherited from CCopasiObject
static std::vector< Refresh * > buildUpdateSequence (const DataObjectSet &objects, const DataObjectSet &uptoDateObjects, const DataObjectSet &context=DataObjectSet())
 
static void setRenameHandler (CRenameHandler *rh)
 
- Static Public Attributes inherited from CCopasiContainer
static const std::vector
< CCopasiContainer * > 
EmptyList
 
- Protected Types inherited from CCopasiObject
enum  Flag {
  Container = 0x1, Vector = 0x2, Matrix = 0x4, NameVector = 0x8,
  Reference = 0x10, ValueBool = 0x20, ValueInt = 0x40, ValueInt64 = 0x80,
  ValueDbl = 0x100, NonUniqueName = 0x200, StaticString = 0x400, ValueString = 0x800,
  Separator = 0x1000, ModelEntity = 0x2000, Array = 0x4000, DataModel = 0x8000,
  Root = 0x10000, Gui = 0x20000
}
 
- Protected Member Functions inherited from CCopasiContainer
template<class CType >
CCopasiObjectaddMatrixReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
template<class CType >
CCopasiObjectaddObjectReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
template<class CType >
CCopasiObjectaddVectorReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
void initObjects ()
 
- Protected Member Functions inherited from CCopasiObject
 CCopasiObject ()
 
 CCopasiObject (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=0)
 
- Protected Attributes inherited from CCopasiContainer
objectMap mObjects
 
- Static Protected Attributes inherited from CCopasiObject
static CRenameHandlersmpRenameHandler = NULL
 

Detailed Description

CReferences: Stores publication details such as PubMed Id and DOI.

Definition at line 24 of file CReference.h.

Constructor & Destructor Documentation

CReference::CReference ( const std::string &  objectName,
const CCopasiContainer pParent = NULL 
)

Default constructor

Parameters
conststd::string & objectName
constCCopasiContainer * pParent (default: NULL)

Definition at line 22 of file CReference.cpp.

23  :
24  CCopasiContainer(objectName, pParent, "Reference"),
25  mTriplet(),
26  mNodePath(),
27  mKey(CCopasiRootContainer::getKeyFactory()->add("Reference", this)),
28  mIdTriplet(),
29  mResource(NULL)
30 {}
CRDFTriplet mIdTriplet
Definition: CReference.h:46
CMIRIAMResourceObject mResource
Definition: CReference.h:51
CRDFPredicate::Path mNodePath
Definition: CReference.h:36
static CKeyFactory * getKeyFactory()
std::string mKey
Definition: CReference.h:41
virtual bool add(CCopasiObject *pObject, const bool &adopt=true)
CRDFTriplet mTriplet
Definition: CReference.h:31
CReference::CReference ( const CRDFTriplet triplet,
const std::string &  objectName = "",
const CCopasiContainer pParent = NULL 
)

Specific constructor

Parameters
constCRDFTriplet & triplet
conststd::string & objectName (default: "")
constCCopasiContainer * pParent (default: NULL)

Definition at line 32 of file CReference.cpp.

References CRDFPredicate::bqbiol_isDescribedBy, CRDFPredicate::bqmodel_isDescribedBy, CRDFPredicate::copasi_isDescribedBy, CRDFPredicate::end, CRDFNode::getDescendantsWithPredicate(), CRDFNode::getPath(), mIdTriplet, mNodePath, mResource, mTriplet, CRDFTriplet::pObject, and CMIRIAMResourceObject::setNode().

34  :
35  CCopasiContainer(objectName, pParent, "Reference"),
36  mTriplet(triplet),
37  mNodePath(),
38  mKey(CCopasiRootContainer::getKeyFactory()->add("Creator", this)),
39  mIdTriplet(),
40  mResource(NULL)
41 {
42  if (!mTriplet)
43  return;
44 
46 
47  CRDFPredicate::ePredicateType Predicates[] =
48  {
53  };
54 
55  std::set< CRDFTriplet > Triples;
56 
57  CRDFPredicate::ePredicateType * pPredicate = Predicates;
58  std::set< CRDFTriplet >::iterator it;
59 
60  for (; *pPredicate != CRDFPredicate::end; ++pPredicate)
61  {
62  Triples = mTriplet.pObject->getDescendantsWithPredicate(*pPredicate);
63  it = Triples.begin();
64 
65  if (it != Triples.end())
66  {
67  mIdTriplet = *it;
69  }
70  }
71 }
std::set< CRDFTriplet > getDescendantsWithPredicate(const CRDFPredicate &predicate) const
Definition: CRDFNode.cpp:398
CRDFTriplet mIdTriplet
Definition: CReference.h:46
CMIRIAMResourceObject mResource
Definition: CReference.h:51
bool setNode(CRDFNode *pNode)
Definition: CConstants.cpp:150
CRDFPredicate::Path getPath() const
Definition: CRDFNode.cpp:110
CRDFPredicate::Path mNodePath
Definition: CReference.h:36
static CKeyFactory * getKeyFactory()
std::string mKey
Definition: CReference.h:41
virtual bool add(CCopasiObject *pObject, const bool &adopt=true)
CRDFNode * pObject
Definition: CRDFTriplet.h:42
CRDFTriplet mTriplet
Definition: CReference.h:31
CReference::CReference ( const CReference src,
const CCopasiContainer pParent = NULL 
)

Copy constructor

Parameters
const CReference &src
constCCopasiContainer * pParent (default: NULL)

Definition at line 73 of file CReference.cpp.

74  :
75  CCopasiContainer(src, pParent),
76  mTriplet(src.mTriplet),
77  mNodePath(src.mNodePath),
78  mKey(CCopasiRootContainer::getKeyFactory()->add("Creator", this)),
80  mResource(src.mResource)
81 {}
CRDFTriplet mIdTriplet
Definition: CReference.h:46
CMIRIAMResourceObject mResource
Definition: CReference.h:51
CRDFPredicate::Path mNodePath
Definition: CReference.h:36
static CKeyFactory * getKeyFactory()
std::string mKey
Definition: CReference.h:41
virtual bool add(CCopasiObject *pObject, const bool &adopt=true)
CRDFTriplet mTriplet
Definition: CReference.h:31
CReference::~CReference ( )

Destructor

Definition at line 83 of file CReference.cpp.

References CCopasiRootContainer::getKeyFactory(), mKey, and CKeyFactory::remove().

84 {
86 }
bool remove(const std::string &key)
static CKeyFactory * getKeyFactory()
std::string mKey
Definition: CReference.h:41

Member Function Documentation

void CReference::clearInvalidEntries ( )

Remove invalid combinations of resource and id

Definition at line 165 of file CReference.cpp.

References CRDFPredicate::copasi_isDescribedBy, CMIRIAMResourceObject::isValid(), mIdTriplet, mNodePath, mResource, mTriplet, CRDFTriplet::pObject, CRDFNode::setFieldValue(), and CMIRIAMResourceObject::setURI().

166 {
167  // Empty descriptions are handled automatically since setFieldValue removes
168  // a triplet if the value is an empty string.
169 
170  // Handle invalid resource
171  if (!mResource.isValid() && mIdTriplet)
172  {
173  // We remove the Id triplet
175  mIdTriplet = CRDFTriplet(); // This makes it invalid.
176 
177  mResource.setURI("---");
178  }
179 }
bool isValid() const
Definition: CConstants.cpp:182
CRDFTriplet mIdTriplet
Definition: CReference.h:46
CMIRIAMResourceObject mResource
Definition: CReference.h:51
bool setURI(const std::string &URI)
Definition: CConstants.cpp:119
bool setFieldValue(const CMIRIAMResourceObject &value, const CRDFPredicate::ePredicateType &predicate, const CRDFPredicate::Path &nodePath)
Definition: CRDFNode.cpp:142
CRDFPredicate::Path mNodePath
Definition: CReference.h:36
CRDFNode * pObject
Definition: CRDFTriplet.h:42
CRDFTriplet mTriplet
Definition: CReference.h:31
const std::string & CReference::getDescription ( ) const

Retrieve the description for the reference.

Returns
std::string description

Definition at line 157 of file CReference.cpp.

References CRDFPredicate::dcterms_description, CRDFNode::getFieldValue(), mTriplet, and CRDFTriplet::pObject.

const std::string & getFieldValue(const CRDFPredicate::ePredicateType &predicate) const
Definition: CRDFNode.cpp:113
CRDFNode * pObject
Definition: CRDFTriplet.h:42
CRDFTriplet mTriplet
Definition: CReference.h:31
const std::string & CReference::getId ( ) const

Retrieve the id of the reference in the MIRIAM resource.

Returns
const std::string & id

Definition at line 127 of file CReference.cpp.

References CMIRIAMResourceObject::getId(), and mResource.

128 {return mResource.getId();}
CMIRIAMResourceObject mResource
Definition: CReference.h:51
const std::string & getId() const
Definition: CConstants.cpp:116
const std::string & CReference::getKey ( ) const
virtual

Retrieve the key for the object

Returns
const std::string & key

Reimplemented from CCopasiObject.

Definition at line 95 of file CReference.cpp.

References mKey.

96 {return mKey;}
std::string mKey
Definition: CReference.h:41
const CMIRIAMResourceObject & CReference::getMIRIAMResourceObject ( ) const

Retrieve the MIRIAM resource object for this reference

Definition at line 90 of file CReference.cpp.

References mResource.

Referenced by CQMiriamWidget::slotBtnBrowseReference(), and CSBMLExporter::updateMIRIAMAnnotation().

91 {
92  return mResource;
93 }
CMIRIAMResourceObject mResource
Definition: CReference.h:51
std::string CReference::getResource ( ) const

Retrieve the MIRIAM resource for the reference.

Returns
std::string resource

Definition at line 98 of file CReference.cpp.

References CMIRIAMResourceObject::getDisplayName(), and mResource.

99 {return mResource.getDisplayName();}
CMIRIAMResourceObject mResource
Definition: CReference.h:51
std::string getDisplayName() const
Definition: CConstants.cpp:173
const CRDFTriplet & CReference::getTriplet ( ) const

Retrieve the RDF triplet holding the information for this reference.

Returns
const CRDFTriplet & triplet

Definition at line 88 of file CReference.cpp.

References mTriplet.

Referenced by CMIRIAMInfo::removeReference(), and CSBMLExporter::updateMIRIAMAnnotation().

89 {return mTriplet;}
CRDFTriplet mTriplet
Definition: CReference.h:31
std::string CReference::getURI ( ) const

Retrieve the URI (comprised of resource an id) specifying this reference.

Returns
std::string uri

Definition at line 154 of file CReference.cpp.

References CMIRIAMResourceObject::getURI(), and mResource.

155 {return mResource.getURI();}
std::string getURI() const
Definition: CConstants.cpp:133
CMIRIAMResourceObject mResource
Definition: CReference.h:51
void CReference::setDescription ( const std::string &  description)

Set the description for the reference.

Parameters
std::stringdescription

Definition at line 160 of file CReference.cpp.

References CRDFPredicate::dcterms_description, mNodePath, mTriplet, CRDFTriplet::pObject, and CRDFNode::setFieldValue().

161 {
163 }
bool setFieldValue(const CMIRIAMResourceObject &value, const CRDFPredicate::ePredicateType &predicate, const CRDFPredicate::Path &nodePath)
Definition: CRDFNode.cpp:142
CRDFPredicate::Path mNodePath
Definition: CReference.h:36
CRDFNode * pObject
Definition: CRDFTriplet.h:42
CRDFTriplet mTriplet
Definition: CReference.h:31
void CReference::setId ( const std::string &  id)

Set the id of the reference in the MIRIAM resource.

Parameters
conststd::string & id

Definition at line 130 of file CReference.cpp.

References CRDFPredicate::copasi_isDescribedBy, CRDFNode::getDescendantsWithPredicate(), CRDFNode::getObject(), CMIRIAMResourceObject::getURI(), mIdTriplet, mNodePath, mResource, mTriplet, CRDFTriplet::pObject, CRDFNode::setFieldValue(), CMIRIAMResourceObject::setId(), CMIRIAMResourceObject::setNode(), and CRDFObject::setResource().

131 {
132  if (!mIdTriplet)
133  {
134  // We create an Id triplet
136 
137  std::set< CRDFTriplet > Triples;
138  std::set< CRDFTriplet >::iterator it;
139 
141  it = Triples.begin();
142 
143  if (it != Triples.end())
144  {
145  mIdTriplet = *it;
147  }
148  }
149 
150  if (mResource.setId(id))
152 }
std::string getURI() const
Definition: CConstants.cpp:133
std::set< CRDFTriplet > getDescendantsWithPredicate(const CRDFPredicate &predicate) const
Definition: CRDFNode.cpp:398
CRDFTriplet mIdTriplet
Definition: CReference.h:46
CMIRIAMResourceObject mResource
Definition: CReference.h:51
bool setId(const std::string &id)
Definition: CConstants.cpp:101
bool setNode(CRDFNode *pNode)
Definition: CConstants.cpp:150
CRDFObject & getObject()
Definition: CRDFNode.cpp:94
bool setFieldValue(const CMIRIAMResourceObject &value, const CRDFPredicate::ePredicateType &predicate, const CRDFPredicate::Path &nodePath)
Definition: CRDFNode.cpp:142
CRDFPredicate::Path mNodePath
Definition: CReference.h:36
void setResource(const std::string &resource, const bool &isLocal)
Definition: CRDFObject.cpp:88
CRDFNode * pObject
Definition: CRDFTriplet.h:42
CRDFTriplet mTriplet
Definition: CReference.h:31
void CReference::setResource ( const std::string &  resource)

Set the MIRIAM resource for the reference

Parameters
conststd::string & resource

Definition at line 101 of file CReference.cpp.

References CRDFPredicate::copasi_isDescribedBy, CRDFNode::getDescendantsWithPredicate(), CRDFNode::getObject(), CMIRIAMResourceObject::getURI(), mIdTriplet, mNodePath, mResource, mTriplet, CRDFTriplet::pObject, CMIRIAMResourceObject::setDisplayName(), CRDFNode::setFieldValue(), CMIRIAMResourceObject::setNode(), and CRDFObject::setResource().

102 {
103  if (!mIdTriplet)
104  {
105  // We create an Id triplet
106  // This only adds the triplet if the resource is valid, i.e., it does not work;
107 
109 
110  std::set< CRDFTriplet > Triples;
111  std::set< CRDFTriplet >::iterator it;
112 
114  it = Triples.begin();
115 
116  if (it != Triples.end())
117  {
118  mIdTriplet = *it;
120  }
121  }
122 
123  if (mResource.setDisplayName(resource))
125 }
std::string getURI() const
Definition: CConstants.cpp:133
std::set< CRDFTriplet > getDescendantsWithPredicate(const CRDFPredicate &predicate) const
Definition: CRDFNode.cpp:398
CRDFTriplet mIdTriplet
Definition: CReference.h:46
CMIRIAMResourceObject mResource
Definition: CReference.h:51
bool setDisplayName(const std::string &displayName)
Definition: CConstants.cpp:163
bool setNode(CRDFNode *pNode)
Definition: CConstants.cpp:150
CRDFObject & getObject()
Definition: CRDFNode.cpp:94
bool setFieldValue(const CMIRIAMResourceObject &value, const CRDFPredicate::ePredicateType &predicate, const CRDFPredicate::Path &nodePath)
Definition: CRDFNode.cpp:142
CRDFPredicate::Path mNodePath
Definition: CReference.h:36
void setResource(const std::string &resource, const bool &isLocal)
Definition: CRDFObject.cpp:88
CRDFNode * pObject
Definition: CRDFTriplet.h:42
CRDFTriplet mTriplet
Definition: CReference.h:31

Member Data Documentation

CRDFTriplet CReference::mIdTriplet
private

Triplet in the RDF graph representing the reference.

Definition at line 46 of file CReference.h.

Referenced by clearInvalidEntries(), CReference(), setId(), and setResource().

std::string CReference::mKey
private

The key of the object needed for the COPASI tables.

Definition at line 41 of file CReference.h.

Referenced by getKey(), and ~CReference().

CRDFPredicate::Path CReference::mNodePath
private

The predicate path to the node.

Definition at line 36 of file CReference.h.

Referenced by clearInvalidEntries(), CReference(), setDescription(), setId(), and setResource().

CMIRIAMResourceObject CReference::mResource
private

MIRIAM resource for holding database and Id.

Definition at line 51 of file CReference.h.

Referenced by clearInvalidEntries(), CReference(), getId(), getMIRIAMResourceObject(), getResource(), getURI(), setId(), and setResource().

CRDFTriplet CReference::mTriplet
private

Triplet in the RDF graph representing the reference.

Definition at line 31 of file CReference.h.

Referenced by clearInvalidEntries(), CReference(), getDescription(), getTriplet(), setDescription(), setId(), and setResource().


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