mCRL2
Loading...
Searching...
No Matches
mcrl2::lts::detail::bisim_dnj::simple_list< T > Class Template Reference

a simple implementation of lists More...

#include <liblts_bisim_dnj.h>

Classes

class  const_iterator
 constant iterator class for simple_list More...
 
class  empty_entry
 empty entry, used for the sentinel More...
 
class  entry
 list entry More...
 
class  iterator
 iterator class for simple_list More...
 
class  iterator_or_null
 class that stores either an iterator or a null value More...
 

Public Member Functions

 simple_list ()
 constructor
 
iterator begin ()
 return an iterator to the first element of the list
 
iterator end ()
 return an iterator past the last element of the list
 
const_iterator cbegin () const
 return a constant iterator to the first element of the list
 
const_iterator cend () const
 return a constant iterator past the last element of the list
 
const_iterator begin () const
 return a constant iterator to the first element of the list
 
const_iterator end () const
 return a constant iterator past the last element of the list
 
T & front ()
 return a reference to the first element of the list
 
T & back ()
 return a reference to the last element of the list
 
bool empty () const
 return true iff the list is empty
 
template<class... Args>
iterator emplace_front (Args &&... args)
 construct a new list entry at the beginning
 
template<class... Args>
iterator emplace_back (Args &&... args)
 construct a new list entry at the end
 

Static Public Member Functions

template<class... Args>
static iterator emplace (iterator pos, Args &&... args)
 construct a new list entry before pos
 
template<class... Args>
static iterator emplace_after (iterator pos, Args &&... args)
 construct a new list entry after pos
 
static void splice (iterator const new_pos, simple_list &, iterator const old_pos)
 move a list entry from one position to another (possibly in a different list)
 
static void erase (iterator const pos)
 erase an element from a list
 

Private Attributes

empty_entry sentinel
 sentinel, i.e. element that provides pointers to the beginning and the end of the list
 

Detailed Description

template<class T>
class mcrl2::lts::detail::bisim_dnj::simple_list< T >

a simple implementation of lists

This class simplifies lists: It assumes that list entries are trivially destructible, and it does not store the size of a list. Therefore, the destructor, erase() and splice() can be simplified. Also, the simple_list object itself is trivially destructible if the pool allocator is used; therefore, destroying a block_t object becomes trivial as well.

Definition at line 396 of file liblts_bisim_dnj.h.

Constructor & Destructor Documentation

◆ simple_list()

template<class T >
mcrl2::lts::detail::bisim_dnj::simple_list< T >::simple_list ( )
inline

constructor

Definition at line 564 of file liblts_bisim_dnj.h.

Member Function Documentation

◆ back()

template<class T >
T & mcrl2::lts::detail::bisim_dnj::simple_list< T >::back ( )
inline

return a reference to the last element of the list

Definition at line 607 of file liblts_bisim_dnj.h.

◆ begin() [1/2]

template<class T >
iterator mcrl2::lts::detail::bisim_dnj::simple_list< T >::begin ( )
inline

return an iterator to the first element of the list

Definition at line 583 of file liblts_bisim_dnj.h.

◆ begin() [2/2]

template<class T >
const_iterator mcrl2::lts::detail::bisim_dnj::simple_list< T >::begin ( ) const
inline

return a constant iterator to the first element of the list

Definition at line 595 of file liblts_bisim_dnj.h.

◆ cbegin()

template<class T >
const_iterator mcrl2::lts::detail::bisim_dnj::simple_list< T >::cbegin ( ) const
inline

return a constant iterator to the first element of the list

Definition at line 589 of file liblts_bisim_dnj.h.

◆ cend()

template<class T >
const_iterator mcrl2::lts::detail::bisim_dnj::simple_list< T >::cend ( ) const
inline

return a constant iterator past the last element of the list

Definition at line 592 of file liblts_bisim_dnj.h.

◆ emplace()

template<class T >
template<class... Args>
static iterator mcrl2::lts::detail::bisim_dnj::simple_list< T >::emplace ( iterator  pos,
Args &&...  args 
)
inlinestatic

construct a new list entry before pos

Definition at line 617 of file liblts_bisim_dnj.h.

◆ emplace_after()

template<class T >
template<class... Args>
static iterator mcrl2::lts::detail::bisim_dnj::simple_list< T >::emplace_after ( iterator  pos,
Args &&...  args 
)
inlinestatic

construct a new list entry after pos

Definition at line 635 of file liblts_bisim_dnj.h.

◆ emplace_back()

template<class T >
template<class... Args>
iterator mcrl2::lts::detail::bisim_dnj::simple_list< T >::emplace_back ( Args &&...  args)
inline

construct a new list entry at the end

Definition at line 671 of file liblts_bisim_dnj.h.

◆ emplace_front()

template<class T >
template<class... Args>
iterator mcrl2::lts::detail::bisim_dnj::simple_list< T >::emplace_front ( Args &&...  args)
inline

construct a new list entry at the beginning

Definition at line 653 of file liblts_bisim_dnj.h.

◆ empty()

template<class T >
bool mcrl2::lts::detail::bisim_dnj::simple_list< T >::empty ( ) const
inline

return true iff the list is empty

Definition at line 613 of file liblts_bisim_dnj.h.

◆ end() [1/2]

template<class T >
iterator mcrl2::lts::detail::bisim_dnj::simple_list< T >::end ( )
inline

return an iterator past the last element of the list

Definition at line 586 of file liblts_bisim_dnj.h.

◆ end() [2/2]

template<class T >
const_iterator mcrl2::lts::detail::bisim_dnj::simple_list< T >::end ( ) const
inline

return a constant iterator past the last element of the list

Definition at line 598 of file liblts_bisim_dnj.h.

◆ erase()

template<class T >
static void mcrl2::lts::detail::bisim_dnj::simple_list< T >::erase ( iterator const  pos)
inlinestatic

erase an element from a list

Definition at line 703 of file liblts_bisim_dnj.h.

◆ front()

template<class T >
T & mcrl2::lts::detail::bisim_dnj::simple_list< T >::front ( )
inline

return a reference to the first element of the list

Definition at line 601 of file liblts_bisim_dnj.h.

◆ splice()

template<class T >
static void mcrl2::lts::detail::bisim_dnj::simple_list< T >::splice ( iterator const  new_pos,
simple_list< T > &  ,
iterator const  old_pos 
)
inlinestatic

move a list entry from one position to another (possibly in a different list)

Definition at line 689 of file liblts_bisim_dnj.h.

Member Data Documentation

◆ sentinel

template<class T >
empty_entry mcrl2::lts::detail::bisim_dnj::simple_list< T >::sentinel
private

sentinel, i.e. element that provides pointers to the beginning and the end of the list

Definition at line 419 of file liblts_bisim_dnj.h.


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