rasdaman client API  10.6.3
The Array Analytics Engine: Datacubes at Your Fingertips
structuretype.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 
23 #ifndef _D_STRUCTURE_TYPE_
24 #define _D_STRUCTURE_TYPE_
25 
26 #include "raslib/basetype.hh"
27 #include "raslib/attribute.hh"
28 #include <vector>
29 
30 //@ManMemo: Module: {\bf raslib}
41 {
42 public:
44  r_Structure_Type() = default;
46  r_Structure_Type(const char *newTypeName, unsigned int newNumAttrs, r_Attribute *newAttrs, int offset = 0);
48  r_Structure_Type(const r_Structure_Type &oldObj);
50  const r_Structure_Type &operator=(const r_Structure_Type &oldObj);
52  ~r_Structure_Type() override = default;
53 
55  r_Type *clone() const override;
56 
58  r_Type::r_Type_Id type_id() const override;
59 
61  bool isStructType() const override;
62 
64  virtual bool compatibleWith(const r_Structure_Type *myType) const;
65 
67  r_Attribute &resolve_attribute(const char *name);
69  r_Attribute &resolve_attribute(unsigned int number);
71  r_Attribute &operator[](unsigned int number);
72 
74  const r_Attribute &resolve_attribute(const char *name) const;
76  const r_Attribute &resolve_attribute(unsigned int number) const;
78  const r_Attribute &operator[](unsigned int number) const;
79 
80  const std::vector<r_Attribute> &getAttributes() const;
81 
83  unsigned int count_elements() const;
84 
86  void convertToLittleEndian(char *cells, r_Area noCells) const override;
87 
89  void convertToBigEndian(char *cells, r_Area noCells) const override;
90 
92  void print_status(std::ostream &s) const override;
93 
95  void print_value(const char *storage, std::ostream &s) const override;
96 
97 protected:
98  std::vector<r_Attribute> myAttributes;
99 };
100 
101 //@Doc: write the status of a structure type to a stream
102 extern std::ostream &operator<<(std::ostream &str, const r_Structure_Type &type);
103 
104 #endif
r_Structure_Type::convertToBigEndian
void convertToBigEndian(char *cells, r_Area noCells) const override
converts array of cells from Unix byte order to NT byte order.
r_Structure_Type::operator[]
r_Attribute & operator[](unsigned int number)
subscript operator to access attributes by index
r_Structure_Type::count_elements
unsigned int count_elements() const
get number of attributes
r_Structure_Type::~r_Structure_Type
~r_Structure_Type() override=default
destructor.
r_Structure_Type::myAttributes
std::vector< r_Attribute > myAttributes
Definition: structuretype.hh:98
r_Base_Type
This class is the superclass of the types r_Structure_Type and r_Primitive_Type in the representation...
Definition: basetype.hh:39
r_Structure_Type::compatibleWith
virtual bool compatibleWith(const r_Structure_Type *myType) const
check, if this type is compatible with myType (e.g. check the structure ignoring then names of atribu...
attribute.hh
operator<<
std::ostream & operator<<(std::ostream &str, const r_Structure_Type &type)
r_Structure_Type::isStructType
bool isStructType() const override
check, if type is primitive or structured.
r_Type
This class the superclass for all types in the ODMG conformant representation of the RasDaMan type sy...
Definition: type.hh:50
r_Structure_Type::convertToLittleEndian
void convertToLittleEndian(char *cells, r_Area noCells) const override
converts array of cells from NT byte order to Unix byte order.
r_Structure_Type::getAttributes
const std::vector< r_Attribute > & getAttributes() const
r_Meta_Object::name
const char * name() const
retrieve name of the type.
r_Structure_Type::print_status
void print_status(std::ostream &s) const override
writes state of object to specified stream
basetype.hh
r_Type::r_Type_Id
r_Type_Id
typedef for the enum specifying a primitive type, structure type, marray type, interval type,...
Definition: type.hh:55
r_Structure_Type::clone
r_Type * clone() const override
clone operation
r_Structure_Type::print_value
void print_value(const char *storage, std::ostream &s) const override
prints values of a structured type
r_Structure_Type
This class represents all user defined structured types in the ODMG conformant representation of the ...
Definition: structuretype.hh:40
r_Structure_Type::r_Structure_Type
r_Structure_Type()=default
default constructor.
r_Attribute
This class represents attributes of structs in the ODMG conformant representation of the RasDaMan typ...
Definition: attribute.hh:46
r_Area
std::uint64_t r_Area
number of cells in an mdd object or tile.
Definition: mddtypes.hh:49
r_Structure_Type::type_id
r_Type::r_Type_Id type_id() const override
retrieve id of the type.
r_Structure_Type::operator=
const r_Structure_Type & operator=(const r_Structure_Type &oldObj)
assignment operator.
r_Structure_Type::resolve_attribute
r_Attribute & resolve_attribute(const char *name)
return attribute specified by name.