38template<
typename blContainerType,
39 typename blAdvanceDistanceFunctorType,
40 typename blBeginEndFunctorType>
42class blIterator :
public std::iterator< std::random_access_iterator_tag,
43 typename std::iterator_traits<decltype(blBeginEndFunctorType::begin(std::declval<blContainerType&>()))>::value_type,
44 typename std::iterator_traits<decltype(blBeginEndFunctorType::begin(std::declval<blContainerType&>()))>::difference_type,
45 typename std::iterator_traits<decltype(blBeginEndFunctorType::begin(std::declval<blContainerType&>()))>::pointer,
46 typename std::iterator_traits<decltype(blBeginEndFunctorType::begin(std::declval<blContainerType&>()))>::reference >
52 typedef typename std::iterator_traits<typename blContainerType::iterator>::value_type
blDataType;
53 typedef typename std::iterator_traits<typename blContainerType::iterator>::pointer
blDataTypePtr;
54 typedef typename std::iterator_traits<typename blContainerType::iterator>::reference
blDataTypeRef;
56 typedef decltype(blBeginEndFunctorType::begin(std::declval<blContainerType&>()))
iterator;
136 blAdvanceDistanceFunctorType,
168 explicit operator bool()
const
170 if(this->m_containerPtr)
180 blAdvanceDistanceFunctorType,
188 blAdvanceDistanceFunctorType,
191 auto TempIter(*
this);
199 blAdvanceDistanceFunctorType,
207 blAdvanceDistanceFunctorType,
210 auto TempIter(*
this);
222 blAdvanceDistanceFunctorType,
230 blAdvanceDistanceFunctorType,
238 blAdvanceDistanceFunctorType,
239 blBeginEndFunctorType>
operator+(
const ptrdiff_t& Offset)
const
241 auto NewIter = (*this);
242 NewIter.advance(Offset);
247 blAdvanceDistanceFunctorType,
248 blBeginEndFunctorType>
operator-(
const ptrdiff_t& Offset)
const
250 auto NewIter = (*this);
251 NewIter.advance(-Offset);
265 this->getDistanceFromIterToEnd(),
266 iterator.getDistanceFromIterToEnd());
284 (*this) = this->
begin();
299 (*this) = this->
begin();
314 (*this) = this->
begin();
336 return std::distance(blBeginEndFunctorType::begin(*
m_containerPtr),this->m_ptr);
344 return std::distance(this->m_ptr,blBeginEndFunctorType::end(*
m_containerPtr));
356 blAdvanceDistanceFunctorType,
362 blAdvanceDistanceFunctorType,
363 blBeginEndFunctorType>(blBeginEndFunctorType::begin(*
m_containerPtr),
368 blAdvanceDistanceFunctorType,
373 blAdvanceDistanceFunctorType,
374 blBeginEndFunctorType>
end()
const
379 blAdvanceDistanceFunctorType,
380 blBeginEndFunctorType>(blBeginEndFunctorType::end(*
m_containerPtr),
385 blAdvanceDistanceFunctorType,
425 void advance(
const ptrdiff_t& HowManyStepsToAdvanceIter)
429 blAdvanceDistanceFunctorType::advance(
m_ptr,
430 HowManyStepsToAdvanceIter,
std::shared_ptr< blResourceType > get_shared_ptr(blResourceType &theResource)
std::iterator_traits< typenameblContainerType::iterator >::pointer blDataTypePtr
const blDataTypeRef operator[](const size_t &index) const
blIterator(const blContainerPtr &containerPtr)
blIterator< blContainerType, blAdvanceDistanceFunctorType, blBeginEndFunctorType > end() const
void setContainerPtr(blContainerType &container)
bool operator!=(const blIterator< blContainerType, blAdvanceDistanceFunctorType, blBeginEndFunctorType > &iterator) const
blIterator< blContainerType, blAdvanceDistanceFunctorType, blBeginEndFunctorType > & operator++()
blIterator< blContainerType, blAdvanceDistanceFunctorType, blBeginEndFunctorType > & operator=(const blIterator< blContainerType, blAdvanceDistanceFunctorType, blBeginEndFunctorType > &iterator)=default
blIterator< blContainerType, blAdvanceDistanceFunctorType, blBeginEndFunctorType > & operator--()
std::iterator_traits< typenameblContainerType::iterator >::value_type blDataType
ptrdiff_t getDistanceFromBeginToIter() const
std::iterator_traits< typenameblContainerType::iterator >::reference blDataTypeRef
blIterator< blContainerType, blAdvanceDistanceFunctorType, blBeginEndFunctorType > operator-(const ptrdiff_t &Offset) const
decltype(blBeginEndFunctorType::begin(std::declval< blContainerType & >())) iterator
blDataTypeRef operator[](const size_t &index)
blIterator< blContainerType, blAdvanceDistanceFunctorType, blBeginEndFunctorType > & operator+=(const ptrdiff_t &Offset)
bool operator==(const blIterator< blContainerType, blAdvanceDistanceFunctorType, blBeginEndFunctorType > &iterator) const
ptrdiff_t operator-(const blIterator< blContainerType, blAdvanceDistanceFunctorType, blBeginEndFunctorType > &iterator) const
ptrdiff_t getDistanceFromIterToEnd() const
blIterator< blContainerType, blAdvanceDistanceFunctorType, blBeginEndFunctorType > begin() const
void setContainerPtr(const blContainerType &container)
blIterator< blContainerType, blAdvanceDistanceFunctorType, blBeginEndFunctorType > & operator-=(const ptrdiff_t &Offset)
void setContainerPtr(blContainerType *rawContainerPtr)
std::shared_ptr< blContainerType > blContainerPtr
blContainerPtr m_containerPtr
const iterator & getPtr() const
const blDataTypeRef operator*() const
blIterator(blContainerType &container)
void advance(const ptrdiff_t &HowManyStepsToAdvanceIter)
blIterator< blContainerType, blAdvanceDistanceFunctorType, blBeginEndFunctorType > operator+(const ptrdiff_t &Offset) const
blIterator(blContainerType *containerPtr)
blIterator(const blIterator< blContainerType, blAdvanceDistanceFunctorType, blBeginEndFunctorType > &)=default
const blContainerPtr & getContainerPtr() const
blIterator(blIterator< blContainerType, blAdvanceDistanceFunctorType, blBeginEndFunctorType > &&)=default
blIterator< blContainerType, blAdvanceDistanceFunctorType, blBeginEndFunctorType > operator--(int)
blIterator< blContainerType, blAdvanceDistanceFunctorType, blBeginEndFunctorType > operator++(int)
blDataTypeRef operator*()
blIterator(const iterator &ptr, const blContainerPtr &containerPtr)