21 #ifndef __MIA_2DDATAFIELD_HH 22 #define __MIA_2DDATAFIELD_HH 1 35 #include <miaconfig.h> 37 #ifndef EXPORT_2DDATAFIELD 38 # define EXPORT_2DDATAFIELD EXPORT_2D 44 #define DECLARE_EXTERN_ITERATORS(TYPE) \ 45 extern template class EXPORT_2D range2d_iterator<std::vector<TYPE>::iterator>; \ 46 extern template class EXPORT_2D range2d_iterator<std::vector<TYPE>::const_iterator>; \ 47 extern template class EXPORT_2D range2d_iterator_with_boundary_flag<std::vector<TYPE>::iterator>; \ 48 extern template class EXPORT_2D range2d_iterator_with_boundary_flag<std::vector<TYPE>::const_iterator>; 51 #pragma GCC diagnostic push 53 #pragma GCC diagnostic ignored "-Wattributes" 73 #undef DECLARE_EXTERN_ITERATORS 76 #pragma GCC diagnostic pop 94 typedef ::std::vector<typename __holder_type_dispatch<T>::type>
data_array;
99 typedef typename data_array::iterator iterator;
100 typedef typename data_array::const_iterator const_iterator;
101 typedef typename data_array::const_reference const_reference;
102 typedef typename data_array::reference reference;
103 typedef typename data_array::const_pointer const_pointer;
104 typedef typename data_array::pointer pointer;
105 typedef typename data_array::value_type value_type;
106 typedef typename data_array::difference_type difference_type;
107 typedef typename data_array::size_type size_type;
143 iterator
begin()
const;
145 iterator
end()
const;
224 const_reference operator()(
size_t x,
size_t y) const;
231 reference operator()(
size_t x,
size_t y);
241 const_reference operator[](
size_t idx)
const{
295 size_type
size()
const;
299 return m_data.begin();
303 const_iterator
end()
const {
312 return m_data.begin();
333 const_iterator b =
begin();
334 advance(b, x + y * m_size.x);
344 iterator b =
begin();
345 advance(b, x + y * m_size.x);
373 const static value_type Zero;
419 #define DEFINE_2DFIELD_TEMPLATE(TYPE) \ 420 extern template class EXPORT_2D T2DDatafield<TYPE>; \ 421 extern template class EXPORT_2D range2d_iterator<T2DDatafield<TYPE>::iterator>; \ 422 extern template class EXPORT_2D range2d_iterator<T2DDatafield<TYPE>::const_iterator>; \ 423 extern template class EXPORT_2D range2d_iterator_with_boundary_flag<T2DDatafield<TYPE>::iterator>; \ 424 extern template class EXPORT_2D range2d_iterator_with_boundary_flag<T2DDatafield<TYPE>::const_iterator>; 428 #pragma GCC diagnostic push 430 #pragma GCC diagnostic ignored "-Wattributes" 435 DEFINE_2DFIELD_TEMPLATE(
double);
436 DEFINE_2DFIELD_TEMPLATE(
float);
437 DEFINE_2DFIELD_TEMPLATE(int64_t);
438 DEFINE_2DFIELD_TEMPLATE(uint64_t);
439 DEFINE_2DFIELD_TEMPLATE(uint32_t);
440 DEFINE_2DFIELD_TEMPLATE(int32_t);
441 DEFINE_2DFIELD_TEMPLATE(uint16_t);
442 DEFINE_2DFIELD_TEMPLATE(int16_t);
443 DEFINE_2DFIELD_TEMPLATE(uint8_t);
444 DEFINE_2DFIELD_TEMPLATE(int8_t);
455 #pragma GCC diagnostic pop TTranslator< C2DFVector > C2DFVectorTranslator
typedef for the C2DFVector to std::string translator
void put_data_line_x(size_t y, const std::vector< T > &buffer)
const_iterator begin_at(size_t x, size_t y) const
T2DDatafield< int8_t > C2DSBDatafield
2D scalar field that holds signed char values
void put_data_line_y(size_t x, const std::vector< T > &buffer)
Generic string vs. attribute translator singleton.
range_iterator end_range(const C2DBounds &begin, const C2DBounds &end)
T2DDatafield< uint16_t > C2DUSDatafield
2D scalar field that holds unsigned short values
T2DDatafield< T > & operator=(const T2DDatafield< T > &org)
const_iterator begin() const
#define EXPORT_2DDATAFIELD
define used export 2D symbols
T2DDatafield< bool > C2DBitDatafield
2D scalar field that holds bool values
a 2D iterator that knows its position in the 2D grid ans supports iterating over sub-ranges ...
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
iterator begin_at(size_t x, size_t y)
T2DDatafield< int32_t > C2DSIDatafield
2D scalar field that holds signed int values
T2DDatafield< int16_t > C2DSSDatafield
2D scalar field that holds signed short values
const_iterator end() const
void make_single_ref() __attribute__((deprecated))
T2DDatafield< T >::range_iterator iterator
T2DDatafield< uint32_t > C2DUIDatafield
2D scalar field that holds unsigned int values
range_iterator begin_range(const C2DBounds &begin, const C2DBounds &end)
CTParameter< C2DFVector > C2DFVectorParameter
Parameter type for 2D vector.
Generic type of a complex paramter.
const C2DBounds & get_size() const
T2DDatafield< uint8_t > C2DUBDatafield
2D scalar field that holds unsigned char (=byte) values
CTParameter< C2DBounds > C2DBoundsParameter
Parameter type for 2D size definitions.
A class to hold data on a regular 2D grid.
#define DECLARE_EXTERN_ITERATORS(TYPE)
T2DDatafield< float > C2DFDatafield
2D scalar field that holds float values
reference operator[](size_t idx)
T2DDatafield< T >::const_range_iterator iterator
::std::vector< typename __holder_type_dispatch< T >::type > data_array
type for the flat reprentation of the 2D data field
T2DDatafield< uint64_t > C2DULDatafield
T2DDatafield< int64_t > C2DSLDatafield
long instanziation of a 2D data field
void get_data_line_x(size_t y, std::vector< T > &buffer) const
const_reference operator()(size_t x, size_t y) const
Class of an attribute that holds data of type T.
T2DDatafield< double > C2DDDatafield
2D scalar field that holds double values
Range get_range(const C2DBounds &start, const C2DBounds &end)
void get_data_line_y(size_t x, std::vector< T > &buffer) const
#define NS_MIA_END
conveniance define to end the mia namespace