InsertIteratorADJ.hpp
1 #ifndef DM_INSERT_ITERATOR_ADJ_HPP_INCLUDED
2 #define DM_INSERT_ITERATOR_ADJ_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 ADJ_ContainerT >
15 class InsertIteratorPointADJ : public InsertIterator< IPoint >
16 {
18 
19 public:
20  typedef ADJ_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  InsertIteratorPointADJ(container_type &cont) : Cont(cont) {}
28 
29  virtual base& operator=(const_reference value) {
30  handle_type h = (pointer)(value.clone());
31  Cont.v_addPoint( h );
32  return *this;
33  }
34  virtual base& operator=(const_handle_reference value) {
35  Cont.v_addPoint( value );
36  return *this;
37  }
38  virtual base& operator*() { return *this; }
39  virtual base& operator++() { return *this; };
40 
41 protected:
42  container_type &Cont;
43 };
44 
45 /// Creates a point inserter for ADJ_lib objects (any ADJ objects with v_addPoint functions are supported).
46 template< typename ContainerT >
49 }
50 
51 
52 DM_NAMESPACE_END
53 
54 #endif //DM_INSERT_ITERATOR_ADJ_HPP_INCLUDED