rasdaman complete source
marray.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_MARRAY_
34 #define _D_MARRAY_
35 
36 #include "rasodmg/gmarray.hh"
37 
38 #include <iostream>
39 
40 using namespace std;
41 
42 
43 //@ManMemo: Module: {\bf rasodmg}
44 
45 /*@Doc:
46 
47  The central class of the library for representing an MDD
48  object is named r_Marray. Through overloading operators,
49  the handling of an MDD object is similar to the usage of
50  a normal C or C++ array from the programmers point of view.
51 
52 */
53 
57 template<class T>
58 class r_Marray : public r_GMarray
59 {
60 public:
62  typedef T (*r_InitFunction)(const r_Point&);
63 
65  r_Marray() throw(r_Error);
66 
68  r_Marray( const r_Minterval&, r_Storage_Layout* stl = 0 ) throw(r_Error);
76  r_Marray( const r_Minterval&, const T&, r_Storage_Layout* stl = 0 ) throw(r_Error);
85  r_Marray( const r_Minterval&, r_InitFunction, r_Storage_Layout* stl = 0 ) throw(r_Error);
94  r_Marray( const r_Marray<T>& ) throw(r_Error);
96 
98  r_Marray( r_GMarray& ) throw(r_Error);
99  /*
100  This constructor is used for converting general \Ref{r_GMarray} objects
101  to cell type safe \Ref{r_Marray} objects. Care has to be taken because
102  the memory of the \Ref{r_GMarray} can not be used anymore; it is passed
103  to the \Ref{r_Marray<T>} object.
104  */
105 
107  virtual ~r_Marray();
108 
110  const r_Marray& operator= ( const r_Marray& );
111 
113  r_Marray<T> operator[]( long ) const
114  throw(r_Eindex_violation);
115 
117  r_Marray<T> operator[]( const r_Minterval& ) const
118  throw( r_Edim_mismatch );
119 
121  const T& operator[]( const r_Point& ) const
122  throw(r_Edim_mismatch, r_Eindex_violation);
123 
125  T& operator[]( const r_Point& )
126  throw(r_Edim_mismatch, r_Eindex_violation);
127 
129  operator T()
130  throw( r_Eno_cell );
131 
133  virtual void print_status( std::ostream& s = cout ) const;
134 };
135 
136 #include "rasodmg/marray.icc"
137 
138 #ifdef EARLY_TEMPLATE
139 #ifdef __EXECUTABLE__
140 #ifdef __VISUALC__
141 #include "rasodmg/marray.cpp"
142 #else
143 #include "rasodmg/marray.cc"
144 #endif
145 #endif
146 #endif
147 
148 #endif
r_Marray()
default constructor (no memory is allocated!)
Definition: error.hh:312
Definition: point.hh:59
Definition: error.hh:88
virtual void print_status(std::ostream &s=cout) const
writes the state of the object to the specified stream
Definition: error.hh:281
T(* r_InitFunction)(const r_Point &)
function type for initialization function
Definition: marray.hh:62
Definition: marray.hh:58
Definition: gmarray.hh:66
Definition: storagelayout.hh:70
Definition: error.hh:362
Definition: minterval.hh:249