rasdaman API
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 
35 #ifndef _D_STRUCTURE_
36 #define _D_STRUCTURE_
37 
38 #include <iostream>
39 
40 class r_Error;
41 
42 #include "raslib/scalar.hh"
43 
44 class r_Structure_Type;
45 
46 //@ManMemo: Module: {\bf raslib}
47 
48 /*@Doc:
49 
50  Class \Ref{r_Structure} represents a structured value.
51 
52 */
53 
54 class r_Structure : public r_Scalar
55 {
56 public:
58  r_Structure( const char* newBuffer, const r_Structure_Type* newType );
59 
61  r_Structure( const r_Structure& obj );
62 
64  virtual ~r_Structure();
65 
67  virtual r_Scalar* clone() const;
68 
70  virtual const r_Structure& operator= ( const r_Structure& );
71 
73  virtual void print_status(std::ostream& s) const;
74 
76  virtual bool isStructure() const;
77 
79  unsigned int count_elements() const;
80 
82  const char* get_buffer() const;
83 
86  const r_Scalar& operator[]( const char* name ) const throw( r_Error );
87 
90  const r_Scalar& operator[]( unsigned int ) const throw( r_Error );
91 
92 private:
94  unsigned int numElements;
95 
97  r_Scalar** elements;
98 
100  char* valueBuffer;
101 };
102 
103 
104 
105 //@ManMemo: Module: {\bf raslib}
109 extern std::ostream& operator<<( std::ostream& s, const r_Structure& oid );
110 #endif
111 
const char * get_buffer() const
get buffer
const r_Scalar & operator[](const char *name) const
Definition: structuretype.hh:56
Definition: error.hh:88
std::ostream & operator<<(std::ostream &s, const r_Structure &oid)
virtual void print_status(std::ostream &s) const
debug output
virtual bool isStructure() const
returns true to indicate that this is a structured value
unsigned int count_elements() const
get number of elements
virtual const r_Structure & operator=(const r_Structure &)
operator for assigning a structure
Definition: scalar.hh:53
Definition: structure.hh:54
virtual ~r_Structure()
destructor
virtual r_Scalar * clone() const
clone operator
r_Structure(const char *newBuffer, const r_Structure_Type *newType)
constructs a structured type value