atermpp::function_symbol

Include file:

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

Friends

friend class function_symbol_generator

friend struct std::hash

Private attributes

detail::_function_symbol::ref m_function_symbol

The shared reference to the underlying function symbol.

Public member functions

std::size_t arity() const

Return the arity (number of arguments) of the function symbol (function_symbol).

Returns: The arity of the function symbol.

bool defined() const
function_symbol(const std::string &name, const std::size_t arity_)

Defines a function symbol from a name and arity combination.

function_symbol(detail::_function_symbol::ref &&f)

Constructor for internal use only.

function_symbol()
function_symbol(const function_symbol &other) noexcept = default

This class has non-trivial destructor so declare default copy and move operators.

function_symbol(function_symbol &&other) noexcept = default
const std::string &name() const

Return the name of the function_symbol.

Returns: The name of the function symbol.

bool operator!=(const function_symbol &f) const

Inequality test.

This operator takes constant time.

Returns: True iff the function symbols are not equal.

bool operator<(const function_symbol &f) const

Comparison operation.

This operator takes constant time.

Returns: True iff this function has a lower index than the argument.

bool operator<=(const function_symbol &f) const

Comparison operation.

This operator takes constant time.

Returns: True iff this function has a lower or equal index than the argument.

function_symbol &operator=(const function_symbol &other) noexcept = default
function_symbol &operator=(function_symbol &&other) noexcept = default
bool operator==(const function_symbol &f) const

Equality test.

This operator compares the indices of the function symbols. This means that this operation takes constant time.

Returns: True iff the function symbols are the same.

bool operator>(const function_symbol &f) const

Comparison operation.

This operator takes constant time.

Returns: True iff this function has a higher index than the argument.

bool operator>=(const function_symbol &f) const

Comparison operation.

This operator takes constant time.

Returns: True iff this function has a larger or equal index than the argument.

void swap(function_symbol &f)

Swap this function with its argument.

More efficient than assigning twice.

Parameters:

  • f The function symbol with which the swap takes place.
~function_symbol()

Destructor.

Private member functions

void destroy()

Calls the function symbol pool to free our used memory.

function_symbol(const std::string &name, const std::size_t arity, const bool check_for_registered_functions)

Constructor for internal use only.