IColBufferManagerRead.hpp
1 #pragma once
2 
3 #include "DM/config.hpp"
4 #include "DM/ObjectBase.hpp"
5 #include "DM/ColumnTypes.hpp"
6 #include "DM/AutoLink.hpp" //enable autolink
7 #include "DM/IValueTranslator.hpp"
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 IColBufferManagerRead : public ObjectBase
13 {
14 protected:
15  virtual ~IColBufferManagerRead() {}
16 
17 public:
18  virtual int64_t getRows() const = 0;
19  virtual int64_t getColumns() const = 0;
20 
21  /// \brief get internal column type
22  /**
23  This function that will be called (by GenericConverter::initColBufferManager) for each column after the initial setSize function was called.
24  The caller therefore communicates the type and label of each column that will be processed. The function must return the type of the internal
25  columns buffer, which may differ from the provided type. However, only fixed size type are accepted:
26 
27  DM::ColumnType | Memory Size and Representation
28  ----------------|--------------------------------
29  int_ | 4 byte, signed integer
30  uint_ | 4 byte, unsigned integer
31  char_ | 1 byte, integer
32  uchar_ | 1 byte, unsigned integer
33  short_ | 2 byte, integer
34  ushort_ | 2 byte, unsigned integer
35  float_ | 4 byte, real
36  double_ | 8 byte, real
37  llong_ | 8 byte, signed integer
38 
39 
40  Its the managers responsibility to create appropriate sized column buffers and that are initialise with appropriate null values,
41  since the subsequent buffer filling doesn't write any null values are the corresponding memory positions.
42 
43  \param[in] col current column index
44  \return element type of internal column buffer
45  */
46  virtual ColumnType getColumnType(unsigned col) const = 0;
47 
48  /// \brief get optional translator object for translating values before setting
49  virtual const IValueTranslator* getTranslator(unsigned col) const = 0;
50 
51  /// \brief get the pointer to the corresponding column buffer
52  /**
53  Will be called after the corresponding setSize and setColumnType calls. It is assumed that the returned
54  pointer shows to an initialised and properly sized memory chunk, that can be filled. Note that null values
55  do not change the corresponding memory byte(s).
56  */
57  virtual const void * getColumnBuffer(unsigned col) const = 0;
58 
59  /// \brief get stride size between subsequent elements in the column buffer
60  /**
61  In case of continuous memory array the stride size is equal to the element size (in bytes)
62  */
63  virtual unsigned getStride(unsigned col) const = 0;
64 
65 };
66 
67 DM_NAMESPACE_END
managing interface for creating and filling point coordinates and attributes into a column based cont...
Definition: IColBufferManagerRead.hpp:12
ColumnType
Supported attribute type.
Definition: ColumnTypes.hpp:8
Definition: M/c++_api/inc/DM/ObjectBase.hpp:8
helper class for translating/mapping attributes before inserting into the ODM
Definition: IValueTranslator.hpp:13