rasdaman API
point.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_POINT_
34 #define _D_POINT_
35 
36 #ifdef __VISUALC__
37 // disable warning for exception specification
38 #pragma warning( disable : 4290 )
39 #endif
40 
41 class r_Error;
42 class r_Einit_overflow;
43 class r_Eindex_violation;
44 class r_Edim_mismatch;
45 
46 #include "raslib/mddtypes.hh"
47 #include "raslib/error.hh"
48 
49 #include <iostream>
50 
51 //@ManMemo: Module: {\bf raslib}
52 
53 /*@Doc:
54 
55  Class \Ref{r_Point} represents an n-dimensional point vector.
56 
57 */
58 
59 class r_Point
60 {
61 public:
64 
67 
69  r_Point( char* ) throw( r_Error );
70 
71  //@Man: 'easy-to-use' constructors
82 
83 
85  r_Point();
86 
88  r_Point( const r_Point& );
89 
91  ~r_Point();
92 
97 
99  const r_Point& operator= ( const r_Point& );
100 
102  inline const int compare_with( const r_Point& p ) const;
108  bool operator==( const r_Point& ) const;
110 
116  bool operator!=( const r_Point& ) const;
118 
120  r_Point operator+( const r_Point& ) const
121  throw( r_Edim_mismatch );
122 
124  r_Point operator-( const r_Point& ) const
125  throw( r_Edim_mismatch );
126 
128  r_Point operator*( const r_Point& ) const
129  throw( r_Edim_mismatch );
130 
132  inline r_Dimension dimension() const;
133 
135  void print_status( std::ostream& s = std::cout ) const;
136 
138  char* get_string_representation() const;
146 private:
148  r_Range* points;
150  r_Dimension dimensionality;
152  r_Dimension streamInitCnt;
153 };
154 
155 
156 
157 //@ManMemo: Module: {\bf raslib}
161 extern std::ostream& operator<<( std::ostream& s, const r_Point& d );
162 
163 #include "raslib/point.icc"
164 
165 #endif
r_Dimension dimension() const
get dimensionality
Definition: error.hh:312
~r_Point()
destructor: cleanup dynamic memory
std::ostream & operator<<(std::ostream &s, const r_Point &d)
Definition: point.hh:59
Definition: error.hh:88
bool operator==(const r_Point &) const
equal operator
int r_Range
Definition: mddtypes.hh:100
r_Point & operator<<(r_Range)
stream-input operator for stream initializing
Definition: error.hh:281
r_Point operator+(const r_Point &) const
vector addition
unsigned int r_Dimension
Definition: mddtypes.hh:118
r_Range operator[](r_Dimension) const
subscriptor for read access
void print_status(std::ostream &s=std::cout) const
writes the state of the object to the specified stream
bool operator!=(const r_Point &) const
non equal operator - negation of equal operator
r_Point operator-(const r_Point &) const
vector subtraction
const r_Point & operator=(const r_Point &)
assignment: cleanup + copy
char * get_string_representation() const
gives back the string representation
const int compare_with(const r_Point &p) const
compares this point with the given point.
r_Point operator*(const r_Point &) const
vector multiplication
Definition: error.hh:342
r_Point()
default constructor