mCRL2
Loading...
Searching...
No Matches
atermpp::aterm Class Reference

The aterm base class that provides protection of the underlying shared terms. More...

#include <aterm.h>

Inheritance diagram for atermpp::aterm:
atermpp::unprotected_aterm atermpp::term_appl< aterm > atermpp::term_list< variable_with_a_rational_factor > atermpp::term_list< variable > atermpp::term_list< data_expression > atermpp::term_list< action_label > atermpp::term_list< lps::state > atermpp::term_list< match_tree_list > atermpp::term_list< match_tree_list_list > atermpp::term_list< assignment > atermpp::aterm_int atermpp::term_appl< Term > atermpp::term_list< Term > mcrl2::data::detail::variable_or_number

Public Member Functions

 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.
 

Additional Inherited Members

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

Detailed Description

The aterm base class that provides protection of the underlying shared terms.

Terms are protected using one of the following two invariants: (1) A term that can be accessed is a subterm of a term with a reference count larger than 0 (when reference counting is used). Or, (2) A term that can be accessed if it is a subterm of a term that occurs at an address which exist in the protection set of a process, or which sits in an atermpp container, which automatically is a container protection set. Furthermore, every address in a protection set contains a valid term. During garbage collection or rehashing, this situation is stable in the sense that all terms that are protected remain protected until the end of the garbage collection or rehashing phase by the same address or term. This means that during garbage collection no terms can be deleted, for instance in an assignment, or in a destruct.

Definition at line 185 of file aterm.h.

Constructor & Destructor Documentation

◆ aterm() [1/4]

atermpp::aterm::aterm ( )
inlinenoexcept

Default constructor.

Definition at line 62 of file aterm_implementation.h.

◆ ~aterm()

atermpp::aterm::~aterm ( )
inlinenoexcept

Standard destructor.

Definition at line 67 of file aterm_implementation.h.

◆ aterm() [2/4]

atermpp::aterm::aterm ( const detail::_aterm t)
inlineexplicitnoexcept

Constructor based on an internal term data structure. This is not for public use.

Takes ownership of the passed underlying term.

Parameters
tA pointer to an internal aterm data structure.
Todo:
Should be protected, but this cannot yet be done due to a problem in the compiling rewriter.

Definition at line 72 of file aterm_implementation.h.

◆ aterm() [3/4]

atermpp::aterm::aterm ( const aterm other)
inlinenoexcept

Copy constructor.

Parameters
otherThe aterm that is copied.

This class has a non-trivial destructor so explicitly define the copy and move operators.

Definition at line 78 of file aterm_implementation.h.

◆ aterm() [4/4]

atermpp::aterm::aterm ( aterm &&  other)
inlinenoexcept

Move constructor.

Parameters
otherThe aterm that is moved into the new term. This term may have changed after this operation.

This operation does not employ increments and decrements of reference counts and is therefore more efficient than the standard copy construct.

Definition at line 84 of file aterm_implementation.h.

Member Function Documentation

◆ assign()

aterm & atermpp::aterm::assign ( const aterm other,
detail::thread_aterm_pool pool 
)
inlinenoexcept

Assignment operator, to be used if busy and forbidden flags are explicitly available.

Parameters
otherThe aterm that will be assigned.

Definition at line 97 of file aterm_implementation.h.

◆ operator=() [1/2]

aterm & atermpp::aterm::operator= ( aterm &&  other)
inlinenoexcept

Move assignment operator.

Parameters
otherThe aterm that will be assigned.
Returns
A reference to the assigned term.

Definition at line 115 of file aterm_implementation.h.

◆ operator=() [2/2]

aterm & atermpp::aterm::operator= ( const aterm other)
inlinenoexcept

Assignment operator.

Parameters
otherThe aterm that will be assigned.
Returns
A reference to the assigned term.

Definition at line 90 of file aterm_implementation.h.

◆ unprotected_assign()

template<bool CHECK_BUSY_FLAG>
aterm & atermpp::aterm::unprotected_assign ( const aterm other)
inlinenoexcept

Assignment operator, to be used when the busy flags do not need to be set.

This is only safe in the parallel context when the busy flag is already known to be set. This is also checked by an assert. This can be used for instance in a lambda function that is passed in a make_.... function, as this unprotected assign will only be called when a term is constructed.

Parameters
otherThe aterm that will be assigned.

Definition at line 107 of file aterm_implementation.h.


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