mCRL2
Loading...
Searching...
No Matches
atermpp::detail::_aterm_appl_allocator< T > Class Template Reference

This class allocates _aterm_appl objects where the size is based on the arity of the function symbol. More...

#include <aterm.h>

Classes

struct  rebind
 

Public Types

using size_type = std::size_t
 
using pointer = T *
 
using value_type = T
 

Public Member Functions

template<typename ForwardIterator >
T * allocate_args (const function_symbol &symbol, ForwardIterator, ForwardIterator)
 Allocates space for an _aterm_appl where the arity is given by 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.
 
template<typename ForwardIterator >
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.
 
void destroy (T *element)
 Specialize destroy for _aterm_appl to only destroy the function symbol. The reference count for the aterm does not have to be decreased.
 
void deallocate (T *element, std::size_t)
 
constexpr std::size_t capacity () const
 
constexpr std::size_t consolidate () const noexcept
 
constexpr bool has_free_slots () const noexcept
 

Static Private Member Functions

static constexpr std::size_t term_appl_size (std::size_t arity)
 

Private Attributes

std::allocator< char > m_packed_allocator
 

Detailed Description

template<typename T = _term_appl>
class atermpp::detail::_aterm_appl_allocator< T >

This class allocates _aterm_appl objects where the size is based on the arity of the function symbol.

The template T is required to be an object that implicitly converts to an _aterm_appl.

Definition at line 119 of file aterm.h.

Member Typedef Documentation

◆ pointer

template<typename T = _term_appl>
using atermpp::detail::_aterm_appl_allocator< T >::pointer = T*

Definition at line 130 of file aterm.h.

◆ size_type

template<typename T = _term_appl>
using atermpp::detail::_aterm_appl_allocator< T >::size_type = std::size_t

Definition at line 129 of file aterm.h.

◆ value_type

template<typename T = _term_appl>
using atermpp::detail::_aterm_appl_allocator< T >::value_type = T

Definition at line 131 of file aterm.h.

Member Function Documentation

◆ allocate_args() [1/2]

template<typename T = _term_appl>
template<typename ForwardIterator >
T * atermpp::detail::_aterm_appl_allocator< T >::allocate_args ( const function_symbol symbol,
ForwardIterator  ,
ForwardIterator   
)
inline

Allocates space for an _aterm_appl where the arity is given by the function symbol.

Definition at line 141 of file aterm.h.

◆ allocate_args() [2/2]

template<typename T = _term_appl>
T * atermpp::detail::_aterm_appl_allocator< T >::allocate_args ( const function_symbol symbol,
unprotected_aterm_core  
)
inline

Allocates space for an _aterm_appl where the arity is given by the function symbol.

Assumes that arguments contains symbol.arity() number of terms.

Definition at line 150 of file aterm.h.

◆ capacity()

template<typename T = _term_appl>
constexpr std::size_t atermpp::detail::_aterm_appl_allocator< T >::capacity ( ) const
inlineconstexpr

Definition at line 184 of file aterm.h.

◆ consolidate()

template<typename T = _term_appl>
constexpr std::size_t atermpp::detail::_aterm_appl_allocator< T >::consolidate ( ) const
inlineconstexprnoexcept

Definition at line 185 of file aterm.h.

◆ construct()

template<typename T = _term_appl>
template<typename ForwardIterator >
void atermpp::detail::_aterm_appl_allocator< T >::construct ( T *  element,
const function_symbol symbol,
ForwardIterator  begin,
ForwardIterator  end 
)
inline

Constructs an _aterm_appl with arguments taken from begin, the arity is given by the function symbol.

Definition at line 159 of file aterm.h.

◆ deallocate()

template<typename T = _term_appl>
void atermpp::detail::_aterm_appl_allocator< T >::deallocate ( T *  element,
std::size_t   
)
inline

Definition at line 174 of file aterm.h.

◆ destroy()

template<typename T = _term_appl>
void atermpp::detail::_aterm_appl_allocator< T >::destroy ( T *  element)
inline

Specialize destroy for _aterm_appl to only destroy the function symbol. The reference count for the aterm does not have to be decreased.

Definition at line 165 of file aterm.h.

◆ has_free_slots()

template<typename T = _term_appl>
constexpr bool atermpp::detail::_aterm_appl_allocator< T >::has_free_slots ( ) const
inlineconstexprnoexcept

Definition at line 186 of file aterm.h.

◆ term_appl_size()

template<typename T = _term_appl>
static constexpr std::size_t atermpp::detail::_aterm_appl_allocator< T >::term_appl_size ( std::size_t  arity)
inlinestaticconstexprprivate
Returns
The size (in bytes) of a class T with arity number of arguments placed at the end.

Definition at line 123 of file aterm.h.

Member Data Documentation

◆ m_packed_allocator

template<typename T = _term_appl>
std::allocator<char> atermpp::detail::_aterm_appl_allocator< T >::m_packed_allocator
private

Definition at line 189 of file aterm.h.


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