IColBufferManagerWrite.hpp
1 #pragma once
2 
3 
4 #include "DM/config.hpp"
5 #include "DM/ObjectBase.hpp"
6 #include "DM/ColumnTypes.hpp"
7 #include "DM/AutoLink.hpp" //enable autolink
8 
9 DM_NAMESPACE_BEGIN
10 
11 /// \brief managing interface for creating and filling point coordinates and attributes into a column based continuous memory buffer
12 class DM_API IColBufferManagerWrite : public ObjectBase
13 {
14 protected:
15  virtual ~IColBufferManagerWrite() {}
16 
17 public:
18  /// \brief initialise row buffers (first function that will be called by GenericConverter::initColBufferManager)
19  /// \param[in] cols number of column buffers that are required
20  /// \param[in] rows number of elements each row buffer needs to provide
21  virtual void setSize(unsigned cols, int64_t rows) = 0;
22 
23  /// \brief communicating the column type and label
24  /**
25  This function that will be called (by GenericConverter::initColBufferManager) for each column after the initial setSize function was called.
26  The caller therefore communicates the type and label of each column that will be processed. The function must return the type of the internal
27  columns buffer, which may differ from the provided type. However, only fixed size type are accepted:
28 
29  DM::ColumnType | Memory Size and Representation
30  ----------------|--------------------------------
31  int_ | 4 byte, signed integer
32  uint_ | 4 byte, unsigned integer
33  char_ | 1 byte, integer
34  uchar_ | 1 byte, unsigned integer
35  short_ | 2 byte, integer
36  ushort_ | 2 byte, unsigned integer
37  float_ | 4 byte, real
38  double_ | 8 byte, real
39  llong_ | 8 byte, signed integer
40 
41  Its the managers responsibility to create appropriate sized column buffers and that are initialise with appropriate null values,
42  since the subsequent buffer filling doesn't write any null values are the corresponding memory positions.
43 
44  \param[in] col current column index
45  \param[in] colType DM type of the column/attribute
46  \param[in] colLabel label of current column/attribute
47  \param[in] useNoDataMask flag if a separate no data flag memory array is used instead of no data values
48  \return element type of internal column buffer
49  */
50  virtual ColumnType setColumnType(unsigned col, ColumnType colType, const char* colLabel, bool useNoDataMask = false) = 0;
51 
52  /// \brief get the pointer to the corresponding column buffer
53  /**
54  Will be called after the corresponding setSize and setColumnType calls. It is assumed that the returned
55  pointer shows to an initialised and properly sized memory chunk, that can be filled. Note that null values
56  do not change the corresponding memory byte(s).
57  */
58  virtual void * getColumnBuffer(unsigned col) = 0;
59 
60  /// \brief get the pointer to the optional mask column buffer
61  virtual void * getColumnMaskBuffer(unsigned col) = 0;
62 
63 };
64 
65 DM_NAMESPACE_END
ColumnType
Supported attribute type.
Definition: ColumnTypes.hpp:8
managing interface for creating and filling point coordinates and attributes into a column based cont...
Definition: IColBufferManagerWrite.hpp:12
Definition: M/c++_api/inc/DM/ObjectBase.hpp:8