Public Types | Public Member Functions | Private Attributes | List of all members
art::const_AssnsIter< L, R, D, Dir > Class Template Reference

#include <AssnsIter.h>

Public Types

using iterator_category = std::random_access_iterator_tag
 
using value_type = art::AssnsNode< L, R, D >
 
using pointer = value_type const *
 
using reference = value_type const &
 
using difference_type = std::ptrdiff_t
 

Public Member Functions

 const_AssnsIter ()=default
 
 const_AssnsIter (art::Assns< L, R, D > const &assns)
 
 const_AssnsIter (art::Assns< L, R, D > const &assns, std::size_t const i)
 
reference operator* () const
 
pointer operator-> () const
 
const_AssnsIter< L, R, D, Dir > & operator++ ()
 
const_AssnsIter< L, R, D, Dir > operator++ (int)
 
const_AssnsIter< L, R, D, Dir > & operator-- ()
 
const_AssnsIter< L, R, D, Dir > operator-- (int)
 
bool operator== (art::const_AssnsIter< L, R, D, Dir > const &iter) const
 
bool operator!= (art::const_AssnsIter< L, R, D, Dir > const &iter) const
 
const_AssnsIter< L, R, D, Dir > & operator+= (std::size_t i)
 
const_AssnsIter< L, R, D, Dir > operator+ (std::size_t i) const
 
const_AssnsIter< L, R, D, Dir > & operator-= (std::size_t i)
 
const_AssnsIter< L, R, D, Dir > operator- (std::size_t i) const
 
std::size_t operator- (art::const_AssnsIter< L, R, D, Dir > const &iter1) const
 
value_type operator[] (std::size_t i) const
 
bool operator< (art::const_AssnsIter< L, R, D, Dir > const &iter) const
 
bool operator<= (art::const_AssnsIter< L, R, D, Dir > const &iter) const
 
bool operator> (art::const_AssnsIter< L, R, D, Dir > const &iter) const
 
bool operator>= (art::const_AssnsIter< L, R, D, Dir > const &iter) const
 
std::size_t getIndex () const
 

Private Attributes

art::Assns< L, R, D > const * coll_ {nullptr}
 
std::size_t index_ {-1ull}
 
AssnsNode< L, R, Dnode_ {}
 

Detailed Description

template<typename L, typename R, typename D, Direction Dir = Direction::Forward>
class art::const_AssnsIter< L, R, D, Dir >

Definition at line 28 of file AssnsIter.h.

Member Typedef Documentation

template<typename L, typename R, typename D, Direction Dir = Direction::Forward>
using art::const_AssnsIter< L, R, D, Dir >::difference_type = std::ptrdiff_t

Definition at line 34 of file AssnsIter.h.

template<typename L, typename R, typename D, Direction Dir = Direction::Forward>
using art::const_AssnsIter< L, R, D, Dir >::iterator_category = std::random_access_iterator_tag

Definition at line 30 of file AssnsIter.h.

template<typename L, typename R, typename D, Direction Dir = Direction::Forward>
using art::const_AssnsIter< L, R, D, Dir >::pointer = value_type const*

Definition at line 32 of file AssnsIter.h.

template<typename L, typename R, typename D, Direction Dir = Direction::Forward>
using art::const_AssnsIter< L, R, D, Dir >::reference = value_type const&

Definition at line 33 of file AssnsIter.h.

template<typename L, typename R, typename D, Direction Dir = Direction::Forward>
using art::const_AssnsIter< L, R, D, Dir >::value_type = art::AssnsNode<L, R, D>

Definition at line 31 of file AssnsIter.h.

Constructor & Destructor Documentation

template<typename L, typename R, typename D, Direction Dir = Direction::Forward>
art::const_AssnsIter< L, R, D, Dir >::const_AssnsIter ( )
default
template<typename L, typename R, typename D, Direction Dir = Direction::Forward>
art::const_AssnsIter< L, R, D, Dir >::const_AssnsIter ( art::Assns< L, R, D > const &  assns)
inlineexplicit

Definition at line 37 of file AssnsIter.h.

38  : coll_{&assns}, index_{assns.size()}
39  {}
size_type size() const
Definition: Assns.h:497
std::size_t index_
Definition: AssnsIter.h:74
art::Assns< L, R, D > const * coll_
Definition: AssnsIter.h:73
template<typename L, typename R, typename D, Direction Dir = Direction::Forward>
art::const_AssnsIter< L, R, D, Dir >::const_AssnsIter ( art::Assns< L, R, D > const &  assns,
std::size_t const  i 
)
inlineexplicit

Definition at line 40 of file AssnsIter.h.

42  : coll_{&assns}, index_{i}
43  {}
std::size_t index_
Definition: AssnsIter.h:74
art::Assns< L, R, D > const * coll_
Definition: AssnsIter.h:73

