10#ifndef MCRL2_ATERMPP_ATERM_IO_H
11#define MCRL2_ATERMPP_ATERM_IO_H
13#include "mcrl2/atermpp/aterm_int.h"
14#include "mcrl2/atermpp/aterm_list.h"
15#include "mcrl2/atermpp/concepts.h"
214 const aterm_list l = down_cast<aterm_list>(read_term_from_string(s));
215 assert(l.type_is_list());
224 const aterm_int n = down_cast<aterm_int>(read_term_from_string(s));
225 assert(n.type_is_int());
234 const aterm a = read_term_from_string(s);
235 assert(a.type_is_appl());
An integer term stores a single std::size_t value. It carries no arguments.
The interface for a class that reads aterm from a stream. The default constructed term aterm() indica...
virtual void get(aterm &t)=0
Reads an aterm from this stream.
~aterm_istream() override
The interface for a class that writes aterm to a stream. Every written term is retrieved by the corre...
virtual void put(const aterm &term)=0
Write the given term to the stream.
~aterm_ostream() override
A helper class to restore the state of the aterm_{i,o}stream objects upon destruction....
aterm_stream_state(aterm_stream_state &&)=delete
aterm_stream_state & operator=(aterm_stream_state &&)=delete
aterm_transformer * m_transformer
aterm_stream_state(aterm_stream &stream)
aterm_stream_state(const aterm_stream_state &)=delete
aterm_stream_state & operator=(const aterm_stream_state &)=delete
The general aterm stream interface, which enables the use of a transformer to change the written/read...
aterm_transformer * m_transformer
aterm_transformer * get_transformer() const
void set_transformer(aterm_transformer transformer)
Sets the given transformer to be applied to following writes.
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.
aterm identity(const aterm &x)
The default transformer that maps each term to itself.
aterm_istream & operator>>(aterm_istream &stream, aterm &term)
Read the given term from the stream, but for aterm_list we want to use a specific one that performs v...
void read_term_from_binary_stream(std::istream &is, aterm &t)
Reads a term from a stream in binary aterm format.
aterm read_appl_from_string(const std::string &s)
Reads an aterm from a string. The string can be in either binary or text format.
aterm_int read_int_from_string(const std::string &s)
Reads an aterm_int from a string. The string can be in either binary or text format.
aterm read_term_from_string(const std::string &s)
Reads an aterm from a string. The string can be in either binary or text format.
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...
void write_term_to_text_stream(const aterm &t, std::ostream &os)
Writes term t to a stream in textual format.
aterm_istream & operator>>(aterm_istream &stream, aterm_transformer transformer)
Sets the given transformer to be applied to following reads.
void read_term_from_text_stream(std::istream &is, aterm &t)
Reads a term from a stream which contains the term in textual format.
aterm_list read_list_from_string(const std::string &s)
Reads an aterm_list from a string. The string can be in either binary or text format.