rasdaman complete source
raslib/type.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 Lesser 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 Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16  *
17  * Copyright 2003 - 2010 Peter Baumann / rasdaman GmbH.
18  *
19  * For more information please see <http://www.rasdaman.org>
20  * or contact Peter Baumann via <baumann@rasdaman.com>.
21 */
22 
33 #ifndef _D_TYPE_
34 #define _D_TYPE_
35 
36 #include "raslib/metaobject.hh"
37 #include "raslib/mddtypes.hh"
38 
39 class r_Primitive_Type;
40 class r_Structure_Type;
41 class r_Marray_Type;
42 class r_Sinterval_Type;
43 class r_Minterval_Type;
44 class r_Point_Type;
45 class r_Oid_Type;
46 class r_Base_Type;
47 class r_Collection_Type;
48 
49 //@ManMemo: Module: {\bf raslib}
50 
56 class r_Type : public r_Meta_Object
57 {
58 public:
66  };
68  r_Type();
70  r_Type( const char* newTypeName);
72  r_Type( const r_Type& oldObj );
74  const r_Type& operator=( const r_Type& oldObj );
76  virtual ~r_Type();
77 
79  virtual r_Type* clone() const = 0;
80 
82  virtual r_Type::r_Type_Id type_id() const = 0;
83 
85  virtual bool isStructType() const;
86 
88  virtual bool isBaseType() const;
89 
91  virtual bool isComplexType() const;
92 
94  virtual bool isMarrayType() const;
95 
97  virtual bool isPrimitiveType() const;
98 
100  virtual bool isSintervalType() const;
101 
103  virtual bool isMintervalType() const;
104 
106  virtual bool isCollectionType() const;
107 
109  virtual bool isPointType() const;
110 
112  virtual bool isOidType() const;
113 
115  static r_Type* get_any_type( const char* type_string );
116 
118  virtual void convertToLittleEndian(char* cells, r_Area noCells) const = 0;
119 
121  virtual void convertToBigEndian(char* cells, r_Area noCells) const = 0;
122 
129  };
130 
131 
132 private:
133 
134  //@Man: Methodes and structures for dl parser:
136 
139  static DLTOKEN getNextToken( char* &pos, char* &identifier );
141  static r_Collection_Type* getCollectionType( char* &pos );
143  static r_Type* getType( char* &pos );
145  static r_Marray_Type* getMarrayType( char* &pos );
147  static r_Base_Type* getBaseType( char* &pos, int offset=0 );
149  static r_Primitive_Type* getPrimitiveType( char* &pos );
151  static r_Structure_Type* getStructureType( char* &pos, int offset=0 );
153  static r_Sinterval_Type* getSintervalType( char* &pos );
155  static r_Minterval_Type* getMintervalType( char* &pos );
157  static r_Point_Type* getPointType( char* &pos );
159  static r_Oid_Type* getOidType( char* &pos );
160 
162 
163 
164 
165 };
166 
167 extern std::ostream& operator<<( std::ostream& s, r_Type::r_Type_Id t );
168 
169 #endif
Definition: raslib/type.hh:61
Definition: marraytype.hh:49
Definition: raslib/type.hh:128
Definition: raslib/type.hh:64
Definition: metaobject.hh:53
Definition: raslib/type.hh:124
Definition: raslib/basetype.hh:47
Definition: raslib/type.hh:61
const r_Type & operator=(const r_Type &oldObj)
assignment operator.
Definition: structuretype.hh:56
virtual bool isPointType() const
check, if type is a Point
Definition: raslib/type.hh:126
Definition: oidtype.hh:45
Definition: raslib/type.hh:125
Definition: raslib/type.hh:56
std::ostream & operator<<(std::ostream &s, r_Type::r_Type_Id t)
Definition: raslib/type.hh:125
Definition: raslib/type.hh:127
Definition: raslib/collectiontype.hh:48
Definition: raslib/type.hh:126
Definition: raslib/type.hh:125
virtual bool isStructType() const
check, if type is primitive or structured.
Definition: raslib/type.hh:127
Definition: raslib/type.hh:124
Definition: raslib/type.hh:63
Definition: raslib/type.hh:124
Definition: raslib/type.hh:64
Definition: raslib/type.hh:127
Definition: raslib/type.hh:126
Definition: raslib/type.hh:128
virtual bool isComplexType() const
check, if type is a base type ( primitive type or structure type).
virtual r_Type::r_Type_Id type_id() const =0
retrieve id of the type.
virtual bool isMarrayType() const
check, if type is a marray type.
Definition: raslib/type.hh:61
Definition: raslib/type.hh:62
virtual bool isBaseType() const
check, if type is a base type ( primitive type or structure type).
Definition: raslib/type.hh:65
Definition: raslib/type.hh:63
Definition: raslib/type.hh:64
Definition: raslib/type.hh:127
Definition: raslib/type.hh:126
Definition: raslib/type.hh:61
Definition: raslib/type.hh:126
DLTOKEN
token enumeration for parser
Definition: raslib/type.hh:124
Definition: raslib/type.hh:61
Definition: raslib/type.hh:62
uint64_t r_Area
Definition: mddtypes.hh:85
Definition: raslib/type.hh:128
Definition: raslib/type.hh:127
virtual bool isCollectionType() const
check, if type is a Colelction type
r_Type_Id
Definition: raslib/type.hh:61
virtual void convertToLittleEndian(char *cells, r_Area noCells) const =0
converts array of cells from NT byte order to Unix byte order.
Definition: raslib/type.hh:63
Definition: raslib/type.hh:127
Definition: raslib/type.hh:61
r_Type()
default constructor.
virtual r_Type * clone() const =0
clone operation
Definition: raslib/type.hh:64
static r_Type * get_any_type(const char *type_string)
build type schema from string representation
Definition: raslib/type.hh:62
Definition: raslib/type.hh:125
Definition: raslib/type.hh:128
Definition: primitivetype.hh:49
Definition: raslib/type.hh:128
Definition: raslib/type.hh:124
Definition: raslib/type.hh:127
virtual bool isMintervalType() const
check, if type is a Minterval
virtual void convertToBigEndian(char *cells, r_Area noCells) const =0
converts array of cells from Unix byte order to NT byte order.
Definition: raslib/type.hh:62
virtual ~r_Type()
destructor.
Definition: pointtype.hh:45
Definition: mintervaltype.hh:45
Definition: raslib/type.hh:125
virtual bool isSintervalType() const
check, if type is a Sinterval
Definition: raslib/type.hh:125
virtual bool isOidType() const
check, if type is a oid
Definition: raslib/type.hh:62
virtual bool isPrimitiveType() const
check, if type is a primitive type.
Definition: sintervaltype.hh:45