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

#include <function_symbol.h>

Inheritance diagram for atermpp::function_symbol:
atermpp::global_function_symbol

Public Member Functions

 function_symbol ()=default
 
 function_symbol (const std::string &name, const std::size_t arity_)
 Defines a function symbol from a name and arity combination.
 
 function_symbol (std::string &&name, const std::size_t arity_)
 Defines a function symbol from a name and arity combination.
 
 function_symbol (const function_symbol &other) noexcept=default
 This class has non-trivial destructor so declare default copy and move operators.
 
function_symboloperator= (const function_symbol &other) noexcept=default
 
 function_symbol (function_symbol &&other) noexcept=default
 
function_symboloperator= (function_symbol &&other) noexcept=default
 
bool defined () const
 
const std::string & name () const
 Return the name of the function_symbol.
 
std::size_t arity () const
 Return the arity (number of arguments) of the function symbol (function_symbol).
 
bool operator== (const function_symbol &f) const
 Equality test.
 
bool operator!= (const function_symbol &f) const
 Inequality test.
 
bool operator< (const function_symbol &f) const
 Comparison operation.
 
bool operator> (const function_symbol &f) const
 Comparison operation.
 
bool operator<= (const function_symbol &f) const
 Comparison operation.
 
bool operator>= (const function_symbol &f) const
 Comparison operation.
 
void swap (function_symbol &f)
 Swap this function with its argument.
 

Private Member Functions

 function_symbol (detail::_function_symbol::ref &&f)
 Constructor for internal use only.
 
 function_symbol (const std::string &name, const std::size_t arity, const bool check_for_registered_functions)
 Constructor for internal use only.
 
 function_symbol (std::string &&name, const std::size_t arity, const bool check_for_registered_functions)
 Constructor for internal use only.
 
void destroy ()
 Calls the function symbol pool to free our used memory.
 

Private Attributes

detail::_function_symbol::ref m_function_symbol
 The shared reference to the underlying function symbol.
 

Friends

class function_symbol_generator
 
class detail::function_symbol_pool
 
class detail::_aterm
 
struct std::hash< function_symbol >
 

Detailed Description

Definition at line 24 of file function_symbol.h.

Constructor & Destructor Documentation

◆ function_symbol() [1/8]

atermpp::function_symbol::function_symbol ( )
default

◆ function_symbol() [2/8]

atermpp::function_symbol::function_symbol ( const std::string &  name,
const std::size_t  arity_ 
)
inline

Defines a function symbol from a name and arity combination.

Definition at line 36 of file function_symbol.h.

◆ function_symbol() [3/8]

atermpp::function_symbol::function_symbol ( std::string &&  name,
const std::size_t  arity_ 
)
inline

Defines a function symbol from a name and arity combination.

Definition at line 41 of file function_symbol.h.

◆ function_symbol() [4/8]

atermpp::function_symbol::function_symbol ( const function_symbol other)
defaultnoexcept

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

◆ function_symbol() [5/8]

atermpp::function_symbol::function_symbol ( function_symbol &&  other)
defaultnoexcept

◆ function_symbol() [6/8]

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

Constructor for internal use only.

Definition at line 130 of file function_symbol.h.

◆ function_symbol() [7/8]

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

Constructor for internal use only.

Definition at line 19 of file function_symbol.cpp.

◆ function_symbol() [8/8]

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

Constructor for internal use only.

Definition at line 23 of file function_symbol.cpp.

Member Function Documentation

◆ arity()

std::size_t atermpp::function_symbol::arity ( ) const
inline

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

Returns
The arity of the function symbol.

Definition at line 65 of file function_symbol.h.

◆ defined()

bool atermpp::function_symbol::defined ( ) const
inline

Definition at line 51 of file function_symbol.h.

◆ destroy()

void atermpp::function_symbol::destroy ( )
private

Calls the function symbol pool to free our used memory.

◆ name()

const std::string & atermpp::function_symbol::name ( ) const
inline

Return the name of the function_symbol.

Returns
The name of the function symbol.

Definition at line 58 of file function_symbol.h.

◆ operator!=()

bool atermpp::function_symbol::operator!= ( const function_symbol f) const
inline

Inequality test.

This operator takes constant time.

Returns
True iff the function symbols are not equal.

Definition at line 82 of file function_symbol.h.

◆ operator<()

bool atermpp::function_symbol::operator< ( const function_symbol f) const
inline

Comparison operation.

This operator takes constant time.

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

Definition at line 90 of file function_symbol.h.

◆ operator<=()

bool atermpp::function_symbol::operator<= ( const function_symbol f) const
inline

Comparison operation.

This operator takes constant time.

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

Definition at line 106 of file function_symbol.h.

◆ operator=() [1/2]

function_symbol & atermpp::function_symbol::operator= ( const function_symbol other)
defaultnoexcept

◆ operator=() [2/2]

function_symbol & atermpp::function_symbol::operator= ( function_symbol &&  other)
defaultnoexcept

◆ operator==()

bool atermpp::function_symbol::operator== ( const function_symbol f) const
inline

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.

Definition at line 74 of file function_symbol.h.

◆ operator>()

bool atermpp::function_symbol::operator> ( const function_symbol f) const
inline

Comparison operation.

This operator takes constant time.

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

Definition at line 98 of file function_symbol.h.

◆ operator>=()

bool atermpp::function_symbol::operator>= ( const function_symbol f) const
inline

Comparison operation.

This operator takes constant time.

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

Definition at line 114 of file function_symbol.h.

◆ swap()

void atermpp::function_symbol::swap ( function_symbol f)
inline

Swap this function with its argument.

More efficient than assigning twice.

Parameters
fThe function symbol with which the swap takes place.

Definition at line 122 of file function_symbol.h.

Friends And Related Symbol Documentation

◆ detail::_aterm

friend class detail::_aterm
friend

Definition at line 28 of file function_symbol.h.

◆ detail::function_symbol_pool

friend class detail::function_symbol_pool
friend

Definition at line 27 of file function_symbol.h.

◆ function_symbol_generator

friend class function_symbol_generator
friend

Definition at line 26 of file function_symbol.h.

◆ std::hash< function_symbol >

friend struct std::hash< function_symbol >
friend

Definition at line 28 of file function_symbol.h.

Member Data Documentation

◆ m_function_symbol

detail::_function_symbol::ref atermpp::function_symbol::m_function_symbol
private

The shared reference to the underlying function symbol.

Definition at line 144 of file function_symbol.h.


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