rasdaman client API  10.6.3
The Array Analytics Engine: Datacubes at Your Fingertips
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 */
23 
24 #ifndef _D_MARRAY_
25 #define _D_MARRAY_
26 
27 #include "rasodmg/gmarray.hh"
28 
29 #include <iosfwd>
30 
31 //@ManMemo: Module: {\bf rasodmg}
32 
44 template <class T>
45 class r_Marray : public r_GMarray
46 {
47 public:
49  typedef T (*r_InitFunction)(const r_Point &);
50 
52  r_Marray();
53 
55  explicit r_Marray(const r_Minterval &, r_Storage_Layout *stl = 0);
63  r_Marray(const r_Minterval &, const T &, r_Storage_Layout *stl = 0);
72  explicit r_Marray(const r_Minterval &, r_InitFunction, r_Storage_Layout *stl = 0);
81  r_Marray(const r_Marray<T> &);
83 
85  explicit r_Marray(r_GMarray &);
86  /*
87  This constructor is used for converting general r_GMarray objects
88  to cell type safe r_Marray objects. Care has to be taken because
89  the memory of the r_GMarray can not be used anymore; it is passed
90  to the r_Marray<T> object.
91  */
92 
94  virtual ~r_Marray();
95 
97  const r_Marray &operator=(const r_Marray &);
98 
100  r_Marray<T> operator[](long) const;
101 
103  r_Marray<T> operator[](const r_Minterval &) const;
104 
106  const T &operator[](const r_Point &) const;
107 
109  T &operator[](const r_Point &);
110 
112  operator T();
113 
115  virtual void print_status(std::ostream &s);
116 };
117 
118 #ifdef EARLY_TEMPLATE
119 #ifdef __EXECUTABLE__
120 #include "rasodmg/marray.cc"
121 #endif
122 #endif
123 
124 #endif
r_Marray::r_InitFunction
T(* r_InitFunction)(const r_Point &)
function type for initialization function
Definition: marray.hh:49
r_Marray::r_Marray
r_Marray()
default constructor (no memory is allocated!)
r_Marray::~r_Marray
virtual ~r_Marray()
destructor
r_Marray
The central class of the library for representing an MDD object is named r_Marray.
Definition: marray.hh:45
r_Point
Class r_Point represents an n-dimensional point vector.
Definition: point.hh:42
gmarray.hh
r_Marray::operator=
const r_Marray & operator=(const r_Marray &)
assignment: cleanup + copy
r_Marray::operator[]
r_Marray< T > operator[](long) const
subscript operator for projection in the 1st dimension
r_Marray::print_status
virtual void print_status(std::ostream &s)
writes the state of the object to the specified stream
r_GMarray
The class represents a generic MDD in the sense that it is independent of the cell base type.
Definition: gmarray.hh:65
r_Minterval
The spatial domain of an MDD is represented by an object of class r_Minterval.
Definition: minterval.hh:225
r_Storage_Layout
The r_Storage_Layout class is used to express the storage options for r_Marray objects.
Definition: storagelayout.hh:60