10#ifndef MCRL2_ATERMPP_DETAIL_ATERM_APPL_H
11#define MCRL2_ATERMPP_DETAIL_ATERM_APPL_H
21template <
typename Term>
22class term_appl_iterator;
32template<std::
size_t N = 1>
38 template<
typename ...Terms,
39 typename std::enable_if<
are_terms<Terms...>::value>::type* =
nullptr,
40 typename std::enable_if<
sizeof...(Terms) == N>::type* =
nullptr>
45 assert(N == sym.
arity());
50 template<
typename Iterator,
51 typename std::enable_if<mcrl2::utilities::is_iterator<Iterator>::value>::type* =
nullptr>
58 for (std::size_t i = 0; i < N; ++i)
73 assert(sym.
arity() == N);
77 template<
typename Iterator,
78 typename std::enable_if<mcrl2::utilities::is_iterator<Iterator>::value>::type* =
nullptr>
85 for (std::size_t i = 0; i < symbol.
arity(); ++i)
118template<
typename T = _term_appl>
125 return sizeof(T) + (arity - 1) *
sizeof(
aterm_core);
140 template<
typename ForwardIterator>
145 return reinterpret_cast<T*
>(newTerm);
154 return reinterpret_cast<T*
>(newTerm);
158 template<
typename ForwardIterator>
161 new (element) T(symbol, begin, end,
true);
167 assert(element !=
nullptr);
176 assert(element !=
nullptr);
184 constexpr std::size_t
capacity()
const {
return 0; }
194template <
class Derived,
class Base >
196 typename std::enable_if<
197 std::is_base_of<aterm, Base>::value &&
198 std::is_base_of<aterm, Derived>::value
The aterm_core base class that provides protection of the underlying shared terms.
This class allocates _aterm_appl objects where the size is based on the arity of the function symbol.
T * allocate_args(const function_symbol &symbol, unprotected_aterm_core *)
Allocates space for an _aterm_appl where the arity is given by the function symbol.
T * allocate_args(const function_symbol &symbol, ForwardIterator, ForwardIterator)
Allocates space for an _aterm_appl where the arity is given by the function symbol.
std::allocator< char > m_packed_allocator
static constexpr std::size_t term_appl_size(std::size_t arity)
void destroy(T *element)
Specialize destroy for _aterm_appl to only destroy the function symbol. The reference count for the a...
constexpr std::size_t capacity() const
void deallocate(T *element, std::size_t)
constexpr bool has_free_slots() const noexcept
constexpr std::size_t consolidate() const noexcept
void construct(T *element, const function_symbol &symbol, ForwardIterator begin, ForwardIterator end)
Constructs an _aterm_appl with arguments taken from begin, the arity is given by the function symbol.
This class stores a term followed by N arguments. Where N should be equal to the arity of the functio...
_aterm_appl(const function_symbol &sym, const Terms &...arguments)
Constructs a term application with the given symbol and arguments.
_aterm_appl(const function_symbol &symbol, Iterator it, Iterator end, bool)
constructs a term application with the given symbol and its arguments from the iterator.
_aterm_appl(const function_symbol &sym, std::array< unprotected_aterm_core, N > arguments)
Constructs a term application with the given symbol and arguments.
std::array< unprotected_aterm_core, N > m_arguments
_aterm_appl(const function_symbol &sym, Iterator it, Iterator end)
constructs a term application with the given symbol and an iterator where the number of elements is e...
const aterm_core & arg(std::size_t index) const
This is the class to which an aterm points.
const function_symbol & function() const noexcept
std::size_t arity() const
Return the arity (number of arguments) of the function symbol (function_symbol).
An unprotected term does not change the reference count of the shared term when it is copied or moved...
term_appl_iterator< Derived > aterm_appl_iterator_cast(term_appl_iterator< Base > a, typename std::enable_if< std::is_base_of< aterm, Base >::value &&std::is_base_of< aterm, Derived >::value >::type *=nullptr)
This function can be used to translate an term_appl_iterator of one sort into another.
_aterm_appl<> _term_appl
A default instantiation for the underlying term application.
The main namespace for the aterm++ library.
void mcrl2_unused(T &&...)
Function that can be used to silence unused parameter warnings.
_aterm_appl_allocator< U > other
Checks whether condition holds for all types passed as variadic template.
add your file description here.