1 #ifndef MULTICOUNTER_HH
2 #define MULTICOUNTER_HH
13 template<
typename SubCounterType>
16 template<
typename SubCounterType>
22 typedef typename SubCounterType::const_value_iterator
sub_iterator;
26 sub_iterator _sub_iter = sub_iterator()) :
35 return !((*this) == _it);
80 template <
typename CounterType>
109 return m_counters.
size();
132 return m_counters.
back();
135 const CounterType &
back()
const {
136 return m_counters.
back();
140 return m_counters[i];
144 return m_counters[i];
158 template <
typename CounterType>
163 template <
typename CounterType>
165 m_counters = _counters;
170 template <
typename CounterType>
172 m_is_valid = (size() != 0);
173 for(
Index i = 0; i < size(); i++)
174 m_counters[i].reset();
177 template <
typename CounterType>
183 template <
typename CounterType>
187 while(valid() && index < size()) {
188 if(!(++m_counters[index]).valid()) {
193 for(
Index i = 0; i < index; i++) {
194 m_counters[i].reset();
205 template <
typename CounterType>
207 for(
Index i = 0; i < steps && m_is_valid; i++)
213 template <
typename CounterType>
214 std::ostream &operator<<(std::ostream &stream, const MultiCounter<CounterType> &counter) {
215 return stream << counter();
const Array< CounterType > & current() const
CounterType::size_type size_type
void push_back(const CounterType &new_counter)
CounterValueIterator< MultiCounter > const_value_iterator
const Array< CounterType > & operator()() const
void push_back(const T &toPush)
SubCounterType::const_value_iterator sub_iterator
CounterValueIterator(CounterType const *_counter_ptr=nullptr, size_type _ind=0, sub_iterator _sub_iter=sub_iterator())
const_value_iterator value_end() const
bool operator==(const CounterValueIterator &_it)
CounterType & operator[](Index i)
CounterType const * m_counter_ptr
CounterType::size_type size_type
EigenIndex Index
For long integer indexing:
CounterType const * m_counter_ptr
value_type const * operator->() const
CounterType::value_type value_type
const value_type & operator*() const
const CounterType & back() const
const value_type & operator*() const
Array< CounterType > m_counters
CounterValueIterator & operator++()
const CounterType & operator[](Index i) const
MultiCounter< SubCounterType > CounterType
bool operator!=(const CounterValueIterator &_it)
bool operator+=(Index steps)
CounterType::value_type value_type
const_value_iterator value_begin() const
MultiCounter & operator++()
CounterValueIterator operator++(int)