mCRL2
|
A list of aterm objects. More...
#include <aterm_list.h>
Public Types | |
typedef Term | value_type |
The type of object, T stored in the term_list. | |
typedef Term * | pointer |
Pointer to T. | |
typedef Term & | reference |
Reference to T. | |
typedef const Term & | const_reference |
Const reference to T. | |
typedef std::size_t | size_type |
An unsigned integral type. | |
typedef ptrdiff_t | difference_type |
A signed integral type. | |
typedef term_list_iterator< Term > | iterator |
Iterator used to iterate through an term_list. | |
typedef term_list_iterator< Term > | const_iterator |
Const iterator used to iterate through an term_list. | |
typedef reverse_term_list_iterator< Term > | const_reverse_iterator |
Const iterator used to iterate through an term_list. | |
Public Member Functions | |
term_list () noexcept | |
Default constructor. Creates an empty list. | |
term_list (const aterm &t) noexcept | |
Constructor from an aterm. | |
term_list (const term_list< Term > &t) noexcept | |
Copy constructor. | |
term_list (term_list< Term > &&t) noexcept | |
Move constructor. | |
term_list & | operator= (const term_list &other) noexcept=default |
This class has user-declared copy constructor so declare copy and move assignment. | |
term_list & | operator= (term_list &&other) noexcept=default |
template<class Iter > | |
term_list (Iter first, Iter last, typename std::enable_if< std::is_base_of< std::bidirectional_iterator_tag, typename std::iterator_traits< Iter >::iterator_category >::value >::type *=nullptr) | |
Creates a term_list with the elements from first to last. | |
template<class Iter , class ATermConverter > | |
term_list (Iter first, Iter last, const ATermConverter &convert_to_aterm, typename std::enable_if< std::is_base_of< std::bidirectional_iterator_tag, typename std::iterator_traits< Iter >::iterator_category >::value >::type *=0) | |
Creates a term_list with the elements from first to last converting the elements before inserting. | |
template<class Iter , class ATermConverter , class ATermFilter > | |
term_list (Iter first, Iter last, const ATermConverter &convert_to_aterm, const ATermFilter &aterm_filter, typename std::enable_if< std::is_base_of< std::bidirectional_iterator_tag, typename std::iterator_traits< Iter >::iterator_category >::value >::type *=0) | |
Creates a term_list with the elements from first to last, converting and filtering the list. | |
template<class Iter > | |
term_list (Iter first, Iter last, typename std::enable_if< !std::is_base_of< std::bidirectional_iterator_tag, typename std::iterator_traits< Iter >::iterator_category >::value >::type *=nullptr) | |
Creates a term_list from the elements from first to last. | |
template<class Iter , class ATermConverter > | |
term_list (Iter first, Iter last, const ATermConverter &convert_to_aterm, typename std::enable_if< !std::is_base_of< std::bidirectional_iterator_tag, typename std::iterator_traits< Iter >::iterator_category >::value >::type *=nullptr) | |
Creates a term_list from the elements from first to last converting the elements before inserting. | |
template<class Iter , class ATermConverter , class ATermFilter > | |
term_list (Iter first, Iter last, const ATermConverter &convert_to_aterm, const ATermFilter &aterm_filter, typename std::enable_if< !std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< Iter >::iterator_category >::value >::type *=nullptr) | |
Creates a term_list from the elements from first to last converting and filtering the elements before inserting. | |
term_list (std::initializer_list< Term > init) | |
A constructor based on an initializer list. | |
const term_list< Term > & | tail () const |
Returns the tail of the list. | |
void | pop_front () |
Removes the first element of the list. | |
const Term & | front () const |
Returns the first element of the list. | |
void | push_front (const Term &el) |
Inserts a new element at the beginning of the current list. | |
template<typename ... Args> | |
void | emplace_front (Args &&... arguments) |
Construct and insert a new element at the beginning of the current list. | |
size_type | size () const |
Returns the size of the term_list. | |
bool | empty () const |
Returns true if the list's size is 0. | |
const_iterator | begin () const |
Returns a const_iterator pointing to the beginning of the term_list. | |
const_iterator | end () const |
Returns a const_iterator pointing to the end of the term_list. | |
const_reverse_iterator | rbegin () const |
Returns a const_reverse_iterator pointing to the end of the term_list. | |
const_reverse_iterator | rend () const |
Returns a const_iterator pointing to the end of the term_list. | |
size_type | max_size () const |
Returns the largest possible size of the term_list. | |
![]() | |
aterm () noexcept | |
Default constructor. | |
~aterm () noexcept | |
Standard destructor. | |
aterm (const detail::_aterm *t) noexcept | |
Constructor based on an internal term data structure. This is not for public use. | |
aterm (const aterm &other) noexcept | |
Copy constructor. | |
aterm (aterm &&other) noexcept | |
Move constructor. | |
aterm & | operator= (const aterm &other) noexcept |
Assignment operator. | |
aterm & | assign (const aterm &other, detail::thread_aterm_pool &pool) noexcept |
Assignment operator, to be used if busy and forbidden flags are explicitly available. | |
template<bool CHECK_BUSY_FLAG = true> | |
aterm & | unprotected_assign (const aterm &other) noexcept |
Assignment operator, to be used when the busy flags do not need to be set. | |
aterm & | operator= (aterm &&other) noexcept |
Move assignment operator. | |
![]() | |
unprotected_aterm () noexcept | |
Default constuctor. | |
unprotected_aterm (const detail::_aterm *term) noexcept | |
Constructor. | |
bool | type_is_appl () const noexcept |
Dynamic check whether the term is an aterm_appl. | |
bool | type_is_int () const noexcept |
Dynamic check whether the term is an aterm_int. | |
bool | type_is_list () const noexcept |
Dynamic check whether the term is an aterm_list. | |
bool | operator== (const unprotected_aterm &t) const |
Comparison operator. | |
bool | operator!= (const unprotected_aterm &t) const |
Inequality operator on two unprotected aterms. | |
bool | operator< (const unprotected_aterm &t) const |
Comparison operator for two unprotected aterms. | |
bool | operator> (const unprotected_aterm &t) const |
Comparison operator for two unprotected aterms. | |
bool | operator<= (const unprotected_aterm &t) const |
Comparison operator for two unprotected aterms. | |
bool | operator>= (const unprotected_aterm &t) const |
Comparison operator for two unprotected aterms. | |
bool | defined () const |
Returns true if this term is not equal to the term assigned by the default constructor of aterms, term_appl<T>'s and aterm_int. | |
void | swap (unprotected_aterm &t) noexcept |
Swaps this term with its argument. | |
const function_symbol & | function () const |
Yields the function symbol in an aterm. | |
Protected Member Functions | |
term_list (detail::_aterm *t) noexcept | |
Constructor for term lists from internally constructed terms delivered as reference. | |
Additional Inherited Members | |
![]() | |
const detail::_aterm * | m_term |
A list of aterm objects.
Definition at line 22 of file aterm_list.h.
typedef term_list_iterator<Term> atermpp::term_list< Term >::const_iterator |
Const iterator used to iterate through an term_list.
Definition at line 54 of file aterm_list.h.
typedef const Term& atermpp::term_list< Term >::const_reference |
Const reference to T.
Definition at line 42 of file aterm_list.h.
typedef reverse_term_list_iterator<Term> atermpp::term_list< Term >::const_reverse_iterator |
Const iterator used to iterate through an term_list.
Definition at line 57 of file aterm_list.h.
typedef ptrdiff_t atermpp::term_list< Term >::difference_type |
A signed integral type.
Definition at line 48 of file aterm_list.h.
typedef term_list_iterator<Term> atermpp::term_list< Term >::iterator |
Iterator used to iterate through an term_list.
Definition at line 51 of file aterm_list.h.
typedef Term* atermpp::term_list< Term >::pointer |
Pointer to T.
Definition at line 36 of file aterm_list.h.
typedef Term& atermpp::term_list< Term >::reference |
Reference to T.
Definition at line 39 of file aterm_list.h.
typedef std::size_t atermpp::term_list< Term >::size_type |
An unsigned integral type.
Definition at line 45 of file aterm_list.h.
typedef Term atermpp::term_list< Term >::value_type |
The type of object, T stored in the term_list.
Definition at line 33 of file aterm_list.h.
|
inlineexplicitprotectednoexcept |
Constructor for term lists from internally constructed terms delivered as reference.
Definition at line 26 of file aterm_list.h.
|
inlinenoexcept |
Default constructor. Creates an empty list.
Definition at line 60 of file aterm_list.h.
|
inlineexplicitnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineexplicit |
Creates a term_list with the elements from first to last.
It is assumed that the range can be traversed from last to first.
first | The start of a range of elements. |
last | The end of a range of elements. |
Definition at line 98 of file aterm_list.h.
|
inlineexplicit |
Creates a term_list with the elements from first to last converting the elements before inserting.
It is assumed that the range can be traversed from last to first. The operator () in the class ATermConverter is applied to each element before inserting it in the list.
first | The start of a range of elements. |
last | The end of a range of elements. |
convert_to_aterm | A class with a () operation, which is applied to each element before it is put into the list. |
Definition at line 116 of file aterm_list.h.
|
inlineexplicit |
Creates a term_list with the elements from first to last, converting and filtering the list.
It is assumed that the range can be traversed from last to first. The operator () in the class ATermConverter is applied to each element before inserting it in the list. Elements are only inserted if the operator () of the class ATermFilter yields true when applied to such an element.
first | The start of a range of elements. |
last | The end of a range of elements. |
convert_to_aterm | A class with a () operation, which is applied to each element before it is put into the list. |
aterm_filter | A class with an operator () that is used to determine whether elements can be inserted in the list. |
Definition at line 136 of file aterm_list.h.
|
inlineexplicit |
Creates a term_list from the elements from first to last.
The range is traversed from first to last. This requires to copy the elements internally, which is less efficient than this function with random access iterators as arguments.
first | The start of a range of elements. |
last | The end of a range of elements. |
Definition at line 153 of file aterm_list.h.
|
inlineexplicit |
Creates a term_list from the elements from first to last converting the elements before inserting.
The range is traversed from first to last. This requires to copy the elements internally, which is less efficient than this function with random access iterators as arguments. The operator () in the class ATermConverter is applied to each element before inserting it in the list.
first | The start of a range of elements. |
last | The end of a range of elements. |
convert_to_aterm | A class with a () operation, whic is applied to each element before it is put into the list. |
Definition at line 175 of file aterm_list.h.
|
inlineexplicit |
Creates a term_list from the elements from first to last converting and filtering the elements before inserting.
The range is traversed from first to last. This requires to copy the elements internally, which is less efficient than this function with random access iterators as arguments. The operator () in the class ATermConverter is applied to each element before inserting it in the list. Elements are only inserted if the operator () of the class ATermFilter yields true when applied to such an element.
first | The start of a range of elements. |
last | The end of a range of elements. |
convert_to_aterm | A class with a () operation, whic is applied to each element before it is put into the list. |
aterm_filter | A class with an operator () that is used to determine whether elements can be inserted in the list. |
Definition at line 199 of file aterm_list.h.
|
inline |
A constructor based on an initializer list.
This constructor is not made explicit to conform to initializer lists in standard containers.
init | The initialiser list. |
Definition at line 213 of file aterm_list.h.
|
inline |
Returns a const_iterator pointing to the beginning of the term_list.
Definition at line 274 of file aterm_list.h.
void atermpp::term_list< Term >::emplace_front | ( | Args &&... | arguments | ) |
Construct and insert a new element at the beginning of the current list.
el | The term that is added. |
Definition at line 37 of file aterm_list_implementation.h.
|
inline |
Returns true if the list's size is 0.
Definition at line 267 of file aterm_list.h.
|
inline |
Returns a const_iterator pointing to the end of the term_list.
Definition at line 281 of file aterm_list.h.
|
inline |
Returns the first element of the list.
Definition at line 238 of file aterm_list.h.
|
inline |
Returns the largest possible size of the term_list.
Definition at line 303 of file aterm_list.h.
|
defaultnoexcept |
This class has user-declared copy constructor so declare copy and move assignment.
|
defaultnoexcept |
|
inline |
Removes the first element of the list.
Definition at line 231 of file aterm_list.h.
void atermpp::term_list< Term >::push_front | ( | const Term & | el | ) |
Inserts a new element at the beginning of the current list.
The length of a short list. If lists are short the stack can be used for temporary data. Otherwise the heap must be used to avoid stack overflow. The chosen value is rather arbitrary.
el | The term that is added. |
Definition at line 30 of file aterm_list_implementation.h.
|
inline |
Returns a const_reverse_iterator pointing to the end of the term_list.
This operator requires linear time and memory in the size of the list to yield the iterator.
Definition at line 289 of file aterm_list.h.
|
inline |
Returns a const_iterator pointing to the end of the term_list.
Definition at line 296 of file aterm_list.h.
|
inline |
Returns the size of the term_list.
The complexity of this function is linear in the size of the list.
Definition at line 255 of file aterm_list.h.
|
inline |
Returns the tail of the list.
Definition at line 224 of file aterm_list.h.