10#include "mcrl2/atermpp/aterm_io.h"
11#include "mcrl2/atermpp/detail/global_aterm_pool.h"
12#include "mcrl2/utilities/shared_mutex.h"
22static_assert(
sizeof(std::size_t) ==
sizeof(_aterm*),
"The size of an aterm pointer is not equal to the size of type std::size_t. Cannot compile the MCRL2 toolset for this platform.");
23static_assert(
sizeof(std::size_t) >= 4,
"The size of std::size_t should at least be four bytes. Cannot compile the toolset for this platform.");
27 g_term_pool().add_deletion_hook(function, callback);
42#ifdef MCRL2_ENABLE_MULTITHREADING
43 static_assert(mcrl2::utilities::detail::GlobalThreadSafe);
44 thread_local thread_aterm_pool instance(g_aterm_pool_instance());
46 static_assert(!mcrl2::utilities::detail::GlobalThreadSafe);
The interface for a class that reads aterm from a stream. The default constructed term aterm() indica...
~aterm_istream() override
The interface for a class that writes aterm to a stream. Every written term is retrieved by the corre...
~aterm_ostream() override
The general aterm stream interface, which enables the use of a transformer to change the written/read...
thread_aterm_pool(aterm_pool &global_pool)
std::stack< std::reference_wrapper< _aterm > > m_todo
A reusable todo stack.
A unordered_map class in which aterms can be stored.
thread_aterm_pool & g_thread_term_pool()
A reference to the thread local term pool storage.
aterm_pool & g_aterm_pool_instance()
A reference to the global term pool storage.
thread_aterm_pool * g_main_thread_pool
Pointer to the main thread's pool; set on its first access and used by ~thread_aterm_pool to transfer...
mcrl2::utilities::shared_guard lock_shared_aterm_pool()
Acquires a shared lock on the global thread aterm pool.
std::array< std::byte, sizeof(aterm_pool)> g_aterm_pool_storage
Storage for a global term pool that is not initialized.
The main namespace for the aterm++ library.
void add_deletion_hook(const function_symbol &, term_callback)
Check for reasonably sized aterm (32 bits, 4 bytes) This check might break on perfectly valid archite...