mCRL2
Loading...
Searching...
No Matches
function_symbol.h
Go to the documentation of this file.
1// Author(s): Wieger Wesselink, Jan Friso Groote. Based on the aterm library by Paul Klint and others.
2// Copyright: see the accompanying file COPYING or copy at
3// https://github.com/mCRL2org/mCRL2/blob/master/COPYING
4//
5// Distributed under the Boost Software License, Version 1.0.
6// (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
11
12#ifndef DETAIL_FUNCTION_SYMBOL_H
13#define DETAIL_FUNCTION_SYMBOL_H
14
15#include <string>
16#include <cstddef>
17
21
22
23namespace atermpp
24{
25namespace detail
26{
27
29class _function_symbol : public mcrl2::utilities::shared_reference_counted<_function_symbol, mcrl2::utilities::detail::GlobalThreadSafe>, private mcrl2::utilities::noncopyable
30{
31public:
34
35 _function_symbol(const std::string& name, std::size_t arity) :
38 {}
39
40 const std::string& name() const noexcept
41 {
42 return m_name;
43 }
44
45 std::size_t arity() const noexcept
46 {
47 return m_arity;
48 }
49
50 bool operator==(const _function_symbol& f) const noexcept
51 {
52 return m_arity == f.m_arity && m_name == f.m_name;
53 }
54
55private:
56 const std::size_t m_arity;
57 const std::string m_name;
58};
59
60} // namespace detail
61} // namespace atermpp
62
63#endif // DETAIL_FUNCTION_SYMBOL_H
64
Stores the data for a function symbol (name, arity) pair.
const std::string & name() const noexcept
bool operator==(const _function_symbol &f) const noexcept
std::size_t arity() const noexcept
_function_symbol(const std::string &name, std::size_t arity)
Inherit from this class to prevent it from being copyable.
Definition noncopyable.h:21
Stores a reference count that can be incremented and decremented.
The main namespace for the aterm++ library.
Definition algorithm.h:21