CACAO
Data Structures | Public Types | Public Member Functions | Private Types | Private Attributes | Friends
cacao::ordered_list< T, Allocator > Class Template Reference

An ordered_list is an indexed sequence container. More...

Data Structures

struct  DecrementEntry
 Decrement function struct. More...
 
struct  Entry
 tagged list entry More...
 
struct  IncreasingEntry
 Increasing function struct. More...
 
struct  IncrementEntry
 Increment function struct. More...
 
struct  Inserter
 Inserter. More...
 

Public Types

typedef T value_type
 
typedef Allocator allocator_type
 
typedef allocator_type::reference reference
 
typedef
allocator_type::const_reference 
const_reference
 
typedef allocator_type::pointer pointer
 
typedef
allocator_type::const_pointer 
const_pointer
 
typedef _ordered_iterator< T,
Allocator, intern_list
iterator
 
typedef
_ordered_const_iterator< T,
Allocator, intern_list
const_iterator
 
typedef std::reverse_iterator
< iterator
reverse_iterator
 
typedef std::reverse_iterator
< const_iterator
const_reverse_iterator
 

Public Member Functions

 ordered_list ()
 construct an empty MachineBasicBlock More...
 
 ordered_list (const ordered_list< T, Allocator > &other)
 copy constructor More...
 
ordered_listoperator= (const ordered_list< T, Allocator > &other)
 copy assignment operator More...
 
bool empty () const
 checks if the container has no elements. More...
 
std::size_t size () const
 returns the number of elements More...
 
std::size_t max_size () const
 returns the maximum possible number of elements More...
 
void push_back (const T &value)
 Appends the given element value to the end of the container. More...
 
void push_front (const T &value)
 inserts value to the beginning More...
 
iterator insert (iterator pos, const T &value)
 inserts value before the element pointed to by pos More...
 
template<class InputIt >
void insert (iterator pos, InputIt first, InputIt last)
 inserts elements from range [first, last) before the element pointed to by pos More...
 
iterator erase (iterator pos)
 erases element More...
 
iterator erase (iterator first, iterator last)
 erases elements More...
 
iterator begin ()
 returns an iterator to the beginning More...
 
iterator end ()
 returns an iterator to the end More...
 
const_iterator begin () const
 returns a const_iterator to the beginning More...
 
const_iterator end () const
 returns a const_iterator to the end More...
 
reverse_iterator rbegin ()
 returns a reverse iterator to the beginning More...
 
reverse_iterator rend ()
 returns a reverse iterator to the end More...
 
const_reverse_iterator rbegin () const
 returns a const reverse iterator to the beginning More...
 
const_reverse_iterator rend () const
 returns a const reverse iterator to the end More...
 
const_reference front () const
 access the first element More...
 
const_reference back () const
 access the last element More...
 
reference front ()
 access the first element More...
 
reference back ()
 access the last element More...
 
void clear ()
 removes all elements from the container More...
 
void swap (ordered_list< T, Allocator > &other)
 exchanges the contents of the container with those of other More...
 
template<class InputIt >
void insert (typename ordered_list< T, Allocator >::iterator pos, InputIt first, InputIt last)
 

Private Types

typedef std::list< Entry,
typename Allocator::template
rebind< Entry >::other > 
intern_list
 
typedef intern_list::iterator intern_iterator
 

Private Attributes

intern_list list
 internal storage More...
 

Friends

template<class _T , class _Allocator >
bool operator== (const ordered_list< _T, _Allocator > &lhs, const ordered_list< _T, _Allocator > &rhs)
 
template<class _T , class _Allocator >
bool operator== (const typename ordered_list< _T, _Allocator >::Entry &lhs, const typename ordered_list< _T, _Allocator >::Entry &rhs)
 

Detailed Description

template<class T, class Allocator = std::allocator<T>>
class cacao::ordered_list< T, Allocator >

An ordered_list is an indexed sequence container.

It shares most characteristics with a std::list with the difference that its iterators are more powerful. In addition the features of bidirectional iterators the total ordering relation is supported (hence the name ordered_list).

Like std::list it supports constant time insertion and removal of elements anywhere. Additionally those operations do not invalidate iterators.

ordered_list meets the requirement of Container, AllocatorAwareContainer, SequenceContainer, ReversibleContainer.

Todo:
not all methods are implemented yet!

Definition at line 55 of file ordered_list.hpp.

Member Typedef Documentation

template<class T, class Allocator = std::allocator<T>>
typedef Allocator cacao::ordered_list< T, Allocator >::allocator_type

