InsertIteratorDM.hpp
1 #ifndef DM_INSERT_ITERATOR_DM_HPP_INCLUDED
2 #define DM_INSERT_ITERATOR_DM_HPP_INCLUDED
3 
4 #ifdef _MSC_VER
5  #pragma once
6 #endif
7 
8 #include "DM/config.hpp"
9 #include "DM/Iterator.hpp"
10 #include "DM/IPoint.hpp"
11 
12 DM_NAMESPACE_BEGIN
13 
14 template<typename PH_ContainerT >
15 class InsertIteratorPoint : public InsertIterator< IPoint >
16 {
18 
19 public:
20  typedef PH_ContainerT container_type;
21  typedef typename base::pointer pointer;
22  typedef typename base::const_reference const_reference;
23  typedef typename base::handle_type handle_type;
25 
26  InsertIteratorPoint(container_type &cont) : Cont(cont) {}
28 
29  virtual base& operator=(const_reference value) {
30  Cont.addPoint( value );
31  return *this;
32  }
33  virtual base& operator=(const_handle_reference value) {
34  Cont.addPoint( value );
35  return *this;
36  }
37  virtual base& operator*() { return *this; }
38  virtual base& operator++() { return *this; };
39 
40 protected:
41  container_type &Cont;
42 };
43 
44 /// Creates a point inserter for DM objects (any object with addPoint functions are supported).
45 template< typename ContainerT >
48 }
49 
50 
51 
52 DM_NAMESPACE_END
53 
54 
55 #endif //DM_INSERT_ITERATOR_DM_HPP_INCLUDED