cprover
irep_serializationt Class Reference

#include <irep_serialization.h>

Collaboration diagram for irep_serializationt:
[legend]

Classes

class  ireps_containert
 

Public Member Functions

 irep_serializationt (ireps_containert &ic)
 
std::size_t insert_on_write (std::size_t h)
 inserts an irep into the hashtable More...
 
std::size_t insert_on_read (std::size_t id, const irept &)
 inserts an irep into the hashtable, but only the id-hashtable (only to be used upon reading ireps from a file) More...
 
void reference_convert (std::istream &, irept &irep)
 
void reference_convert (const irept &irep, std::ostream &)
 
irep_idt read_string_ref (std::istream &)
 reads a string reference from the stream More...
 
void write_string_ref (std::ostream &, const irep_idt &)
 outputs the string reference More...
 
void clear ()
 
irep_idt read_gb_string (std::istream &)
 reads a string from the stream More...
 

Static Public Member Functions

static std::size_t read_gb_word (std::istream &)
 reads 4 characters and builds a long int from them More...
 

Private Member Functions

void write_irep (std::ostream &, const irept &irep)
 
void read_irep (std::istream &, irept &irep)
 

Private Attributes

ireps_containertireps_container
 
std::vector< char > read_buffer
 

Detailed Description

Definition at line 28 of file irep_serialization.h.

Constructor & Destructor Documentation

§ irep_serializationt()

irep_serializationt::irep_serializationt ( ireps_containert ic)
inlineexplicit

Member Function Documentation

§ clear()

void irep_serializationt::clear ( void  )
inline

§ insert_on_read()

std::size_t irep_serializationt::insert_on_read ( std::size_t  id,
const irept i 
)

inserts an irep into the hashtable, but only the id-hashtable (only to be used upon reading ireps from a file)

parameters: a size_t and an irep
Returns
true on success, false otherwise

Definition at line 144 of file irep_serialization.cpp.

References get_nil_irep(), ireps_container, and irep_serializationt::ireps_containert::ireps_on_read.

Referenced by irep_serializationt(), and reference_convert().

§ insert_on_write()

std::size_t irep_serializationt::insert_on_write ( std::size_t  h)

inserts an irep into the hashtable

parameters: a size_t and an irep
Returns
true on success, false otherwise

Definition at line 128 of file irep_serialization.cpp.

References ireps_container, and irep_serializationt::ireps_containert::ireps_on_write.

Referenced by irep_serializationt(), and reference_convert().

§ read_gb_string()

irep_idt irep_serializationt::read_gb_string ( std::istream &  in)

reads a string from the stream

parameters: a stream
Returns
a string

Definition at line 226 of file irep_serialization.cpp.

References read_buffer.

Referenced by clear(), read_bin_goto_object_v3(), and read_string_ref().

§ read_gb_word()

std::size_t irep_serializationt::read_gb_word ( std::istream &  in)
static

reads 4 characters and builds a long int from them

parameters: a stream
Returns
a long

Definition at line 188 of file irep_serialization.cpp.

Referenced by clear(), read_bin_goto_object(), read_bin_goto_object_v3(), read_string_ref(), and reference_convert().

§ read_irep()

void irep_serializationt::read_irep ( std::istream &  in,
irept irep 
)
private

§ read_string_ref()

irep_idt irep_serializationt::read_string_ref ( std::istream &  in)

reads a string reference from the stream

parameters: a stream
Returns
a string

Definition at line 271 of file irep_serialization.cpp.

References ireps_container, read_gb_string(), read_gb_word(), and irep_serializationt::ireps_containert::string_rev_map.

Referenced by irep_serializationt(), read_bin_goto_object_v3(), and read_irep().

§ reference_convert() [1/2]

void irep_serializationt::reference_convert ( std::istream &  in,
irept irep 
)

§ reference_convert() [2/2]

§ write_irep()

void irep_serializationt::write_irep ( std::ostream &  out,
const irept irep 
)
private

§ write_string_ref()

void irep_serializationt::write_string_ref ( std::ostream &  out,
const irep_idt s 
)

outputs the string reference

parameters: an output stream and a string
Returns
nothing

Definition at line 250 of file irep_serialization.cpp.

References id2string(), ireps_container, irep_serializationt::ireps_containert::string_map, write_gb_string(), and write_gb_word().

Referenced by irep_serializationt(), write_goto_binary_v3(), and write_irep().

Member Data Documentation

§ ireps_container

ireps_containert& irep_serializationt::ireps_container
private

§ read_buffer

std::vector<char> irep_serializationt::read_buffer
private

Definition at line 80 of file irep_serialization.h.

Referenced by irep_serializationt(), and read_gb_string().


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