ifw-odp  2.0.0-alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
array.hpp
Go to the documentation of this file.
1 
9 #ifndef ODP_ARRAY_HPP
10 #define ODP_ARRAY_HPP
11 
12 
13 #ifndef __cplusplus
14 #error This is a C++ include file and cannot be used from plain C
15 #endif
16 
17 // System header files
18 #include <iostream>
19 #include <cassert>
20 #include <typeinfo>
21 
22 // CPL header files
23 #include "cpl_array.h"
24 
25 // Local header files
26 #include "cppcpl/error.hpp"
27 
28 
29 namespace odp {
39  class Array : virtual public odp::Error
40  {
41  public:
48  Array();
49 
50 
57  explicit Array(cpl_size length);
58 
65  explicit Array(const Array &array);
66 
73  ~Array();
74 
80  inline bool IsArray() const;
81 
87  inline cpl_array* GetCplArray() const;
88 
95  inline cpl_size GetSize() const;
96 
97 
98  void Set(int index, double value);
99  double Get(int index);
100 
107  inline void SetCplArray(cpl_array *array);
108 
115  inline double* GetData();
116 
124  friend std::ostream& operator<<(std::ostream &os, const Array &array);
125 
126  private:
133  bool Delete();
134 
135  protected:
136  cpl_array *m_cpl_array;
137 
138  };
139 
140 }
141 #include "array.ipp"
142 
143 #endif
cpl_array * m_cpl_array
CPL array object.
Definition: array.hpp:136
cpl_size GetSize() const
Get array size.
friend std::ostream & operator<<(std::ostream &os, const Array &array)
Overload operator&lt;&lt;.
Definition: array.cpp:77
void SetCplArray(cpl_array *array)
Set CPL array.
This class handle the errors produced by the calling of image processing routines.
Definition: error.hpp:34
Array()
Class constructor.
Definition: array.cpp:19
double Get(int index)
Definition: array.cpp:51
This class is C++ wrapper for a CPL array object. It provides a simplified interface to the INS softw...
Definition: array.hpp:39
Error class header file.
cpl_array * GetCplArray() const
Get CPL array pointer.
~Array()
Class destructor.
Definition: array.cpp:47
double * GetData()
Get pointer to array data buffer.
bool IsArray() const
Check is CPL array is not null.
void Set(int index, double value)
Definition: array.cpp:60