CARMA C++
Coord.h
Go to the documentation of this file.
1 #ifndef SZA_UTIL_COORD_H
2 #define SZA_UTIL_COORD_H
3 
11 #include <vector>
12 #include <iostream>
13 
14 namespace sza {
15  namespace util {
16 
21  class Coord {
22  public:
23 
27  Coord();
28  Coord(Coord* coord);
29  Coord(unsigned ind1);
30  Coord(unsigned ind1, unsigned ind2);
31  Coord(unsigned ind1, unsigned ind2, unsigned ind3);
32 
36  virtual ~Coord();
37 
41  void setIndex(unsigned nAxis, unsigned index);
42 
46  void reserveIndex(unsigned nAxis);
47 
51  void reset(unsigned nAxis=1);
52 
56  unsigned nAxis();
57 
61  unsigned int getIndex(unsigned iAxis);
62 
66  bool isSet(unsigned iAxis);
67 
71  bool isValid();
72 
76  void operator=(Coord& coord);
77  void operator=(Coord coord);
78 
82  friend std::ostream& operator<<(std::ostream& os, Coord& coord);
83 
87  Coord& operator+=(unsigned incr);
88 
92  bool operator==(Coord& coord);
93 
94  private:
95 
96  std::vector<unsigned int> ind_;
97  std::vector<bool> initialized_;
98 
99  }; // End class Coord
100 
101  } // End namespace util
102 } // End namespace sza
103 
104 
105 
106 #endif // End #ifndef SZA_UTIL_COORD_H
virtual ~Coord()
Destructor.
unsigned nAxis()
Return the number of axes in this coordinate nTuplet.
void reset(unsigned nAxis=1)
Reset the coordinate ntuplet.
friend std::ostream & operator<<(std::ostream &os, Coord &coord)
An operator for printing this object.
void operator=(Coord &coord)
Assignment operators.
unsigned int getIndex(unsigned iAxis)
Return the coordinate index for axis iAxis.
bool isSet(unsigned iAxis)
Return true if a coordinate is set for this axis.
void setIndex(unsigned nAxis, unsigned index)
Set the coordinate index of the requested axis.
A class for specifying a coordinate in a multi-dimensional space.
Definition: Coord.h:21
Coord & operator+=(unsigned incr)
Add an increment to this object.
Coord()
Constructors.
bool isValid()
Check if this coordinate contains valid data.
void reserveIndex(unsigned nAxis)
Reserve (but don&#39;t set) an index slot for the requested axis.
bool operator==(Coord &coord)
Add an increment to this object.