Definition at line 106 of file ordered_list.hpp.

template<class T, class Allocator = std::allocator<T>>
typedef _ordered_const_iterator<T, Allocator, intern_list > cacao::ordered_list< T, Allocator >::const_iterator

Definition at line 112 of file ordered_list.hpp.

template<class T, class Allocator = std::allocator<T>>
typedef allocator_type::const_pointer cacao::ordered_list< T, Allocator >::const_pointer

Definition at line 110 of file ordered_list.hpp.

template<class T, class Allocator = std::allocator<T>>
typedef allocator_type::const_reference cacao::ordered_list< T, Allocator >::const_reference

Definition at line 108 of file ordered_list.hpp.

template<class T, class Allocator = std::allocator<T>>
typedef std::reverse_iterator<const_iterator> cacao::ordered_list< T, Allocator >::const_reverse_iterator

Definition at line 114 of file ordered_list.hpp.

template<class T, class Allocator = std::allocator<T>>
typedef intern_list::iterator cacao::ordered_list< T, Allocator >::intern_iterator
private

Definition at line 59 of file ordered_list.hpp.

template<class T, class Allocator = std::allocator<T>>
typedef std::list<Entry,typename Allocator::template rebind<Entry>::other> cacao::ordered_list< T, Allocator >::intern_list
private

Definition at line 57 of file ordered_list.hpp.

template<class T, class Allocator = std::allocator<T>>
typedef _ordered_iterator<T, Allocator, intern_list > cacao::ordered_list< T, Allocator >::iterator

Definition at line 111 of file ordered_list.hpp.

template<class T, class Allocator = std::allocator<T>>
typedef allocator_type::pointer cacao::ordered_list< T, Allocator >::pointer

Definition at line 109 of file ordered_list.hpp.

template<class T, class Allocator = std::allocator<T>>
typedef allocator_type::reference cacao::ordered_list< T, Allocator >::reference

Definition at line 107 of file ordered_list.hpp.

template<class T, class Allocator = std::allocator<T>>
typedef std::reverse_iterator<iterator> cacao::ordered_list< T, Allocator >::reverse_iterator

Definition at line 113 of file ordered_list.hpp.

template<class T, class Allocator = std::allocator<T>>
typedef T cacao::ordered_list< T, Allocator >::value_type

Definition at line 105 of file ordered_list.hpp.

Constructor & Destructor Documentation

template<class T, class Allocator = std::allocator<T>>
cacao::ordered_list< T, Allocator >::ordered_list ( )
inline

construct an empty MachineBasicBlock

Definition at line 117 of file ordered_list.hpp.

template<class T, class Allocator = std::allocator<T>>
cacao::ordered_list< T, Allocator >::ordered_list ( const ordered_list< T, Allocator > &  other)
inline

copy constructor

Definition at line 119 of file ordered_list.hpp.

Member Function Documentation

template<class T , class Allocator >
ordered_list< T, Allocator >::const_reference cacao::ordered_list< T, Allocator >::back ( ) const
inline

access the last element

Definition at line 424 of file ordered_list.hpp.

template<class T , class Allocator >
ordered_list< T, Allocator >::reference cacao::ordered_list< T, Allocator >::back ( )
inline

access the last element

Definition at line 414 of file ordered_list.hpp.

template<class T , class Allocator >
ordered_list< T, Allocator >::iterator cacao::ordered_list< T, Allocator >::begin ( )
inline

returns an iterator to the beginning

Definition at line 362 of file ordered_list.hpp.

template<class T , class Allocator >
ordered_list< T, Allocator >::const_iterator cacao::ordered_list< T, Allocator >::begin ( ) const
inline

returns a const_iterator to the beginning

Definition at line 368 of file ordered_list.hpp.

template<class T , class Allocator >
void cacao::ordered_list< T, Allocator >::clear ( )
inline

removes all elements from the container

Definition at line 428 of file ordered_list.hpp.

template<class T , class Allocator >
bool cacao::ordered_list< T, Allocator >::empty ( ) const
inline

checks if the container has no elements.

Definition at line 297 of file ordered_list.hpp.

template<class T , class Allocator >
ordered_list< T, Allocator >::iterator cacao::ordered_list< T, Allocator >::end ( )
inline

returns an iterator to the end

Definition at line 373 of file ordered_list.hpp.

template<class T , class Allocator >
ordered_list< T, Allocator >::const_iterator cacao::ordered_list< T, Allocator >::end ( ) const
inline

returns a const_iterator to the end

