mCRL2
Loading...
Searching...
No Matches
atermpp::term_appl< Term > Class Template Reference

#include <aterm_appl.h>

Inheritance diagram for atermpp::term_appl< Term >:
atermpp::aterm atermpp::unprotected_aterm

Public Types

typedef Term value_type
 The type of object, T stored in the term_appl.
 
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_appl_iterator< Term > iterator
 Iterator used to iterate through an term_appl.
 
typedef term_appl_iterator< Term > const_iterator
 Const iterator used to iterate through an term_appl.
 

Public Member Functions

 term_appl ()
 Default constructor.
 
 term_appl (const aterm &t)
 Explicit constructor from an aterm.
 
 term_appl (const term_appl &other) noexcept=default
 This class has user-declared copy constructor so declare default copy and move operators.
 
term_apploperator= (const term_appl &other) noexcept=default
 
 term_appl (term_appl &&other) noexcept=default
 
term_apploperator= (term_appl &&other) noexcept=default
 
template<class ForwardIterator , typename std::enable_if< mcrl2::utilities::is_iterator< ForwardIterator >::value >::type * = nullptr, typename std::enable_if<!std::is_same< typename ForwardIterator::iterator_category, std::input_iterator_tag >::value >::type * = nullptr, typename std::enable_if<!std::is_same< typename ForwardIterator::iterator_category, std::output_iterator_tag >::value >::type * = nullptr>
 term_appl (const function_symbol &sym, ForwardIterator begin, ForwardIterator end)
 Constructor that provides an aterm_appl based on a function symbol and forward iterator providing the arguments.
 
template<class InputIterator , typename std::enable_if< mcrl2::utilities::is_iterator< InputIterator >::value >::type * = nullptr, typename std::enable_if< std::is_same< typename InputIterator::iterator_category, std::input_iterator_tag >::value >::type * = nullptr>
 term_appl (const function_symbol &sym, InputIterator begin, InputIterator end)
 Constructor that provides an aterm_appl based on a function symbol and an input iterator providing the arguments.
 
template<class InputIterator , class TermConverter , typename std::enable_if< mcrl2::utilities::is_iterator< InputIterator >::value >::type * = nullptr>
 term_appl (const function_symbol &sym, InputIterator begin, InputIterator end, TermConverter converter)
 
 term_appl (const function_symbol &sym)
 Constructor.
 
template<typename ... Terms>
 term_appl (const function_symbol &symbol, const Terms &...arguments)
 Constructor for n-arity function application.
 
const function_symbolfunction () const
 Returns the function symbol belonging to an aterm_appl.
 
size_type size () const
 Returns the number of arguments of this term.
 
bool empty () const
 Returns true if the term has no arguments.
 
const_iterator begin () const
 Returns an iterator pointing to the first argument.
 
const_iterator end () const
 Returns a const_iterator pointing past the last argument.
 
constexpr size_type max_size () const
 Returns the largest possible number of arguments.
 
const Term & operator[] (const size_type i) const
 Returns the i-th argument.
 
- Public Member Functions inherited from atermpp::aterm
 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.
 
atermoperator= (const aterm &other) noexcept
 Assignment operator.
 
