mcrl2/atermpp/aterm.h

Include file:

#include "mcrl2/atermpp/aterm.h"

Classes

Typedefs

type atermpp::term_callback

typedef for void(*

Functions

void add_deletion_hook(const function_symbol&, term_callback)

Check for reasonably sized aterm (32 bits, 4 bytes) This check might break on perfectly valid architectures that have char == 2 bytes, and sizeof(header_type) == 2.

const DerivedCont &atermpp::container_cast(const Cont<Base> &t, typename std::enable_if_t<is_container<DerivedCont, aterm>::value && std::is_same_v<Cont<typename DerivedCont::value_type>, DerivedCont> && !std::is_base_of_v<DerivedCont, Cont<Base>> && is_convertible<Base, typename DerivedCont::value_type>::value> * = nullptr)
const Derived &atermpp::down_cast(const Base &t, typename std::enable_if<is_convertible<Base, Derived>::value && !std::is_base_of<Derived, Base>::value>::type * = nullptr)

A cheap cast from one aterm based type to another When casting one aterm based type into another, generally a new aterm is constructed, and the old one is destroyed. This can cause undesired overhead, for instance due to increasing and decreasing of reference counts. This cast changes the type, without changing the aterm itself. It can only be used if Base and Derived inherit from aterm, and contain no additional information than a single aterm.

Parameters:

  • t A term of a type inheriting from an aterm.

Returns: A term of type const Derived&.

std::string atermpp::pp(const atermpp::aterm &t)

Transform an aterm to an ascii string.

Parameters:

  • t The input aterm.

Returns: A string representation of the given term derived from an aterm.

Derived &atermpp::reference_cast(Base &t, typename std::enable_if<is_convertible<Base, Derived>::value && !std::is_base_of<Derived, Base>::value>::type * = nullptr)

A cast from one aterm based type to another, as a reference, allowing to assign to it.

Parameters:

  • t A term of a type inheriting from an aterm.

Returns: A term of type Derived&.

const Derived &atermpp::vertical_cast(const Base &t, typename std::enable_if<is_convertible<Base, Derived>::value>::type * = nullptr)

A cast form an aterm derived class to a class that inherits in possibly multiple steps from this class.

The derived class is not allowed to contain extra fields. This conversion does not require runtime computation effort. Also see down_cast.

Parameters:

  • t The term that is converted.

Returns: A term of type Derived.

const DerivedCont &atermpp::vertical_cast(const Cont<Base> &t, typename std::enable_if_t<is_container<DerivedCont, aterm>::value && std::is_same_v<Cont<typename DerivedCont::value_type>, DerivedCont> && is_convertible<Base, typename DerivedCont::value_type>::value> * = nullptr)

Functions

_aterm *atermpp::detail::address(const unprotected_aterm &t)

Returns: A pointer to the underlying aterm.

Functions

void std::swap(atermpp::unprotected_aterm &t1, atermpp::unprotected_aterm &t2) noexcept

Swaps two aterms.

This operation is more efficient than exchanging terms by an assignment, as swapping does not require to change the protection of terms. In order to be used in the standard containers, the declaration must be preceded by an empty template declaration. This swap function is not used for classes that derive from the aterm class. A specific swap function must be provided for derived classes.

Parameters:

  • t1 The first term
  • t2 The second term