rasdaman client API  10.6.3
The Array Analytics Engine: Datacubes at Your Fingertips
complextype.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 
24 #ifndef _D_COMPLEXTYPE_TYPE_
25 #define _D_COMPLEXTYPE_TYPE_
26 
27 #include "raslib/primitivetype.hh"
28 #include "raslib/odmgtypes.hh"
29 #include "raslib/mddtypes.hh"
30 
35 {
36 public:
38  r_Complex_Type(const char *newTypeName, const r_Type::r_Type_Id newTypeId);
39  r_Complex_Type(const r_Complex_Type &) = default;
40  r_Complex_Type &operator=(const r_Complex_Type &oldObj) = default;
41  virtual ~r_Complex_Type() = default;
42 
43  virtual r_Type *clone() const;
44  virtual void print_status(std::ostream &s) const;
45  virtual void print_value(const char *storage, std::ostream &s) const;
46 
47  r_Double get_re(const char *cell) const;
48  r_Double get_im(const char *cell) const;
49 
50  r_Long get_re_long(const char *cell) const;
51  r_Long get_im_long(const char *cell) const;
52 
53  void set_re(char *cell, r_Double re);
54  void set_im(char *cell, r_Double im);
55  void set_re_long(char *cell, r_Long re);
56  void set_im_long(char *cell, r_Long im);
57 
58  virtual void convertToLittleEndian(char *cells, r_Area noCells) const;
59  virtual void convertToBigEndian(char *cells, r_Area noCells) const;
60 
61  virtual bool isComplexType() const;
62 
63 private:
64  template <typename T>
65  void swapEndianessDouble(char *cells, r_Area noCells) const;
66  template <typename T>
67  void swapEndianessLong(char *cells, r_Area noCells) const;
68 
69  r_Bytes imOff{};
70 };
71 
72 //@Doc: write the status of a complex type to a stream
73 extern std::ostream &operator<<(std::ostream &str, const r_Complex_Type &type);
74 
75 #endif
Definition: complextype.hh:35
virtual ~r_Complex_Type()=default
r_Complex_Type(const r_Complex_Type &)=default
virtual void convertToBigEndian(char *cells, r_Area noCells) const
converts array of cells from Unix byte order to NT byte order.
virtual void convertToLittleEndian(char *cells, r_Area noCells) const
converts array of cells from NT byte order to Unix byte order.
virtual r_Type * clone() const
clone operation
void set_im(char *cell, r_Double im)
void set_im_long(char *cell, r_Long im)
r_Long get_im_long(const char *cell) const
void set_re(char *cell, r_Double re)
void set_re_long(char *cell, r_Long re)
r_Double get_re(const char *cell) const
virtual void print_value(const char *storage, std::ostream &s) const
prints value of a primitive type or values of a structured type
virtual bool isComplexType() const
check, if type is a base type ( primitive type or structure type).
r_Complex_Type & operator=(const r_Complex_Type &oldObj)=default
virtual void print_status(std::ostream &s) const
writes state of object to specified stream
r_Complex_Type(const char *newTypeName, const r_Type::r_Type_Id newTypeId)
r_Long get_re_long(const char *cell) const
r_Double get_im(const char *cell) const
This class represents all primitive types in the ODMG conformant representation of the RasDaMan type ...
Definition: primitivetype.hh:42
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::ostream & operator<<(std::ostream &str, const r_Complex_Type &type)
size_t r_Bytes
number of bytes in an tile or mdd or type.
Definition: mddtypes.hh:43
std::uint64_t r_Area
number of cells in an mdd object or tile.
Definition: mddtypes.hh:49
double r_Double
Definition: odmgtypes.hh:40
std::int32_t r_Long
Definition: odmgtypes.hh:37