Classes | Functions
core/vsl/vsl_binary_loader.h File Reference

Loader to do Polymorphic IO. More...

#include <vsl/vsl_binary_io.h>
#include <vsl/vsl_binary_loader_base.h>
#include <vcl_vector.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.
template<class BaseClass >
void vsl_b_write (vsl_b_ostream &bfs, const BaseClass *b)
 Binary file stream output operator for pointer to class.

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

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.

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 106 of file vsl_binary_loader.txx.