rasdaman complete source
mddbasetype.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 // -*-C++-*- (for Emacs)
24 
25 /*************************************************************
26  *
27  *
28  * PURPOSE:
29  * The MDDBaseType class is used as a type for MDDs where
30  * only the base type is specified.
31  *
32  *
33  * COMMENTS:
34  *
35  ************************************************************/
36 
37 #ifndef _MDDBASETYPE_HH_
38 #define _MDDBASETYPE_HH_
39 
40 class MDDBaseType;
41 
42 #include "catalogmgr/ops.hh"
43 #include "mddtype.hh"
44 
45 class OId;
46 
47 //@ManMemo: Module: {\bf relcatalogif}.
48 
49 /*@Doc:
50  The MDDBaseType class is used as a type for MDDs when
51  only the base type is specified.
52 */
53 
57 class MDDBaseType : public MDDType
58 {
59 public:
60  virtual char* getTypeStructure() const;
61  /*@Doc:
62  returns a string: marray < myBaseType->getTypeStructure >
63  */
64 
65  MDDBaseType(const OId& id) throw (r_Error);
66  /*@Doc:
67  constructs a MDDBaseType out of the database.
68  */
69 
70  MDDBaseType(const char* newTypeName, const BaseType* newBaseType);
71  /*@Doc:
72  constructor.
73  */
74 
75  MDDBaseType();
76  /*@Doc:
77  default constructor, cannot be used.
78  */
79 
80 
81  MDDBaseType(const char* newtypename);
82  /*@Doc:
83  */
84 
85  MDDBaseType(const MDDBaseType& old);
86  /*@Doc:
87  copy constructor.
88  */
89 
90  MDDBaseType& operator=(const MDDBaseType& old);
91  /*@Doc:
92  assignment operator.
93  */
94 
95  const BaseType* getBaseType() const;
96  /*@Doc:
97  returns base type.
98  */
99 
100  virtual void print_status( ostream& s ) const;
101  /*@Doc:
102  writes the state of the object to the specified stream:
103  \tr_Marray < myBaseType->getTypeName() \t>
104  */
105 
106  virtual ~MDDBaseType();
107  /*@Doc:
108  virtual destructor.
109  validates the object.
110  */
111 
112  virtual int compatibleWith(const Type* aType) const;
113  /*@Doc:
114  to be compatible the following must be true:
115  aType must be MDDBASETYPE or subclass and
116  myBaseType must be compatible with aType->myBaseType
117  */
118 
119  virtual int compatibleWithDomain(const r_Minterval* aDomain) const;
120  /*@Doc:
121  create a new MDDDomainType with itself and aDomain, then it
122  checks compatibility with self.
123  */
124 
125  virtual r_Bytes getMemorySize() const;
126  /*@Doc:
127  computes memory size by:
128  MDDType::getMemorySize() + myBaseType->getMemorySize() + sizeof(BaseType*);
129  */
130 
131 protected:
132 
133  virtual void insertInDb() throw (r_Error);
134 
135  virtual void readFromDb() throw (r_Error);
136 
137  virtual void deleteFromDb() throw (r_Error);
138 
140  /*@Doc:
141  reference to the basetype
142  */
143 };
144 
145 #endif
virtual r_Bytes getMemorySize() const
virtual void insertInDb()
const BaseType * myBaseType
Definition: mddbasetype.hh:139
MDDBaseType & operator=(const MDDBaseType &old)
virtual void readFromDb()
Definition: mddbasetype.hh:57
Definition: oidif.hh:67
const BaseType * getBaseType() const
Definition: mddtype.hh:58
Definition: relcatalogif/basetype.hh:66
virtual ~MDDBaseType()
Definition: relcatalogif/type.hh:68
virtual int compatibleWith(const Type *aType) const
virtual void deleteFromDb()
virtual int compatibleWithDomain(const r_Minterval *aDomain) const
virtual char * getTypeStructure() const
returns the structure of the type as a C string.
virtual void print_status(ostream &s) const