COPASI API  4.16.103
SBMLReference.h
Go to the documentation of this file.
1 /* Begin CVS Header
2  $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/sbml/SBMLReference.h,v $
3  $Revision: 1.2 $
4  $Name: $
5  $Author: shoops $
6  $Date: 2006/04/27 01:31:21 $
7  End CVS Header */
8 
9 // Copyright 2005 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc. and EML Research, gGmbH.
11 // All rights reserved.
12 
13 #ifndef COPASI_SBMLReference
14 #define COPASI_SBMLReference
15 
16 #include <string>
17 #include <map>
18 
20  {
21  public:
22  typedef std::map<std::string, std::string>::const_iterator const_iterator;
23 
24  // Operations
25  /**
26  * Default constructor
27  */
28  SBMLReference();
29 
30  /**
31  * copy constructor
32  */
33  SBMLReference(const SBMLReference & src);
34 
35  /**
36  * Default constructor
37  */
39 
40  /**
41  * Set URL of the refernced SBML file.
42  * @param const std::string & id
43  * @return bool success
44  */
45  bool setURL(const std::string & url);
46 
47  /**
48  * Retrieve the URL of the referenced SBML file
49  * @return const std::string & url
50  */
51  const std::string & getURL() const;
52 
53  /**
54  * Retrieve the SBML Id which is mapped to the given COPASI key.
55  * @param const std::string & key
56  * @return const std::string & id ("" if no map is found)
57  */
58  const std::string & getSBMLid(const std::string & key) const;
59 
60  /**
61  * Retrieve the COPASI key which is mapped to the given SBML Id.
62  * @param const std::string & id
63  * @return const std::string & key ("" if no map is found)
64  */
65  const std::string & getCOPASIkey(const std::string & id) const;
66 
67  /**
68  * Add an associated SBMLid, COPASIkey pair to the references.
69  * @param const std::string & id
70  * @param const std::string & key
71  * @return bool success
72  */
73  bool add(const std::string & id, const std::string & key);
74 
75  /**
76  * Remove the reference of the given id
77  * @param const std::string & id
78  * @return bool success
79  */
80  bool removeSBMLid(const std::string & id);
81 
82  /**
83  * Remove the reference of the given key
84  * @param const std::string & key
85  * @return bool success
86  */
87  bool removeCOPASIkey(const std::string & key);
88 
89  /**
90  *
91  */
93 
94  /**
95  *
96  */
98 
99  /**
100  *
101  */
102  const_iterator beginSBMLid() const;
103 
104  /**
105  *
106  */
107  const_iterator endSBMLid() const;
108 
109  private:
110  // Attributes
111 
112  /**
113  *
114  */
115  std::string mURL;
116 
117  /**
118  *
119  */
120  std::map<std::string, std::string> mIdToKey;
121 
122  /**
123  *
124  */
125  std::map<std::string, std::string> mKeyToId;
126 
127  static std::string NotFound;
128  };
129 
130 #endif // COPASI_SBMLReference
const_iterator beginCOPASIkey() const
bool add(const std::string &id, const std::string &key)
const_iterator endSBMLid() const
const_iterator beginSBMLid() const
static std::string NotFound
const std::string & getCOPASIkey(const std::string &id) const
bool removeSBMLid(const std::string &id)
bool removeCOPASIkey(const std::string &key)
const std::string & getSBMLid(const std::string &key) const
const_iterator endCOPASIkey() const
std::map< std::string, std::string >::const_iterator const_iterator
Definition: SBMLReference.h:22
const std::string & getURL() const
std::map< std::string, std::string > mIdToKey
std::map< std::string, std::string > mKeyToId
bool setURL(const std::string &url)
std::string mURL