10#ifndef MCRL2_ATERMPP_ATERM_IO_BINARY_H
11#define MCRL2_ATERMPP_ATERM_IO_BINARY_H
13#include "mcrl2/atermpp/aterm_io.h"
15#include "mcrl2/utilities/bitstream.h"
16#include "mcrl2/atermpp/standard_containers/deque.h"
17#include "mcrl2/atermpp/standard_containers/indexed_set.h"
45 void put(
const aterm &term)
override;
bool is_a_binary_aterm(std::istream &is)
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...
The interface for a class that writes aterm to a stream. Every written term is retrieved by the corre...
aterm()
Default constructor.
aterm & operator=(const aterm &other) noexcept=default
aterm & operator=(aterm &&other) noexcept=default
std::shared_ptr< mcrl2::utilities::ibitstream > m_stream
unsigned int m_function_symbol_index_width
caches the result of function_symbol_index_width().
unsigned int function_symbol_index_width()
atermpp::deque< aterm > m_terms
An index of read terms.
unsigned int term_index_width()
binary_aterm_istream(std::istream &is)
Provide the input stream from which terms are read.
unsigned int m_term_index_width
caches the result of term_index_width().
void get(aterm &t) override
Reads an aterm from this stream.
std::deque< function_symbol > m_function_symbols
An index of read function symbols.
binary_aterm_istream(std::shared_ptr< mcrl2::utilities::ibitstream > stream)
unsigned int m_term_index_width
caches the result of term_index_width().
~binary_aterm_ostream() override
std::size_t write_function_symbol(const function_symbol &symbol)
Write a function symbol to the output stream.
binary_aterm_ostream(std::ostream &os)
Provide the output stream to which the terms are written.
binary_aterm_ostream(std::shared_ptr< mcrl2::utilities::obitstream > stream)
std::shared_ptr< mcrl2::utilities::obitstream > m_stream
unsigned int m_function_symbol_index_width
caches the result of function_symbol_index_width().
unsigned int term_index_width()
atermpp::indexed_set< aterm > m_terms
An index of already written terms.
void put(const aterm &term) override
Writes an aterm in a compact binary format where subterms are shared. The term that is written itself...
unsigned int function_symbol_index_width()
mcrl2::utilities::indexed_set< function_symbol > m_function_symbols
An index of already written function symbols.
bool operator==(const function_symbol &f) const
Equality test.
std::size_t arity() const
Return the arity (number of arguments) of the function symbol (function_symbol).
Standard exception class for reporting runtime errors.
The counterpart of obitstream, guarantees that the same data is read as has been written when calling...
A bitstream provides per bit writing of data to any stream (including stdout).
function_symbol g_as_int
These function symbols are used to indicate integer, list and empty list terms.
The main namespace for the aterm++ library.
static constexpr unsigned int packet_bits
The number of bits needed to store an element of packet_type.
void write_term_to_binary_stream(const aterm &t, std::ostream &os)
Writes term t to a stream in binary aterm format.
static constexpr std::uint16_t BAF_MAGIC
The magic value for a binary aterm format stream.
void read_term_from_binary_stream(std::istream &is, aterm &t)
Reads a term from a stream in binary aterm format.
packet_type
Each packet has a header consisting of a type.
void make_aterm_int(aterm_int &target, std::size_t value)
Constructs an integer term from a value.
static constexpr std::uint16_t BAF_VERSION
The BAF_VERSION constant is the version number of the ATerms written in BAF format....
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Keep track of whether the term can be written to the stream.
void mark(std::stack< std::reference_wrapper< detail::_aterm > > &todo) const
detail::reference_aterm< aterm > term
write_todo(const aterm &term)
std::size_t operator()(const atermpp::detail::reference_aterm< T > &t) const