atermassign (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>
atermunprotected_assign (const aterm &other) noexcept
 Assignment operator, to be used when the busy flags do not need to be set.
 
atermoperator= (aterm &&other) noexcept
 Move assignment operator.
 
- Public Member Functions inherited from atermpp::unprotected_aterm
 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_symbolfunction () const
 Yields the function symbol in an aterm.
 

Protected Member Functions

 term_appl (detail::_term_appl *t)
 Constructor.
 

Additional Inherited Members

- Protected Attributes inherited from atermpp::unprotected_aterm
const detail::_atermm_term
 

Detailed Description

template<class Term>
class atermpp::term_appl< Term >

Definition at line 24 of file aterm_appl.h.

Member Typedef Documentation

◆ const_iterator

template<class Term >
typedef term_appl_iterator<Term> atermpp::term_appl< Term >::const_iterator

Const iterator used to iterate through an term_appl.

Definition at line 60 of file aterm_appl.h.

◆ const_reference

template<class Term >
typedef const Term atermpp::term_appl< Term >::const_reference

Const reference to T.

Definition at line 48 of file aterm_appl.h.

◆ difference_type

template<class Term >
typedef ptrdiff_t atermpp::term_appl< Term >::difference_type

A signed integral type.

Definition at line 54 of file aterm_appl.h.

◆ iterator

template<class Term >
typedef term_appl_iterator<Term> atermpp::term_appl< Term >::iterator

Iterator used to iterate through an term_appl.

Definition at line 57 of file aterm_appl.h.

◆ pointer

template<class Term >
typedef Term* atermpp::term_appl< Term >::pointer

Pointer to T.

Definition at line 42 of file aterm_appl.h.

◆ reference

template<class Term >
typedef Term& atermpp::term_appl< Term >::reference

Reference to T.

Definition at line 45 of file aterm_appl.h.

◆ size_type

template<class Term >
typedef std::size_t atermpp::term_appl< Term >::size_type

An unsigned integral type.

Definition at line 51 of file aterm_appl.h.

◆ value_type

template<class Term >
typedef Term atermpp::term_appl< Term >::value_type

The type of object, T stored in the term_appl.

Definition at line 39 of file aterm_appl.h.

Constructor & Destructor Documentation

◆ term_appl() [1/10]

template<class Term >
atermpp::term_appl< Term >::term_appl ( detail::_term_appl< Term > *  t)
inlineexplicitprotected

Constructor.

Parameters
tA pointer internal data structure from which the term is constructed.

This function is explicitly protected such that is not used in common code.

Definition at line 30 of file aterm_appl.h.

◆ term_appl() [2/10]

template<class Term >
atermpp::term_appl< Term >::term_appl ( )
inline

Default constructor.

Definition at line 63 of file aterm_appl.h.

◆ term_appl() [3/10]

template<class Term >
atermpp::term_appl< Term >::term_appl ( const aterm t)
inlineexplicit

Explicit constructor from an aterm.

Parameters
tThe aterm from which the term is constructed.

Definition at line 68 of file aterm_appl.h.

◆ term_appl() [4/10]

template<class Term >
atermpp::term_appl< Term >::term_appl ( const term_appl< Term > &  other)
defaultnoexcept

This class has user-declared copy constructor so declare default copy and move operators.

◆ term_appl() [5/10]

template<class Term >
atermpp::term_appl< Term >::term_appl ( term_appl< Term > &&  other)
defaultnoexcept

◆ term_appl() [6/10]

template<class Term >
template<class ForwardIterator , typename std::enable_if< mcrl2::utilities::is_iterator< ForwardIterator >::value >::type * = nullptr, typename std::enable_if<!std::is_same< typename ForwardIterator::iterator_category, std::input_iterator_tag >::value >::type * = nullptr, typename std::enable_if<!std::is_same< typename ForwardIterator::iterator_category, std::output_iterator_tag >::value >::type * = nullptr>
atermpp::term_appl< Term >::term_appl ( const function_symbol sym,
ForwardIterator  begin,
ForwardIterator  end 
)
inline

Constructor that provides an aterm_appl based on a function symbol and forward iterator providing the arguments.

The iterator range is traversed more than once. If only one traversal is required use term_appl with a TermConverter argument. But this function is substantially less efficient. The length of the iterator range must match the arity of the function symbol.

Parameters
symA function symbol.
beginThe start of a range of elements.
endThe end of a range of elements.

Definition at line 94 of file aterm_appl.h.

◆ term_appl() [7/10]

template<class Term >
template<class InputIterator , typename std::enable_if< mcrl2::utilities::is_iterator< InputIterator >::value >::type * = nullptr, typename std::enable_if< std::is_same< typename InputIterator::iterator_category, std::input_iterator_tag >::value >::type * = nullptr>
atermpp::term_appl< Term >::term_appl ( const function_symbol sym,
InputIterator  begin,
InputIterator  end 
)
inline

Constructor that provides an aterm_appl based on a function symbol and an input iterator providing the arguments.

The given iterator is traversed only once. So it can be used with an input iterator. This means that the TermConverter is applied exactly once to each element. The length of the iterator range must be equal to the arity of the function symbol.

Parameters
symA function symbol.
beginThe start of a range of elements.
endThe end of a range of elements.

Definition at line 117 of file aterm_appl.h.

◆ term_appl() [8/10]

template<class Term >
template<class InputIterator , class TermConverter , typename std::enable_if< mcrl2::utilities::is_iterator< InputIterator >::value >::type * = nullptr>
atermpp::term_appl< Term >::term_appl ( const function_symbol sym,
InputIterator  begin,
InputIterator  end,
TermConverter  converter 
)
inline

The given iterator is traversed only once. So it can be used with an input iterator. This means that the TermConverter is applied exactly once to each element. The length of the iterator range must be equal to the arity of the function symbol.

Parameters
symA function symbol.
beginThe start of a range of elements.
endThe end of a range of elements.
converterAn class or lambda term containing an operator Term operator()(const Term& t) which is applied to each each element in the iterator range before it becomes an argument of this term.

Definition at line 139 of file aterm_appl.h.

◆ term_appl() [9/10]

template<class Term >
atermpp::term_appl< Term >::term_appl ( const function_symbol sym)
inline

Constructor.

Parameters
symA function symbol.

Definition at line 153 of file aterm_appl.h.

◆ term_appl() [10/10]

template<class Term >
template<typename ... Terms>
atermpp::term_appl< Term >::term_appl ( const function_symbol symbol,
const Terms &...  arguments 
)
inline

Constructor for n-arity function application.

Parameters
symbolA function symbol.
argumentsThe arguments of the function application.

Definition at line 164 of file aterm_appl.h.

Member Function Documentation

◆ begin()

template<class Term >
const_iterator atermpp::term_appl< Term >::begin ( ) const
inline

Returns an iterator pointing to the first argument.

Returns
An iterator pointing to the first argument.

Definition at line 195 of file aterm_appl.h.

◆ empty()

template<class Term >
bool atermpp::term_appl< Term >::empty ( ) const
inline

Returns true if the term has no arguments.

Returns
True if this term has no arguments.

Definition at line 188 of file aterm_appl.h.

◆ end()

template<class Term >
const_iterator atermpp::term_appl< Term >::end ( ) const
inline

Returns a const_iterator pointing past the last argument.

Returns
A const_iterator pointing past the last argument.

Definition at line 202 of file aterm_appl.h.

◆ function()

template<class Term >
const function_symbol & atermpp::term_appl< Term >::function ( ) const
inline

Returns the function symbol belonging to an aterm_appl.

Returns
The function symbol of this term.

Definition at line 174 of file aterm_appl.h.

◆ max_size()

template<class Term >
constexpr size_type atermpp::term_appl< Term >::max_size ( ) const
inlineconstexpr

Returns the largest possible number of arguments.

Returns
The largest possible number of arguments.

Definition at line 209 of file aterm_appl.h.

◆ operator=() [1/2]

template<class Term >
term_appl & atermpp::term_appl< Term >::operator= ( const term_appl< Term > &  other)
defaultnoexcept

◆ operator=() [2/2]

template<class Term >
term_appl & atermpp::term_appl< Term >::operator= ( term_appl< Term > &&  other)
defaultnoexcept

◆ operator[]()

template<class Term >
const Term & atermpp::term_appl< Term >::operator[] ( const size_type  i) const
inline

Returns the i-th argument.

Parameters
iA positive integer.
Returns
The argument with the given index.

Definition at line 217 of file aterm_appl.h.

◆ size()

template<class Term >
size_type atermpp::term_appl< Term >::size ( ) const
inline

Returns the number of arguments of this term.

Returns
The number of arguments of this term.

Definition at line 181 of file aterm_appl.h.


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