atermpp::aterm

Include file:

#include "mcrl2/atermpp/aterm.h
class atermpp::aterm

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.

Public member functions

aterm &assign(const aterm &other, std::atomic<bool> *busy_flag, std::atomic<bool> *forbidden_flag, std::size_t *lock_depth) noexcept

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

Parameters:

  • other The aterm that will be assigned.
aterm() noexcept

Default constructor.

aterm(aterm &&other) noexcept

Move constructor.

Parameters:

  • other The 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.

aterm(const aterm &other) noexcept

Copy constructor.

Parameters:

  • other The aterm that is copied.

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

aterm(const detail::_aterm *t) noexcept

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

Takes ownership of the passed underlying term.

Parameters:

  • t A pointer to an internal aterm data structure.

TodoShould be protected, but this cannot yet be done due to a problem in the compiling rewriter.

aterm &operator=(aterm &&other) noexcept

Move assignment operator.

Parameters:

  • other The aterm that will be assigned.

Returns: A reference to the assigned term.

aterm &operator=(const aterm &other) noexcept

Assignment operator.

Parameters:

  • other The aterm that will be assigned.

Returns: A reference to the assigned term.

aterm &unprotected_assign(const aterm &other) noexcept

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:

  • other The aterm that will be assigned.
~aterm() noexcept

Standard destructor.