Loader to do Polymorphic IO. More...
Go to the source code of this file.
Classes | |
class | vsl_binary_loader< BaseClass > |
Class to load objects by baseclass pointer. More... | |
Functions | |
template<class BaseClass > | |
void | vsl_b_read (vsl_b_istream &bfs, BaseClass *&b) |
Loads object and sets base class pointer. | |
template<class BaseClass > | |
void | vsl_b_write (vsl_b_ostream &bfs, const BaseClass *b) |
Binary file stream output operator for pointer to class. |
Loader to do Polymorphic IO.
You should include this file if you want to do polymorphic IO (i.e. save a class by its base-class pointer.)
Definition in file vsl_binary_loader.h.
void vsl_b_read | ( | vsl_b_istream & | bfs, |
BaseClass *& | b | ||
) | [inline] |
Loads object and sets base class pointer.
Determines which derived class object on bfs belongs to, loads it and sets b to be a pointer to it. (Class must be one given to Loader by the append method). If bfs indicates a NULL pointer, b will be set to NULL. If b not initially NULL, *b will be deleted.
Definition at line 95 of file vsl_binary_loader.h.
void vsl_b_write | ( | vsl_b_ostream & | bfs, |
const BaseClass * | b | ||
) |
Binary file stream output operator for pointer to class.
This works correctly even if b is a NULL pointer
Definition at line 106 of file vsl_binary_loader.txx.