ifw-odp 5.0.0
Loading...
Searching...
No Matches
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
27
28
29namespace ifw::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
This class is C++ wrapper for a CPL array object. It provides a simplified interface to the INS softw...
Definition array.hpp:40
~Array()
Class destructor.
Definition array.cpp:44
bool IsArray() const
Check is CPL array is not null.
Array()
Class constructor.
Definition array.cpp:18
friend std::ostream & operator<<(std::ostream &os, const Array &array)
Overload operator<<.
Definition array.cpp:72
void Set(int index, double value)
Definition array.cpp:56
double * GetData()
Get pointer to array data buffer.
cpl_size GetSize() const
Get array size.
double Get(int index)
Definition array.cpp:48
cpl_array * m_cpl_array
CPL array object.
Definition array.hpp:136
void SetCplArray(cpl_array *array)
Set CPL array.
cpl_array * GetCplArray() const
Get CPL array pointer.
This class handle the errors produced by the calling of image processing routines.
Definition error.hpp:35
Error class header file.
Definition array.cpp:16