rasdaman client API  10.6.3
The Array Analytics Engine: Datacubes at Your Fingertips
structure.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_HH
24 #define D_STRUCTURE_HH
25 
26 #include "raslib/scalar.hh"
27 
28 class r_Structure_Type;
29 
30 //@ManMemo: Module: {\bf raslib}
41 class r_Structure : public r_Scalar
42 {
43 public:
45  r_Structure(const char *newBuffer, const r_Structure_Type *newType);
46 
48  r_Structure(const r_Structure &obj);
49 
51  ~r_Structure() override;
52 
54  r_Scalar *clone() const override;
55 
58 
60  void print_status(std::ostream &s) const override;
61 
63  bool isStructure() const override;
64 
66  unsigned int count_elements() const;
67 
69  const char *get_buffer() const;
70 
73  const r_Scalar &operator[](const char *name) const;
74 
77  const r_Scalar &operator[](unsigned int) const;
78 
79 private:
81  r_Scalar **elements{NULL};
82 
84  char *valueBuffer{NULL};
85 
87  unsigned int numElements{};
88 };
89 
90 //@ManMemo: Module: {\bf raslib}
94 extern std::ostream &operator<<(std::ostream &s, const r_Structure &oid);
95 #endif
Class r_Scalar represents a scalar type value which is either r_Primitive or r_Structure.
Definition: scalar.hh:43
This class represents all user defined structured types in the ODMG conformant representation of the ...
Definition: structuretype.hh:41
Class r_Structure represents a structured value.
Definition: structure.hh:42
r_Structure(const r_Structure &obj)
copy constructor
r_Scalar * clone() const override
clone operator
void print_status(std::ostream &s) const override
debug output
const r_Structure & operator=(const r_Structure &)
operator for assigning a structure
const char * get_buffer() const
get buffer
r_Structure(const char *newBuffer, const r_Structure_Type *newType)
constructs a structured type value
const r_Scalar & operator[](unsigned int) const
access an element by number throws TypeInvalid and NameInvalid
bool isStructure() const override
returns true to indicate that this is a structured value
const r_Scalar & operator[](const char *name) const
access an element by name throws TypeInvalid and r_Eindex_violation
unsigned int count_elements() const
get number of elements
~r_Structure() override
destructor
std::ostream & operator<<(std::ostream &s, const r_Structure &oid)
Output stream operator for objects of type const r_Structure.