10#ifndef MCRL2_ATERMPP_ATERM_IO_H
11#define MCRL2_ATERMPP_ATERM_IO_H
104 typename std::enable_if_t<mcrl2::utilities::is_iterable_v<T>,
int> = 0,
105 typename std::enable_if_t<!std::is_base_of<aterm, T>::value,
int> = 0>
109 stream <<
aterm_int(std::distance(container.begin(), container.end()));
111 for (
const auto& element : container)
121 typename std::enable_if_t<mcrl2::utilities::is_iterable_v<T>,
int> = 0,
122 typename std::enable_if_t<!std::is_base_of<aterm, T>::value,
int> = 0>
127 stream >> nof_elements;
129 auto it = std::inserter(container, container.end());
130 for (std::size_t i = 0; i < nof_elements.
value(); ++i)
132 typename T::value_type element;
153 return out << f.
name();
Term containing an integer.
An integer term stores a single std::size_t value. It carries no arguments.
std::size_t value() const noexcept
Provide the value stored in an aterm.
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.
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.
A helper class to restore the state of the aterm_{i,o}stream objects upon destruction....
aterm_transformer * m_transformer
aterm_stream_state(aterm_stream &stream)
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.
const std::string & name() const
Return the name of the function_symbol.
bool type_is_list() const noexcept
Dynamic check whether the term is an aterm_list.
bool type_is_appl() const noexcept
Dynamic check whether the term is an aterm.
bool type_is_int() const noexcept
Dynamic check whether the term is an aterm_int.
The main namespace for the aterm++ library.
aterm identity(const aterm &x)
The default transformer that maps each term to itself.
void write_term_to_binary_stream(const aterm &t, std::ostream &os)
Writes term t to a stream in binary aterm format.
void read_term_from_binary_stream(std::istream &is, aterm &t)
Reads a term from a stream in binary aterm format.
std::string pp(const atermpp::aterm &t)
Transform an aterm to an ascii string.
std::ostream & operator<<(std::ostream &out, const atermpp::aterm &t)
Send the term in textual form to the ostream.
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(const aterm &) aterm_transformer
A function that is applied to all terms. The resulting term should only use a subset of the original ...
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 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.