Iterate over the legs of a chain.
More...
#include <ChainNameParser.h>
Iterate over the legs of a chain.
Definition at line 35 of file ChainNameParser.h.
◆ difference_type
◆ iterator_category
◆ pointer
◆ reference
◆ value_type
◆ LegInfoIterator() [1/2]
| ChainNameParser::LegInfoIterator::LegInfoIterator |
( |
| ) |
|
|
default |
Default constructor creates a past-the-end iterator.
◆ LegInfoIterator() [2/2]
| ChainNameParser::LegInfoIterator::LegInfoIterator |
( |
const std::string & | chain | ) |
|
Create an iterator from the beginning of a chain name.
- Parameters
-
Definition at line 78 of file ChainNameParser.cxx.
78 :
80 {
81
83
84
86 }
LegInfoIterator & operator++()
pre-increment operator
std::string::const_iterator m_itr
std::string::const_iterator m_end
◆ advance()
| bool ChainNameParser::LegInfoIterator::advance |
( |
| ) |
|
|
private |
Definition at line 145 of file ChainNameParser.cxx.
146 {
149 if (std::regex_match(
m_itr, next,
match, legHeadRegex()))
150 {
151
152 if (
match.str(1).empty())
154 else
157 if (
match.str(3).empty())
159 else
161
163 return true;
164 }
165 else if (next ==
m_end)
166 {
168
170 return true;
171 }
172 else
173 {
174
176
178 return false;
179 }
180 }
std::string m_peekSignature
std::size_t m_peekMultiplicity
bool match(std::string s1, std::string s2)
match the individual directories of two strings
◆ exhausted()
| bool ChainNameParser::LegInfoIterator::exhausted |
( |
| ) |
const |
Whether the iterator is exhausted.
Definition at line 140 of file ChainNameParser.cxx.
141 {
142 return m_itr == std::string::const_iterator();
143 }
◆ operator!=()
| bool ChainNameParser::LegInfoIterator::operator!= |
( |
const LegInfoIterator & | other | ) |
const |
◆ operator*()
Dereference the iterator.
Dereferencing a past-the-end iterator returns an invalid LegInfo object
Definition at line 98 of file ChainNameParser.cxx.
◆ operator++() [1/2]
pre-increment operator
Definition at line 108 of file ChainNameParser.cxx.
109 {
111 {
112
114 m_itr = std::string::const_iterator();
115 m_end = std::string::const_iterator();
118 }
119 else
120 {
121
127
129 }
130 return *this;
131 }
◆ operator++() [2/2]
post-increment operator
Definition at line 133 of file ChainNameParser.cxx.
134 {
137 return itr;
138 }
LegInfoIterator()=default
Default constructor creates a past-the-end iterator.
◆ operator->()
◆ operator==()
| bool ChainNameParser::LegInfoIterator::operator== |
( |
const LegInfoIterator & | other | ) |
const |
◆ m_current
| LegInfo ChainNameParser::LegInfoIterator::m_current |
|
private |
◆ m_end
| std::string::const_iterator ChainNameParser::LegInfoIterator::m_end |
|
private |
◆ m_itr
| std::string::const_iterator ChainNameParser::LegInfoIterator::m_itr |
|
private |
◆ m_peekMultiplicity
| std::size_t ChainNameParser::LegInfoIterator::m_peekMultiplicity {0} |
|
private |
◆ m_peekSignature
| std::string ChainNameParser::LegInfoIterator::m_peekSignature {""} |
|
private |
◆ m_peekThreshold
| int ChainNameParser::LegInfoIterator::m_peekThreshold {-1} |
|
private |
The documentation for this class was generated from the following files: