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

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

#include <aterm_core.h>

Inheritance diagram for atermpp::aterm_core:
atermpp::unprotected_aterm_core atermpp::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::aterm_string atermpp::detail::shared_subset< T >::bdd_node atermpp::term_balanced_tree< Term > atermpp::term_list< Term > mcrl2::action_formulas::action_formula mcrl2::data::alias mcrl2::data::assignment_expression mcrl2::data::binder_type mcrl2::data::container_type mcrl2::data::data_equation mcrl2::data::data_expression mcrl2::data::detail::match_tree mcrl2::data::detail::variable_or_number mcrl2::data::detail::variable_with_a_rational_factor mcrl2::data::linear_inequality mcrl2::data::sort_expression mcrl2::data::structured_sort_constructor mcrl2::data::structured_sort_constructor_argument mcrl2::data::untyped_data_parameter mcrl2::lps::multi_action mcrl2::lps::process_initializer mcrl2::lps::stochastic_distribution mcrl2::pbes_system::fixpoint_symbol mcrl2::pbes_system::pbes_expression mcrl2::pbes_system::propositional_variable mcrl2::pres_system::pres_expression mcrl2::process::action_label mcrl2::process::action_name_multiset mcrl2::process::communication_expression mcrl2::process::process_equation mcrl2::process::process_expression mcrl2::process::process_identifier mcrl2::process::rename_expression mcrl2::process::untyped_multi_action mcrl2::regular_formulas::regular_formula mcrl2::state_formulas::state_formula

Public Member Functions

 aterm_core () noexcept
 Default constructor.
 
 ~aterm_core () noexcept
 Standard destructor.
 
 aterm_core (const detail::_aterm *t) noexcept
 Constructor based on an internal term data structure. This is not for public use.
 
 aterm_core (const aterm_core &other) noexcept
 Copy constructor.
 
 aterm_core (aterm_core &&other) noexcept
 Move constructor.
 
aterm_coreoperator= (const aterm_core &other) noexcept
 Assignment operator.
 
aterm_coreassign (const aterm_core &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_coreunprotected_assign (const aterm_core &other) noexcept
 Assignment operator, to be used when the busy flags do not need to be set.
 
aterm_coreoperator= (aterm_core &&other) noexcept
 Move assignment operator.
 
- Public Member Functions inherited from atermpp::unprotected_aterm_core
 unprotected_aterm_core () noexcept
 Default constuctor.
 
 unprotected_aterm_core (const detail::_aterm *term) noexcept
 Constructor.
 
bool type_is_appl () const noexcept
 Dynamic check whether the term is an aterm.
 
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_core &t) const
 Comparison operator.
 
bool operator!= (const unprotected_aterm_core &t) const
 Inequality operator on two unprotected aterms.
 
bool operator< (const unprotected_aterm_core &t) const
 Comparison operator for two unprotected aterms.
 
bool operator> (const unprotected_aterm_core &t) const
 Comparison operator for two unprotected aterms.
 
bool operator<= (const unprotected_aterm_core &t) const
 Comparison operator for two unprotected aterms.
 
bool operator>= (const unprotected_aterm_core &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, aterm_appls and aterm_int.
 
void swap (unprotected_aterm_core &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_core
const detail::_atermm_term
 

Detailed Description

The aterm_core 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 181 of file aterm_core.h.

Constructor & Destructor Documentation

◆ aterm_core() [1/4]

atermpp::aterm_core::aterm_core ( )
inlinenoexcept

Default constructor.

Definition at line 62 of file aterm_implementation.h.

◆ ~aterm_core()

atermpp::aterm_core::~aterm_core ( )
inlinenoexcept

Standard destructor.

Definition at line 67 of file aterm_implementation.h.

◆ aterm_core() [2/4]

atermpp::aterm_core::aterm_core ( 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_core 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_core() [3/4]

atermpp::aterm_core::aterm_core ( const aterm_core other)
inlinenoexcept

Copy constructor.

Parameters
otherThe aterm_core 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_core() [4/4]

atermpp::aterm_core::aterm_core ( aterm_core &&  other)
inlinenoexcept

Move constructor.

Parameters
otherThe aterm_core 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_core & atermpp::aterm_core::assign ( const aterm_core other,
detail::thread_aterm_pool pool 
)
inlinenoexcept

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

Parameters
otherThe aterm_core that will be assigned.

Definition at line 97 of file aterm_implementation.h.

◆ operator=() [1/2]

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

Move assignment operator.

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

Definition at line 115 of file aterm_implementation.h.

◆ operator=() [2/2]

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

Assignment operator.

Parameters
otherThe aterm_core 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_core & atermpp::aterm_core::unprotected_assign ( const aterm_core 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_core that will be assigned.

Definition at line 107 of file aterm_implementation.h.


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