Definition at line 379 of file ordered_list.hpp.

template<class T, class Allocator = std::allocator<T>>
iterator cacao::ordered_list< T, Allocator >::erase ( iterator  pos)

erases element

template<class T, class Allocator = std::allocator<T>>
iterator cacao::ordered_list< T, Allocator >::erase ( iterator  first,
iterator  last 
)

erases elements

template<class T , class Allocator >
ordered_list< T, Allocator >::const_reference cacao::ordered_list< T, Allocator >::front ( ) const
inline

access the first element

Definition at line 419 of file ordered_list.hpp.

template<class T , class Allocator >
ordered_list< T, Allocator >::reference cacao::ordered_list< T, Allocator >::front ( )
inline

access the first element

Definition at line 409 of file ordered_list.hpp.

template<class T, class Allocator = std::allocator<T>>
iterator cacao::ordered_list< T, Allocator >::insert ( iterator  pos,
const T &  value 
)

inserts value before the element pointed to by pos

template<class T, class Allocator = std::allocator<T>>
template<class InputIt >
void cacao::ordered_list< T, Allocator >::insert ( iterator  pos,
InputIt  first,
InputIt  last 
)

inserts elements from range [first, last) before the element pointed to by pos

template<class T, class Allocator = std::allocator<T>>
template<class InputIt >
void cacao::ordered_list< T, Allocator >::insert ( typename ordered_list< T, Allocator >::iterator  pos,
InputIt  first,
InputIt  last 
)
inline

Definition at line 333 of file ordered_list.hpp.

template<class T , class Allocator >
std::size_t cacao::ordered_list< T, Allocator >::max_size ( ) const
inline

returns the maximum possible number of elements

Definition at line 307 of file ordered_list.hpp.

template<class T, class Allocator>
ordered_list< T, Allocator > & cacao::ordered_list< T, Allocator >::operator= ( const ordered_list< T, Allocator > &  other)
inline

copy assignment operator

Definition at line 291 of file ordered_list.hpp.

template<class T, class Allocator >
void cacao::ordered_list< T, Allocator >::push_back ( const T &  value)
inline

Appends the given element value to the end of the container.

Definition at line 312 of file ordered_list.hpp.

template<class T, class Allocator >
void cacao::ordered_list< T, Allocator >::push_front ( const T &  value)
inline

inserts value to the beginning

Definition at line 317 of file ordered_list.hpp.

template<class T , class Allocator >
ordered_list< T, Allocator >::reverse_iterator cacao::ordered_list< T, Allocator >::rbegin ( )
inline

returns a reverse iterator to the beginning

Definition at line 385 of file ordered_list.hpp.

template<class T , class Allocator >
ordered_list< T, Allocator >::const_reverse_iterator cacao::ordered_list< T, Allocator >::rbegin ( ) const
inline

returns a const reverse iterator to the beginning

Definition at line 397 of file ordered_list.hpp.

template<class T , class Allocator >
ordered_list< T, Allocator >::reverse_iterator cacao::ordered_list< T, Allocator >::rend ( )
inline

returns a reverse iterator to the end

Definition at line 391 of file ordered_list.hpp.

template<class T , class Allocator >
ordered_list< T, Allocator >::const_reverse_iterator cacao::ordered_list< T, Allocator >::rend ( ) const
inline

returns a const reverse iterator to the end

Definition at line 403 of file ordered_list.hpp.

template<class T , class Allocator >
std::size_t cacao::ordered_list< T, Allocator >::size ( ) const
inline

returns the number of elements

Definition at line 302 of file ordered_list.hpp.

template<class T, class Allocator>
void cacao::ordered_list< T, Allocator >::swap ( ordered_list< T, Allocator > &  other)
inline

exchanges the contents of the container with those of other

Definition at line 433 of file ordered_list.hpp.

Friends And Related Function Documentation

template<class T, class Allocator = std::allocator<T>>
template<class _T , class _Allocator >
bool operator== ( const ordered_list< _T, _Allocator > &  lhs,
const ordered_list< _T, _Allocator > &  rhs 
)
friend
template<class T, class Allocator = std::allocator<T>>
template<class _T , class _Allocator >
bool operator== ( const typename ordered_list< _T, _Allocator >::Entry lhs,
const typename ordered_list< _T, _Allocator >::Entry rhs 
)
friend

Field Documentation

template<class T, class Allocator = std::allocator<T>>
intern_list cacao::ordered_list< T, Allocator >::list
private

internal storage

Definition at line 102 of file ordered_list.hpp.


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