An adapter for a std::ifstream to make it suitable for binary IO. More...
#include <vsl_binary_io.h>

Public Member Functions | |
| vsl_b_ifstream (const std::string &filename, std::ios::openmode mode=std::ios::in) | |
| Create this adaptor from a file. More... | |
| vsl_b_ifstream (const char *filename, std::ios::openmode mode=std::ios::in) | |
| Create this adaptor from a file. More... | |
| ~vsl_b_ifstream () override | |
| Virtual destructor.so that it can be overloaded. More... | |
| void | close () |
| Close the stream. More... | |
| std::istream & | is () const |
| A reference to the adaptor's stream. More... | |
| bool | operator! () const |
| Returns true if the underlying stream has its fail bit set. More... | |
| virtual void | clear_serialisation_records () |
| Clear the stream's record of any serialisation operations. More... | |
| virtual void | add_serialisation_record (unsigned long serial_number, void *pointer, int other_data=0) |
| Adds record of object's unique serial number, and location in memory. More... | |
| virtual void * | get_serialisation_pointer (unsigned long serial_number) const |
| Returns the pointer to the object identified by the unique serial number. More... | |
| virtual int | get_serialisation_other_data (unsigned long serial_number) const |
| Returns the user defined data associated with the unique serial number. More... | |
| virtual int | set_serialisation_other_data (unsigned long serial_number, int other_data) |
| Modify the user-defined data associated with the unique serial number. More... | |
| unsigned short | version_no () const |
| Return the version number of the IO format of the file being read. More... | |
Protected Types | |
| typedef std::map< unsigned long, std::pair< void *, int >, std::less< unsigned long > > | serialisation_records_type |
| The type of the serialisation records. More... | |
Protected Attributes | |
| std::istream * | is_ |
| The member stream. More... | |
| serialisation_records_type | serialisation_records_ |
| The serialisation records,. More... | |
| unsigned short | version_no_ |
An adapter for a std::ifstream to make it suitable for binary IO.
Definition at line 238 of file vsl_binary_io.h.
|
protectedinherited |
The type of the serialisation records.
Definition at line 224 of file vsl_binary_io.h.
|
inline |
Create this adaptor from a file.
The adapter will delete the stream automatically on destruction.
Definition at line 243 of file vsl_binary_io.h.
|
inline |
Create this adaptor from a file.
The adapter will delete the stream automatically on destruction.
Definition at line 249 of file vsl_binary_io.h.
|
override |
Virtual destructor.so that it can be overloaded.
destructor.so that it can be overloaded.
Definition at line 453 of file vsl_binary_io.cxx.
|
virtualinherited |
Adds record of object's unique serial number, and location in memory.
pointer must be non-null, so you should handle null pointers separately.
Adding a null pointer or one that already exists will cause the function to abort(), if debugging is turned on;
You can also store a single integer as other data. Interpretation of this data is entirely up to the client code.
Definition at line 394 of file vsl_binary_io.cxx.
|
virtualinherited |
Clear the stream's record of any serialisation operations.
Calling this function while inputting serialisable things from a stream, could cause errors during loading unless the records were cleared at a similar point during output.
Definition at line 381 of file vsl_binary_io.cxx.
| void vsl_b_ifstream::close | ( | ) |
Close the stream.
Definition at line 459 of file vsl_binary_io.cxx.
|
virtualinherited |
Returns the user defined data associated with the unique serial number.
Returns 0 if no record has been added.
Definition at line 421 of file vsl_binary_io.cxx.
|
virtualinherited |
Returns the pointer to the object identified by the unique serial number.
Returns 0 if no record has been added.
Definition at line 404 of file vsl_binary_io.cxx.
|
inherited |
A reference to the adaptor's stream.
Definition at line 358 of file vsl_binary_io.cxx.
|
inherited |
Returns true if the underlying stream has its fail bit set.
Definition at line 372 of file vsl_binary_io.cxx.
|
virtualinherited |
Modify the user-defined data associated with the unique serial number.
If there is no record of the object, this function will abort.
Definition at line 438 of file vsl_binary_io.cxx.
|
inherited |
Return the version number of the IO format of the file being read.
Definition at line 366 of file vsl_binary_io.cxx.
|
protectedinherited |
The member stream.
Definition at line 220 of file vsl_binary_io.h.
|
protectedinherited |
The serialisation records,.
The record takes a unique identifier of the object (which would be stored on the stream) and returns the pointer to the object, and an other_data integer.
Definition at line 230 of file vsl_binary_io.h.
|
protectedinherited |
Definition at line 233 of file vsl_binary_io.h.
1.8.15