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{
42public:
44 r_Structure_Type() = default;
46 r_Structure_Type(const char *newTypeName, unsigned int newNumAttrs, r_Attribute *newAttrs, int offset = 0);
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
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
97protected:
98 std::vector<r_Attribute> myAttributes;
99};
100
101//@Doc: write the status of a structure type to a stream
102extern std::ostream &operator<<(std::ostream &str, const r_Structure_Type &type);
103
104#endif
This class represents attributes of structs in the ODMG conformant representation of the RasDaMan typ...
Definition attribute.hh:47
This class is the superclass of the types r_Structure_Type and r_Primitive_Type in the representation...
Definition basetype.hh:40
const char * name() const
retrieve name of the type.
This class represents all user defined structured types in the ODMG conformant representation of the ...
Definition structuretype.hh:41
const std::vector< r_Attribute > & getAttributes() const
const r_Structure_Type & operator=(const r_Structure_Type &oldObj)
assignment operator.
std::vector< r_Attribute > myAttributes
Definition structuretype.hh:98
const r_Attribute & resolve_attribute(unsigned int number) const
return attribute specified by number starting with zero.
r_Structure_Type()=default
default constructor.
r_Structure_Type(const r_Structure_Type &oldObj)
copy constructor
void print_status(std::ostream &s) const override
writes state of object to specified stream
r_Attribute & resolve_attribute(unsigned int number)
return attribute specified by number starting with zero.
const r_Attribute & resolve_attribute(const char *name) const
return attribute specified by name.
void print_value(const char *storage, std::ostream &s) const override
prints values of a structured type
unsigned int count_elements() const
get number of attributes
r_Type::r_Type_Id type_id() const override
retrieve id of the type.
r_Attribute & resolve_attribute(const char *name)
return attribute specified by name.
r_Structure_Type(const char *newTypeName, unsigned int newNumAttrs, r_Attribute *newAttrs, int offset=0)
constructor getting name of type and type id.
const r_Attribute & operator[](unsigned int number) const
subscript operator to access attributes by index
r_Attribute & operator[](unsigned int number)
subscript operator to access attributes by index
void convertToLittleEndian(char *cells, r_Area noCells) const override
converts array of cells from NT byte order to Unix byte order.
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...
bool isStructType() const override
check, if type is primitive or structured.
void convertToBigEndian(char *cells, r_Area noCells) const override
converts array of cells from Unix byte order to NT byte order.
~r_Structure_Type() override=default
destructor.
r_Type * clone() const override
clone operation
This class the superclass for all types in the ODMG conformant representation of the RasDaMan type sy...
Definition type.hh:51
r_Type_Id
typedef for the enum specifying a primitive type, structure type, marray type, interval type,...
Definition type.hh:56
std::uint64_t r_Area
number of cells in an mdd object or tile.
Definition mddtypes.hh:49
std::ostream & operator<<(std::ostream &str, const r_Structure_Type &type)