KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
pointer_vector_map_iterator.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Pooyan Dadvand
11 // Riccardo Rossi
12 //
13 //
14 
15 
16 #if !defined(KRATOS_POINTER_VECTOR_MAP_ITERATOR_H_INCLUDED )
17 #define KRATOS_POINTER_VECTOR_MAP_ITERATOR_H_INCLUDED
18 
19 
20 
21 // System includes
22 #include <string>
23 #include <iostream>
24 
25 
26 // External includes
27 #include <boost/iterator/iterator_adaptor.hpp>
28 
29 
30 // Project includes
31 #include "includes/define.h"
32 
33 
34 namespace Kratos
35 {
36 
39 
43 
47 
51 
55 
57 
59 template<class TIteratorType, class TDataType>
61  : public boost::iterator_adaptor<PointerVectorMapIterator<TIteratorType, TDataType>,
62  TIteratorType, TDataType>
63 {
64 public:
67 
70 
71  typedef boost::iterator_adaptor<PointerVectorMapIterator,
72  TIteratorType, TDataType> BaseType;
73 
74  typedef typename TIteratorType::value_type::first_type key_type;
75 
79 
82 
83  PointerVectorMapIterator(TIteratorType NewIterator) :BaseType(NewIterator) {}
84 
85  PointerVectorMapIterator(PointerVectorMapIterator const & NewIterator) :BaseType(NewIterator.base()) {}
86 
87  //template<class TOtherIteratorType>
88  //PointerVectorMapIterator(PointerVectorMapIterator<TIteratorType> const & NewIterator) :BaseType(NewIterator.base()) {}
89 
90 
94 
95 
99 
101  {
102  return this->base()->first;
103  }
104 
105 
109 
110 
114 
115 
119 
120 
124 
125 
127 
128 private:
132 
133 
137 
138 
142 
143 
147 
148  typename BaseType::reference dereference() const
149  {
150 # if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
151  return const_cast<BaseType::reference>(*this->base()->second);
152 # else
153  return *(this->base()->second);
154 # endif
155  }
156 
160 
161 
165 
166 
170 
171 
173 
174 }; // Class PointerVectorMapIterator
175 
177 
180 
181 
185 
186 
188 
189 
190 } // namespace Kratos.
191 
192 #endif // KRATOS_POINTER_VECTOR_MAP_ITERATOR_H_INCLUDED defined
193 
194 
Short class definition.
Definition: pointer_vector_map_iterator.h:63
KRATOS_CLASS_POINTER_DEFINITION(PointerVectorMapIterator)
Pointer definition of PointerVectorMapIterator.
TIteratorType::value_type::first_type key_type
Definition: pointer_vector_map_iterator.h:74
PointerVectorMapIterator()
Default constructor.
Definition: pointer_vector_map_iterator.h:81
boost::iterator_adaptor< PointerVectorMapIterator, TIteratorType, TDataType > BaseType
Definition: pointer_vector_map_iterator.h:72
key_type key()
Definition: pointer_vector_map_iterator.h:100
PointerVectorMapIterator(TIteratorType NewIterator)
Definition: pointer_vector_map_iterator.h:83
friend class boost::iterator_core_access
Definition: pointer_vector_map_iterator.h:129
PointerVectorMapIterator(PointerVectorMapIterator const &NewIterator)
Definition: pointer_vector_map_iterator.h:85
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21