IIndexHelperSet.hpp
1 #ifndef DM_IINDEX_HELPER_SET_HPP_INCLUDED
2 #define DM_IINDEX_HELPER_SET_HPP_INCLUDED
3 
4 #ifdef _MSC_VER
5  #pragma once
6 #endif
7 
8 
9 #include "DM/config.hpp"
10 #include "DM/Iterator.hpp"
11 
12 DM_NAMESPACE_BEGIN
13 
14 /// \brief Helper class for traversing a IndexMap object in multiple stages
15 class DM_API IIndexHelper : public ObjectBase
16 {
17 protected:
18  virtual ~IIndexHelper() {}
19 
20 public:
21  virtual IIndexHelper* clone() const = 0;
22 
23  virtual int id() const = 0; ///< corresponding class id
24  virtual int64_t counter() const = 0; ///< number of points/object that have been traversed in this class
25  virtual int64_t index() const = 0; ///< next index for the corresponding IndexMap object that has to be considered
26 };
27 
29 
30 
31 
32 /// \brief Helper class for traversing a IndexMapSet object in multiple stages
33 class DM_API IIndexHelperSet : public ObjectBase
34 {
35 public:
36  // Iterator typedefs ============================================================================
38 
39  static IIndexHelperSet* New(); ///< create an empty index helper set
40 
41  // General member functions ====================================================================
42  virtual IIndexHelperSet* clone() const = 0; ///< clone object
43 
44  virtual int64_t size() const = 0; ///< size of index map set
45 
46  virtual IIndexHelper& operator[](const int id) = 0; ///< access index helper by class id
47  virtual const IIndexHelper& operator[](const int id) const = 0; ///< const access index helper by class id
48 
49  virtual const_iterator beginIndexHelper() const = 0;
50  virtual const_iterator endIndexHelper() const = 0;
51 };
52 
54 
55 DM_NAMESPACE_END
56 
57 #endif //DM_IINDEX_HELPER_SET_HPP_INCLUDED