rasdaman complete source
raslib/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 /
33 #ifndef _D_COMPLEXTYPE_TYPE_
34 #define _D_COMPLEXTYPE_TYPE_
35 
36 #include "raslib/primitivetype.hh"
37 #include "raslib/odmgtypes.hh"
38 #include "raslib/mddtypes.hh"
39 
40 class r_Complex_Type : public r_Primitive_Type
41 {
42 public:
43  r_Complex_Type();
44  r_Complex_Type(const char* newTypeName, const r_Type::r_Type_Id newTypeId);
45  r_Complex_Type(const r_Complex_Type& oldObj);
46  const r_Complex_Type& operator=(const r_Complex_Type& oldObj);
47  virtual ~r_Complex_Type();
48 
49  virtual r_Type* clone() const;
50  virtual void print_status(std::ostream& s = std::cout) const;
51  virtual void print_value(const char* storage, std::ostream& s = std::cout) const;
52 
53  r_Double get_re(const char* cell) const throw(r_Error);
54  r_Double get_im(const char* cell) const throw(r_Error);
55 
56  void set_re(char* cell, r_Double re) throw(r_Error);
57  void set_im(char* cell, r_Double im) throw(r_Error);
58 
59 
60  virtual void convertToLittleEndian(char* cells, r_Area noCells) const;
61  virtual void convertToBigEndian(char* cells, r_Area noCells) const;
62  virtual bool isComplexType() const;
63 
64 private:
65  r_Bytes imOff;
66 };
67 
68 //@Doc: write the status of a complex type to a stream
69 extern std::ostream &operator<<( std::ostream &str, const r_Complex_Type &type );
70 
71 #endif