Member Function Documentation

template<typename L, typename R, typename D, Direction Dir = Direction::Forward>
std::size_t art::const_AssnsIter< L, R, D, Dir >::getIndex ( ) const
inline

Definition at line 67 of file AssnsIter.h.

68  {
69  return index_;
70  };
std::size_t index_
Definition: AssnsIter.h:74
template<typename L , typename R , typename D , Direction Dir>
bool art::const_AssnsIter< L, R, D, Dir >::operator!= ( art::const_AssnsIter< L, R, D, Dir > const &  iter) const

Definition at line 181 of file AssnsIter.h.

183  {
184  return !(index_ == iter.index_);
185  }
std::size_t index_
Definition: AssnsIter.h:74
template<typename L , typename R , typename D , Direction Dir>
art::const_AssnsIter< L, R, D, Dir >::reference art::const_AssnsIter< L, R, D, Dir >::operator* ( ) const

Definition at line 111 of file AssnsIter.h.

112  {
113  auto const index = index_for_dereferencing<Dir>(index_);
114  node_.first = (*coll_)[index].first;
115  node_.second = (*coll_)[index].second;
116  node_.data = &(coll_->data(index));
117  return node_;
118  }
std::size_t index_
Definition: AssnsIter.h:74
AssnsNode< L, R, D > node_
Definition: AssnsIter.h:75
art::Assns< L, R, D > const * coll_
Definition: AssnsIter.h:73
template<typename L , typename R , typename D , Direction Dir>
art::const_AssnsIter< L, R, D, Dir > art::const_AssnsIter< L, R, D, Dir >::operator+ ( std::size_t  i) const

Definition at line 201 of file AssnsIter.h.

202  {
204  tmp.index_ = tmp.index_ + signed_one<Dir>() * i;
205  return tmp;
206  }
string tmp
Definition: languages.py:63
template<typename L , typename R , typename D , Direction Dir>
art::const_AssnsIter< L, R, D, Dir > & art::const_AssnsIter< L, R, D, Dir >::operator++ ( )

Definition at line 135 of file AssnsIter.h.

136  {
137  index_ = index_ + signed_one<Dir>();
138  return *this;
139  }
std::size_t index_
Definition: AssnsIter.h:74
template<typename L , typename R , typename D , Direction Dir>
art::const_AssnsIter< L, R, D, Dir > art::const_AssnsIter< L, R, D, Dir >::operator++ ( int  )

Definition at line 144 of file AssnsIter.h.

145  {
147  index_ = index_ + signed_one<Dir>();
148  return tmp;
149  }
string tmp
Definition: languages.py:63
std::size_t index_
Definition: AssnsIter.h:74
template<typename L , typename R , typename D , Direction Dir>
art::const_AssnsIter< L, R, D, Dir > & art::const_AssnsIter< L, R, D, Dir >::operator+= ( std::size_t  i)

Definition at line 190 of file AssnsIter.h.

191  {
192  // to do add check for index bounds and make sure it works for both positive
193  // and negative values
194  index_ = index_ + signed_one<Dir>() * i;
195  return *this;
196  }
std::size_t index_
Definition: AssnsIter.h:74
template<typename L , typename R , typename D , Direction Dir>
art::const_AssnsIter< L, R, D, Dir > art::const_AssnsIter< L, R, D, Dir >::operator- ( std::size_t  i) const

Definition at line 222 of file AssnsIter.h.

223  {
225  tmp.index_ = tmp.index_ - signed_one<Dir>() * i;
226  return tmp;
227  }
string tmp
Definition: languages.py:63
template<typename L , typename R , typename D , Direction Dir>
std::size_t art::const_AssnsIter< L, R, D, Dir >::operator- ( art::const_AssnsIter< L, R, D, Dir > const &  iter1) const

Definition at line 232 of file AssnsIter.h.

234  {
235  return (iter1.index_ - index_);
236  }
std::size_t index_
Definition: AssnsIter.h:74
template<typename L , typename R , typename D , Direction Dir>
art::const_AssnsIter< L, R, D, Dir > & art::const_AssnsIter< L, R, D, Dir >::operator-- ( )

Definition at line 154 of file AssnsIter.h.

155  {
156  index_ = index_ - signed_one<Dir>();
157  return *this;
158  }
std::size_t index_
Definition: AssnsIter.h:74
template<typename L , typename R , typename D , Direction Dir>
art::const_AssnsIter< L, R, D, Dir > art::const_AssnsIter< L, R, D, Dir >::operator-- ( int  )

Definition at line 162 of file AssnsIter.h.

