ifw-odp 5.1.1
 
Loading...
Searching...
No Matches
array.hpp
Go to the documentation of this file.
1
7
8#ifndef ODP_ARRAY_HPP
9#define ODP_ARRAY_HPP
10
11
12#ifndef __cplusplus
13#error This is a C++ include file and cannot be used from plain C
14#endif
15
16// System header files
17#include <iostream>
18#include <cassert>
19#include <typeinfo>
20
21// CPL header files
22#include "cpl_array.h"
23
24// Local header files
26
27
28namespace ifw::odp {
38 class Array : virtual public odp::Error
39 {
40 public:
47 Array();
48
49
56 explicit Array(cpl_size length);
57
64 explicit Array(const Array &array);
65
72 ~Array();
73
79 inline bool IsArray() const;
80
86 inline cpl_array* GetCplArray() const;
87
94 inline cpl_size GetSize() const;
95
96
97 void Set(int index, double value);
98 double Get(int index);
99
106 inline void SetCplArray(cpl_array *array);
107
114 inline double* GetData();
115
123 friend std::ostream& operator<<(std::ostream &os, const Array &array);
124
125 private:
132 bool Delete();
133
134 protected:
135 cpl_array *m_cpl_array;
136
137 };
138
139}
140#include "array.ipp"
141
142#endif
143
144
145
146
147
148
149
150
~Array()
Class destructor.
Definition array.cpp:42
bool IsArray() const
Check is CPL array is not null.
Array()
Class constructor.
Definition array.cpp:16
friend std::ostream & operator<<(std::ostream &os, const Array &array)
Overload operator<<.
Definition array.cpp:70
void Set(int index, double value)
Definition array.cpp:54
double * GetData()
Get pointer to array data buffer.
cpl_size GetSize() const
Get array size.
double Get(int index)
Definition array.cpp:46
cpl_array * m_cpl_array
CPL array object.
Definition array.hpp:135
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:34
Array class source file.
Definition array.cpp:14