COPASI API  4.16.103
CAnnotation.h
Go to the documentation of this file.
1 // Copyright (C) 2010 - 2013 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 #ifndef COPASI_CAnnotation
7 #define COPASI_CAnnotation
8 
9 #include <string>
10 #include <map>
11 
12 class CCopasiObject;
13 
15 {
16 public:
17  typedef std::map< std::string, std::string > UnsupportedAnnotation;
18 
19  // Operations
20 public:
21  static CAnnotation * castObject(CCopasiObject * pObject);
22  static const CAnnotation * castObject(const CCopasiObject * pObject);
23 
24  /**
25  * Default constructor
26  */
27  CAnnotation();
28 
29  /**
30  * Copy constructor
31  * @param const CAnnotation & src
32  */
33  CAnnotation(const CAnnotation & src);
34 
35  /**
36  * Destructor
37  */
38  virtual ~CAnnotation();
39 
40  /**
41  * Retrieve the key
42  * @return std::string key
43  */
44  virtual const std::string & getKey() const;
45 
46  /**
47  * Set the RDF/XML representation of the MIRIAM annotation
48  * @param const std::string & miriamAnnotation
49  * @param const std::string & newId
50  * @param const std::string & oldId
51  */
52  void setMiriamAnnotation(const std::string & miriamAnnotation,
53  const std::string & newId,
54  const std::string & oldId);
55 
56  /**
57  * Retrieve the RDF/XML representation of the MIRIAM annotation
58  * @return const std::string & miriamAnnotation
59  */
60  const std::string & getMiriamAnnotation() const;
61 
62  /**
63  * Set the XHTML Notes
64  * @param const std::string & notes
65  */
66  void setNotes(const std::string & notes);
67 
68  /**
69  * Retrieve the XHTML notes
70  * @return const std::string & notes
71  */
72  const std::string & getNotes() const;
73 
74  /**
75  * Comparison operator
76  * @param const CAnnotation & rhs
77  * @return bool equal
78  */
79  bool operator == (const CAnnotation & rhs) const;
80 
81  /**
82  * Retrieve the unsupported annotations in xml format.
83  * @return std::map< std::string, std::string > & unsupportedAnnotations
84  */
87 
88  /**
89  * Add an unsupported annotation
90  * @param const std::string & name
91  * @param const std::string & xml
92  * @return bool success
93  */
94  bool addUnsupportedAnnotation(const std::string & name, const std::string & xml);
95 
96  /**
97  * Replace an unsupported annotation
98  * @param const std::string & name
99  * @param const std::string & xml
100  * @return bool success
101  */
102  bool replaceUnsupportedAnnotation(const std::string & name, const std::string & xml);
103 
104  /**
105  * Remove an unsupported annotation
106  * @param const std::string & name
107  * @return bool success
108  */
109  bool removeUnsupportedAnnotation(const std::string & name);
110 
111 private:
112  static bool isValidXML(const std::string & xml);
113 
114  // Attributes
115 protected:
116  /**
117  * Key of the model entity. It is stored here, but constructed in the derived classes.
118  */
119  std::string mKey;
120 
121 private:
122  /**
123  * Notes in XHTML format
124  */
125  std::string mNotes;
126 
127  /**
128  * MIRIAM compliant annotation in RDF/XML format
129  */
130  std::string mMiriamAnnotation;
131 
132  /**
133  * The XMLId used in the about statement
134  */
135  std::string mXMLId;
136 
137  /**
138  * The annotations which are not supported by COPASI. Note,
139  * the name is enforced to be unique.
140  */
142 };
143 
144 #endif // COPASI_CAnnotation
std::string mNotes
Definition: CAnnotation.h:125
bool operator==(const CAnnotation &rhs) const
std::string mMiriamAnnotation
Definition: CAnnotation.h:130
void setNotes(const std::string &notes)
UnsupportedAnnotation mUnsupportedAnnotations
Definition: CAnnotation.h:141
void setMiriamAnnotation(const std::string &miriamAnnotation, const std::string &newId, const std::string &oldId)
const std::string & getMiriamAnnotation() const
virtual ~CAnnotation()
Definition: CAnnotation.cpp:97
std::string mKey
Definition: CAnnotation.h:119
static CAnnotation * castObject(CCopasiObject *pObject)
Definition: CAnnotation.cpp:32
const std::string & getNotes() const
static bool isValidXML(const std::string &xml)
bool removeUnsupportedAnnotation(const std::string &name)
bool addUnsupportedAnnotation(const std::string &name, const std::string &xml)
std::map< std::string, std::string > UnsupportedAnnotation
Definition: CAnnotation.h:17
std::string mXMLId
Definition: CAnnotation.h:135
UnsupportedAnnotation & getUnsupportedAnnotations()
bool replaceUnsupportedAnnotation(const std::string &name, const std::string &xml)
virtual const std::string & getKey() const