rasdaman complete source
mdddomaintype.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 MDDBaseType class is used as a type for MDDs where
30  * the base type and the domain is specified.
31  *
32  *
33  * COMMENTS:
34  *
35  ************************************************************/
36 
37 #ifndef _MDDDOMAINTYPE_HH_
38 #define _MDDDOMAINTYPE_HH_
39 
40 class MDDDomainType;
41 
42 #include <iostream>
43 #include "raslib/minterval.hh"
44 #include "catalogmgr/ops.hh"
45 #include "mddbasetype.hh"
46 #include "raslib/mddtypes.hh" //for r_Range
47 
48 class DBMinterval;
49 class OId;
50 
51 //@ManMemo: Module: {\bf relcatalogif}.
52 
53 /*@Doc:
54  The MDDBaseType class is used as a type for MDDs where
55  the base type and the domain is specified.
56 */
57 
61 class MDDDomainType : public MDDBaseType
62 {
63 public:
64  virtual char* getTypeStructure() const;
65  /*@Doc:
66  looks like:
67  marray <myBaseType->getTypeStructure(), myDomain->get_string_representation()>
68  */
69 
70  MDDDomainType(const OId& id) throw (r_Error);
71 
72  MDDDomainType(const char* newTypeName, const BaseType* newBaseType, const r_Minterval& newDomain);
73 
74  MDDDomainType();
75  /*@Doc:
76  default constructor, cannot be used.
77  */
78 
79  MDDDomainType(const MDDDomainType& old);
80  /*@Doc:
81  copy constructor.
82  */
83 
85  /*@Doc:
86  assignment operator.
87  */
88 
89  const r_Minterval* getDomain() const;
90  /*@Doc:
91  returns domain.
92  */
93 
94  virtual void print_status( ostream& s ) const;
95  /*@Doc:
96  writes the state of the object to the specified stream.
97  looks like: \tr_Marray<myBaseType->getTypeName(), myDomain->print_status()\t>
98  */
99 
100  virtual ~MDDDomainType();
101  /*@Doc:
102  virtual destructor.
103  calls validate and deletes myDomain
104  */
105 
106  virtual void setPersistent(bool t) throw (r_Error);
107  /*@Doc:
108  this method from DBObject is overridden to make sure that
109  the dbminterval is also made persistent/deleted from db.
110  */
111 
112  virtual int compatibleWith(const Type* aType) const;
113  /*@Doc:
114  aType is compatible if:
115  aType is a MDDDomainType and
116  the basetypes are compatible
117  */
118 
119  virtual r_Bytes getMemorySize() const;
120  /*@Doc:
121  memory space is computed by
122  MDDBaseType::getMemorySize() + sizeof(DBMinterval*)
123  + myDomain->getMemorySize();
124  */
125 
126 protected:
127 
129  /*@Doc:
130  persistent domain.
131  */
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 };
139 
140 #endif
Definition: mdddomaintype.hh:61
virtual void readFromDb()
virtual void deleteFromDb()
MDDDomainType & operator=(const MDDDomainType &old)
virtual void print_status(ostream &s) const
virtual ~MDDDomainType()
virtual void setPersistent(bool t)
Definition: mddbasetype.hh:57
Definition: oidif.hh:67
virtual r_Bytes getMemorySize() const
const r_Minterval * getDomain() const
Definition: relcatalogif/basetype.hh:66
virtual void insertInDb()
virtual char * getTypeStructure() const
returns the structure of the type as a C string.
Definition: relcatalogif/type.hh:68
Definition: dbminterval.hh:47
virtual int compatibleWith(const Type *aType) const
DBMinterval * myDomain
Definition: mdddomaintype.hh:128