WRApplication
External kratos "application" for multiscale time integration.
DataValueContainerKeyIterator.hpp
Go to the documentation of this file.
1 
3 #pragma once
4 
5 // --- Core Includes ---
6 #include "containers/data_value_container.h"
7 #include "includes/kratos_export_api.h"
8 
9 // --- WRApp Includes ---
11 
12 // --- STL Includes ---
13 #include <type_traits>
14 
15 
16 namespace Kratos::WRApp {
17 
18 
23 
24 
29 class KRATOS_API(WR_APPLICATION) DataValueContainerKeyIterator
30 {
31 private:
32  using Wrapped = DataValueContainer::const_iterator;
33 
34 public:
35  using value_type = std::string;
36 
38  using pointer = const value_type*;
39 
41  using reference = const value_type&;
42 
43  using difference_type = Wrapped::difference_type;
44 
45  using iterator_category = std::forward_iterator_tag;
46 
48 
50  : mWrapped(wrapped)
51  {}
52 
54 
56 
58  {return mWrapped->first->Name();}
59 
61  {return &mWrapped->first->Name();}
62 
64  {++mWrapped; return *this;}
65 
67  {DataValueContainerKeyIterator copy(*this); ++(*this); return copy;}
68 
70  {return Left.mWrapped == Right.mWrapped;}
71 
73  {return !(Left == Right);}
74 
75 private:
76  Wrapped mWrapped;
77 }; // class DataValueContainerKeyIterator
78 
79 
80 
82 using DataValueContainerKeyRange = Range<DataValueContainerKeyIterator>;
83 
84 
87 
88 
89 } // namespace Kratos::WRApp
Iterator providing access to variables' names within a DataValueContainer.
Definition: DataValueContainerKeyIterator.hpp:30
pointer operator->()
Definition: DataValueContainerKeyIterator.hpp:60
friend bool operator!=(DataValueContainerKeyIterator Left, DataValueContainerKeyIterator Right)
Definition: DataValueContainerKeyIterator.hpp:72
const value_type * pointer
const key_type* if const_iterator else key_type*
Definition: DataValueContainerKeyIterator.hpp:38
reference operator*()
Definition: DataValueContainerKeyIterator.hpp:57
DataValueContainerKeyIterator(const DataValueContainerKeyIterator &rOther) noexcept=default
Wrapped::difference_type difference_type
Definition: DataValueContainerKeyIterator.hpp:43
DataValueContainerKeyIterator operator++(int)
Definition: DataValueContainerKeyIterator.hpp:66
std::forward_iterator_tag iterator_category
Definition: DataValueContainerKeyIterator.hpp:45
friend bool operator==(DataValueContainerKeyIterator Left, DataValueContainerKeyIterator Right)
Definition: DataValueContainerKeyIterator.hpp:69
DataValueContainerKeyIterator(Wrapped wrapped)
Definition: DataValueContainerKeyIterator.hpp:49
const value_type & reference
const key_type& if const_iterator else key_type&
Definition: DataValueContainerKeyIterator.hpp:41
DataValueContainerKeyIterator(DataValueContainerKeyIterator &&rOther) noexcept=default
DataValueContainerKeyIterator & operator++()
Definition: DataValueContainerKeyIterator.hpp:63
std::string value_type
Definition: DataValueContainerKeyIterator.hpp:35
Range< DataValueContainerKeyIterator > DataValueContainerKeyRange
Range class iterating over the variable names within a DataValueContainer.
Definition: DataValueContainerKeyIterator.hpp:82
Definition: MPIUtils.hpp:9