rasdaman client API  10.6.3
The Array Analytics Engine: Datacubes at Your Fingertips
primitive.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_PRIMITIVE_
25 #define _D_PRIMITIVE_
26 
27 #include "raslib/scalar.hh"
28 #include "raslib/odmgtypes.hh"
29 #include "raslib/type.hh"
30 #include <iosfwd>
31 
32 class r_Primitive_Type;
33 
34 //@ManMemo: Module: {\bf raslib}
42 class r_Primitive : public r_Scalar
43 {
44 public:
45  r_Primitive(const char *newBuffer, const r_Primitive_Type *newType);
46  r_Primitive(const r_Primitive &obj);
47  ~r_Primitive() override;
48 
50  r_Scalar *clone() const override;
51 
54 
56  const char *get_buffer() const;
57 
59  void print_status(std::ostream &s) const override;
60 
61  bool isPrimitive() const override;
62 
63  //@Man: Type-safe value access methods. In case of type mismatch, an exception is raised.
66  r_Char get_char() const;
67  r_Octet get_octet() const;
68  r_Short get_short() const;
70  r_Long get_long() const;
71  r_ULong get_ulong() const;
72  r_Float get_float() const;
74 
85 
86 protected:
87  void checkBufferAndType() const;
89 
91  char *valueBuffer{NULL};
92 };
93 
94 //@ManMemo: Module: {\bf raslib}
98 extern std::ostream &operator<<(std::ostream &s, const r_Primitive &obj);
99 
100 #endif
This class represents all primitive types in the ODMG conformant representation of the RasDaMan type ...
Definition: primitivetype.hh:42
Class r_Primitive represents a primitive (atomic) type value.
Definition: primitive.hh:43
r_Primitive(const char *newBuffer, const r_Primitive_Type *newType)
void set_long(r_Long)
void set_short(r_Short)
r_Scalar * clone() const override
clone operator
r_UShort get_ushort() const
const char * get_buffer() const
gets the pointer to the buffer
r_Octet get_octet() const
r_ULong get_ulong() const
r_Float get_float() const
bool isPrimitive() const override
void set_float(r_Float)
r_Char get_char() const
r_Short get_short() const
char * valueBuffer
buffer
Definition: primitive.hh:91
void set_double(r_Double)
void set_ulong(r_ULong)
r_Boolean get_boolean() const
void set_boolean(r_Boolean)
r_Double get_double() const
void checkBufferAndType() const
r_Long get_long() const
~r_Primitive() override
const r_Primitive & operator=(const r_Primitive &)
operator for assigning a primitive
void set_octet(r_Octet)
void print_status(std::ostream &s) const override
debug output
void set_char(r_Char)
void checkBufferAndType(r_Type::r_Type_Id type)
void set_ushort(r_UShort)
r_Primitive(const r_Primitive &obj)
Class r_Scalar represents a scalar type value which is either r_Primitive or r_Structure.
Definition: scalar.hh:43
r_Type_Id
typedef for the enum specifying a primitive type, structure type, marray type, interval type,...
Definition: type.hh:56
std::uint32_t r_ULong
Definition: odmgtypes.hh:38
double r_Double
Definition: odmgtypes.hh:40
std::uint16_t r_UShort
Definition: odmgtypes.hh:35
float r_Float
Definition: odmgtypes.hh:39
std::int8_t r_Octet
Definition: odmgtypes.hh:34
std::uint8_t r_Char
Definition: odmgtypes.hh:33
std::int32_t r_Long
Definition: odmgtypes.hh:37
std::uint8_t r_Boolean
Definition: odmgtypes.hh:32
std::int16_t r_Short
Definition: odmgtypes.hh:36
std::ostream & operator<<(std::ostream &s, const r_Primitive &obj)
Output stream operator for objects of type const r_Primitive.