mCRL2
Loading...
Searching...
No Matches
aterm.h
Go to the documentation of this file.
1// Author(s): Jan Friso Groote
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//
9
10#ifndef MCRL2_ATERMPP_DETAIL_ATERM_H
11#define MCRL2_ATERMPP_DETAIL_ATERM_H
12
13#include <limits>
14
17
18namespace atermpp
19{
20
21// Forward declaration.
22class unprotected_aterm;
23class aterm;
24
25namespace detail
26{
27
28class _aterm;
29inline void debug_print(std::ostream& o, const _aterm* t, const std::size_t d = 3);
30
32template<typename ...Terms>
34
37
38template <typename Term>
39using is_term_or_function = std::disjunction<std::is_convertible<Term, unprotected_aterm>,
40 std::disjunction<mcrl2::utilities::is_applicable<Term, unprotected_aterm&>,
42
43template<typename ...Terms>
45
48{
49public:
51 _aterm(const function_symbol& symbol) :
52 m_function_symbol(symbol)
53 {}
54
55 const function_symbol& function() const noexcept
56 {
57 return m_function_symbol;
58 }
59
61 void mark() const
62 {
64 }
65
67 void unmark() const
68 {
70 }
71
73 bool is_marked() const
74 {
76 }
77
78private:
80};
81
82inline _aterm* address(const unprotected_aterm& t);
83
84} // namespace detail
85} // namespace atermpp
86
87#endif /* MCRL2_ATERMPP_DETAIL_ATERM_H */
This is the class to which an aterm points.
Definition aterm.h:48
bool is_marked() const
Check if the term is already marked.
Definition aterm.h:73
_aterm(const function_symbol &symbol)
Create a term from a function symbol.
Definition aterm.h:51
function_symbol m_function_symbol
Definition aterm.h:79
const function_symbol & function() const noexcept
Definition aterm.h:55
void mark() const
Mark this term to be garbage collected.
Definition aterm.h:61
void unmark() const
Remove the mark from a term.
Definition aterm.h:67
detail::_function_symbol::ref m_function_symbol
The shared reference to the underlying function symbol.
An unprotected term does not change the reference count of the shared term when it is copied or moved...
Definition aterm.h:36
Inherit from this class to prevent it from being copyable.
Definition noncopyable.h:21
std::disjunction< std::is_convertible< Term, unprotected_aterm >, std::disjunction< mcrl2::utilities::is_applicable< Term, unprotected_aterm & >, mcrl2::utilities::is_constant_function_yielding< Term, unprotected_aterm > > > is_term_or_function
Definition aterm.h:41
_aterm * address(const unprotected_aterm &t)
Definition aterm.h:347
void debug_print(std::ostream &o, const _aterm *t, const std::size_t d=3)
The main namespace for the aterm++ library.
Definition algorithm.h:21
Checks whether condition holds for all types passed as variadic template.
Definition type_traits.h:41