GenericConverter.hpp
1 #ifndef DM_GENERIC_CONVERTER_HPP_INCLUDED
2 #define DM_GENERIC_CONVERTER_HPP_INCLUDED
3 
4 #ifdef _MSC_VER
5  #pragma once
6 #endif
7 
8 #include "DM/config.hpp"
9 #include "DM/AutoLink.hpp" //enable autolink
10 #include "DM/Iterator.hpp"
11 #include "DM/IPoint.hpp"
12 #include "DM/IAddInfoLayout.hpp"
13 #include "DM/IIndexMapSet.hpp"
14 #include "DM/IIndexHelperSet.hpp"
15 #include "DM/IFilter.hpp"
16 #include "DM/IColBufferManagerRead.hpp"
17 #include "DM/IColBufferManagerWrite.hpp"
18 
19 DM_NAMESPACE_BEGIN
20 
21 class IClassificationMatrix;
22 
23 /// \brief provides a set of converter function between DM and generic memory manager structures
24 namespace GenericConverter
25 {
26  // Iterator typedefs ============================================================================
27  typedef ConstIterator<IPoint> const_iterator_point; ///< Point iterator
28 
29  /// \brief initialize a column buffer manager that it can be used for subsequent converter calls
30  ///
31  /// \param[in] colBufferManager column buffer manager object for allocating the necessary column buffer objects
32  /// \param[in] rowCount number of rows to reserve
33  /// \param[in] layout defines the attributes (columns of the data frame object) to that should be generated
34  /// \param[in] withCoordinates flag if columns for the coordinates should generated as well
35  DM_API void initColBufferManager(IColBufferManagerWrite &colBufferManager, int64_t rowCount, const AddInfoLayoutHandle &layout, bool withCoordinates = true);
36 
37  DM_API int64_t fillColBuffer(IColBufferManagerWrite &colBufferManager, int64_t rowIdx, const_iterator_point it, const_iterator_point end, FilterHandle filter = FilterHandle());
38  DM_API int64_t fillColBuffer(IColBufferManagerWrite &colBufferManager, int64_t rowIdx, const AddInfoLayoutHandle &mapColumn, const IIndexMapSet &map, IIndexHelperSet &helper, bool invertIndexMap,
40 
41  /// \brief initialize and fill a column buffer manager
42  /// this function combines initColBufferManager and fillColBuffer calls. The number of rowCounts that is needed to store all data is internally determined and passed to the
43  /// colBufferManager object before the actual filling is performed
44  ///
45  /// \param[in] colBufferManager column buffer manager object for allocating the necessary column buffer objects
46  /// \param[in] it begin iterator of points
47  /// \param[in] end end iterator of points
48  /// \param[in] layout defines the attributes (columns of the data frame object) to that should be generated
49  /// \param[in] withCoordinates flag if columns for the coordinates should generated as well
50  /// \param[in] filter optional filter to subselect the points
51  /// \return number of rows that were filled
52  DM_API int64_t asColBuffer(IColBufferManagerWrite &colBufferManager, const_iterator_point it, const_iterator_point end, const AddInfoLayoutHandle &layout, bool withCoordinates = true, FilterHandle filter = FilterHandle());
53  DM_API int64_t asColBuffer(IColBufferManagerWrite &colBufferManager, const_iterator_point it, const_iterator_point end, const AddInfoLayoutHandle &layout,
54  const AddInfoLayoutHandle &mapColumn, const IIndexMapSet &map, IIndexHelperSet &helper, bool invertIndexMap,
55  bool withCoordinates = true, FilterHandle filter = FilterHandle());
56 
57 
58  /// \brief Set attributes from a column buffer object
59  DM_API int64_t setFromColBuffer(const_iterator_point it, const_iterator_point end, const AddInfoLayoutHandle &layout, const IColBufferManagerRead &colBufferManager, FilterHandle filter = FilterHandle());
60 
61  DM_API void compareWith(const IColBufferManagerRead &colBufferManager, DM::IClassificationMatrix &classMatrix, const_iterator_point it, const_iterator_point end,
62  const DM::AddInfoLayoutHandle &mapCol, const DM::IIndexMapSet &map, DM::IIndexHelperSet &helper, bool invertIndexMap,
63  DM::FilterHandle filter = FilterHandle() );
64 }
65 
66 DM_NAMESPACE_END
67 
68 #endif //DM_GENERIC_CONVERTER_HPP_INCLUDED