rasdaman base DBMS
collectiontype.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 CollectionType class is the superclass for the class
30  * SetType.
31  *
32  *
33  * COMMENTS:
34  *
35  ************************************************************/
36 
37 #ifndef _COLLECTIONTYPE_HH_
38 #define _COLLECTIONTYPE_HH_
39 
40 class CollectionType;
41 
42 #include <iostream>
43 #include "catalogmgr/ops.hh"
44 #include "type.hh"
45 #include "reladminif/externs.h"
46 
47 class MDDType;
48 
49 //@ManMemo: Module: {\bf relcatalogif}.
50 
51 /*@Doc:
52  CollectionType is the base class for classes that deal with
53  collections of MDDs (the only subclass at the moment is SetType).
54 */
55 
59 class CollectionType : public Type
60 {
61 public:
62  const MDDType* getMDDType() const;
63  /*@Doc:
64  returns MDDType of collection.
65  */
66  /*
67  MDDType* getMDDType() const;
68  */
69 
70 
71  void print_status( ostream& s ) const;
72  /*@Doc:
73  writes the state of the object to the specified stream:
74  d_MYNAME <MYMDDTYPE->printStatus >
75  */
76 
77  CollectionType(const MDDType* newMDDType);
78  /*@Doc:
79  constructor receiving pointer to an MDDType (or subclass).
80  */
81 
83  /*@Doc:
84  default constructor, cannot be used.
85  */
86 
87  CollectionType(const OId& id) throw (r_Error);
88  /*@Doc:
89  */
90 
91  CollectionType(const CollectionType& old);
92  /*@Doc:
93  */
94 
96  /*@Doc:
97  */
98 
99  virtual ~CollectionType();
100  /*@Doc:
101  virtual destructor.
102  */
103 
104  virtual int compatibleWith(const Type* aType) const;
105  /*@Doc:
106  overloaded from Type.
107  returns true if myMDDType is compatible with the type.
108  */
109 
110  virtual r_Bytes getMemorySize() const;
111  /*@Doc:
112  returns DBNamedObject::getMemorySize() +
113  myMDDType->getMemorySize() + sizeof(MDDType*);
114  */
115 
116 protected:
118  /*@Doc:
119  persistent pointer to MDDType of collection.
120  */
121 
122  CollectionType(const char* name);
123  /*@Doc:
124  */
125 
126  CollectionType(const char* name,const MDDType* newMDDType);
127  /*@Doc:
128  */
129 };
130 
131 #endif
132 
void print_status(ostream &s) const
Definition: oidif.hh:67
virtual int compatibleWith(const Type *aType) const
const MDDType * getMDDType() const
Definition: mddtype.hh:58
Definition: collectiontype.hh:59
const MDDType * myMDDType
Definition: collectiontype.hh:117
virtual r_Bytes getMemorySize() const
CollectionType & operator=(const CollectionType &old)
Definition: type.hh:68
virtual ~CollectionType()