rasdaman complete source
eoid.hh
Go to the documentation of this file.
1 /*
2 * This file is part of rasdaman community.
3 *
4 * Rasdaman community is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * Rasdaman community is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
18 rasdaman GmbH.
19 *
20 * For more information please see <http://www.rasdaman.org>
21 * or contact Peter Baumann via <baumann@rasdaman.com>.
22 */
23 #ifndef _EOIDIF_HH_
24 #define _EOIDIF_HH_
25 /*************************************************************
26  *
27  *
28  * PURPOSE:
29  * EOId is optimized for maps that contain only EOId of one system/database.
30  *
31  *
32  * COMMENTS:
33  * When true multiple connections are implemented the order of compare
34  * statements in the operator"<" and ">" must be changed.
35  ***************************************************************************/
36 
37 class EOId;
38 class r_Error;
39 
40 #include "oidif.hh"
41 #include <string>
42 
43 //@ManMemo: Module: {\bf reladminif}.
44 /*@Doc:
45 EOId is optimized for maps that contain only EOId of one system/database.
46 when true multiple connections are implemented the order of compare
47 statements in the operator"<" and ">" must be changed.
48 */
52 class EOId : public OId
53 {
54 public:
55  EOId(const char* systemname, const char* dbname, OId::OIdCounter id, OIdType type);
56  /*@Doc:
57  constructs a complete EOId.
58  */
59 
60  EOId(const OId& id);
61  /*@Doc:
62  uses the currently open database to get system and db name
63  systemname and database name will be null string when the
64  database is not really open.
65  */
66 
67  EOId();
68  /*@Doc:
69  uses the currently open database to get system and db name
70  systemname and database name will be null string when the
71  database is not really open.
72  */
73 
74 
75  ~EOId();
76  /*@Doc:
77  does not do anything.
78  */
79 
80  EOId& operator=(const EOId& old);
81  /*@Doc:
82  assignes all atributes.
83  */
84 
85 
86  const char* getSystemName() const;
87  /*@Doc:
88  returns the system name, which is the same as the
89  one returned by databaseif.
90  */
91 
92 
93  const char* getBaseName() const;
94  /*@Doc:
95  returns the database name, which is the same as the
96  one returned by databaseif
97  */
98 
99 
100  OId getOId() const;
101  /*@Doc:
102  returns the oid of this eoid
103  */
104 
105 
106  void print_status(std::ostream& o) const;
107  /*@Doc:
108  returns the systemname|databasename|oid
109  */
110 
111  static void allocateEOId(EOId& eoid, OId::OIdType t) throw (r_Error);
112  /*@Doc:
113  Allocates a new logical MDD EOid in the currently opened base.
114  throws an r_Error_DatabaseClosed when the database is not really open.
115  */
116 
117  bool operator<(const EOId& old) const;
118 
119  bool operator>(const EOId& old) const;
120 
121  bool operator<=(const EOId& old) const;
122 
123  bool operator>=(const EOId& old) const;
124 
125  bool operator== (const EOId& one) const;
126 
127  bool operator!= (const EOId& one) const;
128 
129 private:
130 
131  std::string databaseName;
132  /*@Doc:
133  the name of the database the oid of this eoid is valid for.
134  stl std::string was used because of the compare functionality.
135  */
136 
137  std::string systemName;
138  /*@Doc:
139  the name of the system above mentioned database runs on
140  stl std::string was used because of the compare functionality.
141  */
142 };
143 
144 extern std::ostream& operator<<(std::ostream& s, EOId& d);
145 
146 extern std::ostream& operator<<(std::ostream& s, const EOId& d);
147 
148 #endif
bool operator!=(const EOId &one) const
bool operator<(const EOId &old) const
const char * getSystemName() const
Definition: eoid.hh:52
bool operator>(const EOId &old) const
static void allocateEOId(EOId &eoid, OId::OIdType t)
Definition: error.hh:88
bool operator<=(const EOId &old) const
EOId & operator=(const EOId &old)
std::ostream & operator<<(std::ostream &s, EOId &d)
Definition: oidif.hh:67
bool operator>=(const EOId &old) const
int OIdCounter
Definition: oidif.hh:96
OId getOId() const
OIdType
Definition: oidif.hh:70
bool operator==(const EOId &one) const
const char * getBaseName() const
void print_status(std::ostream &o) const