Classes | Functions
vsl_binary_loader.h File Reference

Loader to do Polymorphic IO. More...

#include <vector>
#include <vsl/vsl_binary_io.h>
#include <vsl/vsl_binary_loader_base.h>

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. More...
 
template<class BaseClass >
void vsl_b_write (vsl_b_ostream &bfs, const BaseClass *b)
 Binary file stream output operator for pointer to class. More...
 

Detailed Description

Loader to do Polymorphic IO.

Author
Ian Scott, Tim Cootes (Manchester) March 2001

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.

Function Documentation

◆ vsl_b_read()

template<class BaseClass >
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.

◆ vsl_b_write()

template<class BaseClass >
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 86 of file vsl_binary_loader.hxx.