mCRL2
Loading...
Searching...
No Matches
aterm_core.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_core;
23class aterm_core;
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_core>,
40 std::disjunction<mcrl2::utilities::is_applicable<Term, unprotected_aterm_core&>,
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_core& 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_core.h:48
bool is_marked() const
Check if the term is already marked.
Definition aterm_core.h:73
_aterm(const function_symbol &symbol)
Create a term from a function symbol.
Definition aterm_core.h:51
function_symbol m_function_symbol
Definition aterm_core.h:79
const function_symbol & function() const noexcept
Definition aterm_core.h:55
void mark() const
Mark this term to be garbage collected.
Definition aterm_core.h:61
void unmark() const
Remove the mark from a term.
Definition aterm_core.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_core.h:32
Inherit from this class to prevent it from being copyable.
Definition noncopyable.h:21
_aterm * address(const unprotected_aterm_core &t)
Definition aterm_core.h:239
std::disjunction< std::is_convertible< Term, unprotected_aterm_core >, std::disjunction< mcrl2::utilities::is_applicable< Term, unprotected_aterm_core & >, mcrl2::utilities::is_constant_function_yielding< Term, unprotected_aterm_core > > > is_term_or_function
Definition aterm_core.h:41
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