rasdaman API
scalar.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 
35 #ifndef _D_SCALAR_
36 #define _D_SCALAR_
37 
38 #include <iosfwd>
39 
40 #include "raslib/error.hh"
41 
42 class r_Base_Type;
43 
44 //@ManMemo: Module: {\bf raslib}
45 
46 /*@Doc:
47 
48  Class \Ref{r_Scalar} represents a scalar type value which
49  is either \Ref{r_Primitive} or \Ref{r_Structure}.
50 
51 */
52 
53 class r_Scalar
54 {
55 public:
57  r_Scalar( const r_Base_Type* newType );
58 
60  r_Scalar( const r_Scalar& obj );
61 
63  virtual ~r_Scalar();
64 
66  virtual r_Scalar* clone() const=0;
67 
69  virtual const r_Scalar& operator= ( const r_Scalar& );
70 
72  virtual void print_status(std::ostream& s) const = 0;
73 
75  virtual const r_Base_Type* get_type() const;
76 
78  virtual bool isStructure() const;
79 
81  virtual bool isComplex() const;
82 
84  virtual bool isPrimitive() const;
85 
86 protected:
88  r_Base_Type* valueType;
89 };
90 
91 
92 
93 //@ManMemo: Module: {\bf raslib}
97 extern std::ostream& operator<<(std::ostream& s, const r_Scalar& obj );
98 
99 #endif
100 
virtual const r_Scalar & operator=(const r_Scalar &)
operator for assigning a scalar
virtual bool isComplex() const
virtual const r_Base_Type * get_type() const
get type
r_Base_Type * valueType
type
Definition: scalar.hh:88
virtual r_Scalar * clone() const =0
clone operator
std::ostream & operator<<(std::ostream &s, const r_Scalar &obj)
virtual bool isStructure() const
virtual ~r_Scalar()
destructor
Definition: scalar.hh:53
virtual void print_status(std::ostream &s) const =0
debug output
virtual bool isPrimitive() const
r_Scalar(const r_Base_Type *newType)
constructs a scalar value