163  {
165  index_ = index_ - signed_one<Dir>();
166  return tmp;
167  }
string tmp
Definition: languages.py:63
std::size_t index_
Definition: AssnsIter.h:74
template<typename L , typename R , typename D , Direction Dir>
art::const_AssnsIter< L, R, D, Dir > & art::const_AssnsIter< L, R, D, Dir >::operator-= ( std::size_t  i)

Definition at line 211 of file AssnsIter.h.

212  {
213  // to do add check for index bounds and make sure it works for both positive
214  // and negative values
215  index_ = index_ - signed_one<Dir>() * i;
216  return *this;
217  }
std::size_t index_
Definition: AssnsIter.h:74
template<typename L , typename R , typename D , Direction Dir>
art::const_AssnsIter< L, R, D, Dir >::pointer art::const_AssnsIter< L, R, D, Dir >::operator-> ( ) const

Definition at line 123 of file AssnsIter.h.

124  {
125  auto const index = index_for_dereferencing<Dir>(index_);
126  node_.first = (*coll_)[index].first;
127  node_.second = (*coll_)[index].second;
128  node_.data = &(coll_->data(index));
129  return &node_;
130  }
std::size_t index_
Definition: AssnsIter.h:74
AssnsNode< L, R, D > node_
Definition: AssnsIter.h:75
art::Assns< L, R, D > const * coll_
Definition: AssnsIter.h:73
template<typename L , typename R , typename D , Direction Dir>
bool art::const_AssnsIter< L, R, D, Dir >::operator< ( art::const_AssnsIter< L, R, D, Dir > const &  iter) const

Definition at line 251 of file AssnsIter.h.

253  {
254  auto const& l = left(*this, iter);
255  auto const& r = right(*this, iter);
256  return l.index_ < r.index_;
257  }
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:102
static QStrList * l
Definition: config.cpp:1044
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:94
template<typename L , typename R , typename D , Direction Dir>
bool art::const_AssnsIter< L, R, D, Dir >::operator<= ( art::const_AssnsIter< L, R, D, Dir > const &  iter) const

Definition at line 262 of file AssnsIter.h.

264  {
265  auto const& l = left(*this, iter);
266  auto const& r = right(*this, iter);
267  return l.index_ <= r.index_;
268  }
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:102
static QStrList * l
Definition: config.cpp:1044
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:94
template<typename L , typename R , typename D , Direction Dir>
bool art::const_AssnsIter< L, R, D, Dir >::operator== ( art::const_AssnsIter< L, R, D, Dir > const &  iter) const

Definition at line 172 of file AssnsIter.h.

174  {
175  return index_ == iter.index_;
176  }
std::size_t index_
Definition: AssnsIter.h:74
template<typename L , typename R , typename D , Direction Dir>
bool art::const_AssnsIter< L, R, D, Dir >::operator> ( art::const_AssnsIter< L, R, D, Dir > const &  iter) const

Definition at line 273 of file AssnsIter.h.

275  {
276  auto const& l = left(*this, iter);
277  auto const& r = right(*this, iter);
278  return l.index_ > r.index_;
279  }
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:102
static QStrList * l
Definition: config.cpp:1044
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:94
template<typename L , typename R , typename D , Direction Dir>
bool art::const_AssnsIter< L, R, D, Dir >::operator>= ( art::const_AssnsIter< L, R, D, Dir > const &  iter) const

Definition at line 284 of file AssnsIter.h.

286  {
287  auto const& l = left(*this, iter);
288  auto const& r = right(*this, iter);
289  return l.index_ >= r.index_;
290  }
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:102
static QStrList * l
Definition: config.cpp:1044
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:94
template<typename L , typename R , typename D , Direction Dir>
art::const_AssnsIter< L, R, D, Dir >::value_type art::const_AssnsIter< L, R, D, Dir >::operator[] ( std::size_t  i) const

Definition at line 241 of file AssnsIter.h.

242  {
244  tmp.index_ = tmp.index_ + signed_one<Dir>() * i;
245  return tmp.node_;
246  }
string tmp
Definition: languages.py:63

Member Data Documentation

template<typename L, typename R, typename D, Direction Dir = Direction::Forward>
art::Assns<L, R, D> const* art::const_AssnsIter< L, R, D, Dir >::coll_ {nullptr}
private

Definition at line 73 of file AssnsIter.h.

template<typename L, typename R, typename D, Direction Dir = Direction::Forward>
std::size_t art::const_AssnsIter< L, R, D, Dir >::index_ {-1ull}
private

Definition at line 74 of file AssnsIter.h.

template<typename L, typename R, typename D, Direction Dir = Direction::Forward>
AssnsNode<L, R, D> art::const_AssnsIter< L, R, D, Dir >::node_ {}
mutableprivate

Definition at line 75 of file AssnsIter.h.


The documentation for this class was generated from the following file: