rasdaman base DBMS
mddtype.hh
Go to the documentation of this file.
1 // -*-C++-*- (for Emacs)
2 
3 /*
4 * This file is part of rasdaman community.
5 *
6 * Rasdaman community is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Rasdaman community is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
20 rasdaman GmbH.
21 *
22 * For more information please see <http://www.rasdaman.org>
23 * or contact Peter Baumann via <baumann@rasdaman.com>.
24 */
25 /*************************************************************
26  *
27  *
28  * PURPOSE:
29  * The MDDType class is used as a type for MDDs where nothing
30  * is specified. It also is a superclass for types for MDDs
31  * specifying more.
32  *
33  *
34  * COMMENTS:
35  *
36  ************************************************************/
37 
38 #ifndef _MDDTYPE_HH_
39 #define _MDDTYPE_HH_
40 
41 #include "catalogmgr/ops.hh"
42 #include "type.hh"
43 #include "raslib/minterval.hh"
44 
45 class OId;
46 
47 //@ManMemo: Module: {\bf relcatalogif}.
48 
49 /*@Doc:
50  The MDDType class is used as a type for MDDs where nothing
51  is specified. It also is a superclass for types for MDDs
52  specifying more.
53 */
54 
58 class MDDType : public Type
59 {
60 public:
62  /*@Doc:
63  enum used for runtime typing.
64  could be superceded by OId::OIdType
65  */
66 
67  virtual char* getTypeStructure() const;
68  /*@Doc:
69  returns type as string:
70  marray <>
71  */
72 
73  MDDType(const OId& id) throw (r_Error);
74 
75  MDDType();
76  /*@Doc:
77  constructor.
78  */
79 
80  MDDType(const char* newTypeName);
81  /*@Doc:
82  constructor using type name.
83  */
84 
85  MDDType(const MDDType& old);
86  /*@Doc:
87  copy constructor.
88  */
89 
90  MDDType& operator=(const MDDType& old);
91  /*@Doc:
92  assignment operator.
93  */
94 
95  virtual void print_status( ostream& s ) const;
96  /*@Doc:
97  writes the state of the object to the specified stream:
98  \tr_Marray<>
99  */
100 
102  /*@Doc:
103  return subclass of MDDType (runtime typing)
104  */
105 
106  virtual ~MDDType();
107  /*@Doc:
108  virtual destructor.
109  */
110 
111  virtual int compatibleWith(const Type* aType) const;
112  /*@Doc:
113  check for compatibility of MDDTypes:
114  if aType is a MDDTYPE Type (don't confuse with MDDType!!)
115  */
116 
117  virtual int compatibleWithDomain(const r_Minterval* aDomain) const;
118  /*@Doc:
119  check for compatibility with a certain domain.
120  always returns 1.
121  */
122 
123  virtual r_Bytes getMemorySize() const;
124  /*@Doc:
125  the memory space is computed by:
126  sizeof(MDDType::MDDTypeEnum) + DBNamedObject::getMemorySize();
127  */
128 
129 protected:
130 
131  virtual void insertInDb() throw (r_Error);
132 
133  virtual void readFromDb() throw (r_Error);
134 
135  virtual void deleteFromDb() throw (r_Error);
136 
138  /*@Doc:
139  used for runtime typing and comparison operation.
140  */
141 };
142 
143 #endif
MDDType::MDDTypeEnum getSubtype() const
virtual void print_status(ostream &s) const
virtual void deleteFromDb()
virtual ~MDDType()
Definition: mddtype.hh:61
virtual int compatibleWith(const Type *aType) const
Definition: mddtype.hh:61
Definition: oidif.hh:67
MDDTypeEnum mySubclass
Definition: mddtype.hh:137
Definition: mddtype.hh:61
Definition: mddtype.hh:58
virtual int compatibleWithDomain(const r_Minterval *aDomain) const
virtual void readFromDb()
Definition: type.hh:68
virtual void insertInDb()
Definition: mddtype.hh:61
virtual r_Bytes getMemorySize() const
MDDType & operator=(const MDDType &old)
virtual char * getTypeStructure() const
returns the structure of the type as a C string.
MDDTypeEnum
Definition: mddtype.hh:61