31#if defined(IndexedListWithBlocks_RECURSES)
32#error Recursive header files inclusion detected in IndexedListWithBlocks.h
35#define IndexedListWithBlocks_RECURSES
37#if !defined IndexedListWithBlocks_h
39#define IndexedListWithBlocks_h
45#include "DGtal/base/Common.h"
92 template <
typename TValue,
unsigned int N,
unsigned int M>
147 ASSERT( idx <=
size );
152 else if (
size == (N+1) )
154 ASSERT( idx <=
size );
199 ASSERT( idx <
size );
200 if (
size <= ( N + 1 ) )
206 else if (
size == N + 2 )
256 ASSERT( idx <=
size );
270 if (
size < ( M - 1) )
722 template <
typename TValue,
unsigned int N,
unsigned int M>
732#include "DGtal/base/IndexedListWithBlocks.ih"
739#undef IndexedListWithBlocks_RECURSES
bool operator!=(const Self &other) const
ConstIterator(const ConstIterator &other)
std::forward_iterator_tag iterator_category
Pointer operator->() const
DifferenceType difference_type
ConstIterator(const FirstBlock &block, unsigned int idx)
std::ptrdiff_t DifferenceType
only positive offsets allowed.
const AnyBlock * myNext
pointer to next block or 0 if last block.
Self & operator=(const Self &other)
bool operator==(const Self &other) const
const Value * myValues
array of myNbValues values.
unsigned int myIdx
current index in myValues of the iterator
unsigned int myNbValues
number of valid values in array myValues
Reference operator*() const
Reference operator[](DifferenceType n) const
Self & operator+=(DifferenceType n)
unsigned int myIdx
current index in myValues of the iterator
std::forward_iterator_tag iterator_category
DifferenceType difference_type
Value * myValues
array of myNbValues values.
AnyBlock * myNext
pointer to next block or 0 if last block.
bool operator==(const Self &other) const
Iterator(const Iterator &other)
std::ptrdiff_t DifferenceType
only positive offsets allowed.
unsigned int myNbValues
number of valid values in array myValues
Pointer operator->() const
Reference operator*() const
Self & operator=(const Self &other)
Self & operator+=(DifferenceType n)
Iterator(FirstBlock &block, unsigned int idx)
Reference operator[](DifferenceType n) const
bool operator!=(const Self &other) const
Aim: Represents a mixed list/array structure which is useful in some context. It is essentially a lis...
void insert(unsigned int idx, const Value &value)
BOOST_STATIC_ASSERT(N >=1)
IndexedListWithBlocks & operator=(const IndexedListWithBlocks &other)
SizeType max_size() const
void erase(unsigned int idx)
const Value & ConstReference
ConstReference const_reference
ConstPointer const_pointer
const Value & operator[](unsigned int idx) const
std::ptrdiff_t DifferenceType
DifferenceType difference_type
BOOST_STATIC_ASSERT(M >=2)
IndexedListWithBlocks(const IndexedListWithBlocks &other)
ConstIterator begin() const
ConstIterator const_iterator
Value & operator[](unsigned int idx)
ConstIterator end() const
SizeType capacity() const
void selfDisplay(std::ostream &out) const
const Value * ConstPointer
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
AnyBlock * erase(unsigned int idx, unsigned int size)
void insert(unsigned int idx, unsigned int size, const Value &v)
void erase(unsigned int idx)
void insert(unsigned int idx, const Value &v)
Used in blocks to finish it or to point to the next block.