#include <ClassLoader.h>
Public Member Functions | |
template<class T> | |
void | register_class (ClassLoader< T > *loader) |
register a class so we may load data from it. | |
template<class T> | |
boost::shared_ptr< T > | load_object (std::istream &source) |
Load an object from a stream. | |
template<class T> | |
void | write_object (std::ostream &destination, const T &object) |
Write an object so that it can be loaded again without knowing the type. | |
template<class T> | |
void | fill_vector (std::istream &source, std::vector< boost::shared_ptr< T > > &vector) |
Load many objects from a stream. | |
template<class Container> | |
void | write_vector (std::ostream &destination, const Container &vector) |
Write many objects to a stream. | |
Static Public Member Functions | |
static SaveableClassList * | get_instance () |
Get the instance of the class. | |
Private Member Functions | |
SaveableClassList () | |
SaveableClassList (const SaveableClassList &source) | |
bool | operator= (const SaveableClassList &source) |
Private Attributes | |
std::map< std::string, ClassLoaderBase * > | loaders |
This is a singleton object, you may access the single instance with get_instance(). To register a class to be loaded in this manner, make a global ClassLoader.
Definition at line 70 of file ClassLoader.h.
Track::SaveableClassList::SaveableClassList | ( | ) | [private] |
Definition at line 30 of file ClassLoader.cpp.
Track::SaveableClassList::SaveableClassList | ( | const SaveableClassList & | source | ) | [private] |
void Track::SaveableClassList::fill_vector | ( | std::istream & | source, | |
std::vector< boost::shared_ptr< T > > & | vector | |||
) | [inline] |
SaveableClassList * Track::SaveableClassList::get_instance | ( | ) | [static] |
boost::shared_ptr<T> Track::SaveableClassList::load_object | ( | std::istream & | source | ) | [inline] |
bool Track::SaveableClassList::operator= | ( | const SaveableClassList & | source | ) | [private] |
void Track::SaveableClassList::register_class | ( | ClassLoader< T > * | loader | ) | [inline] |
void Track::SaveableClassList::write_object | ( | std::ostream & | destination, | |
const T & | object | |||
) | [inline] |
Write an object so that it can be loaded again without knowing the type.
Requires the class will return the identifier it's ClassLoader uses with a function std::string get_class_identifier(), and will work with operator<< to streams.
Definition at line 128 of file ClassLoader.h.
void Track::SaveableClassList::write_vector | ( | std::ostream & | destination, | |
const Container & | vector | |||
) | [inline] |
Write many objects to a stream.
Container should store boost::shared_ptrs to the type of object you wish to save. It should follow the forward container concept from the standard template library.
Definition at line 168 of file ClassLoader.h.
std::map<std::string, ClassLoaderBase *> Track::SaveableClassList::loaders [private] |
Definition at line 181 of file ClassLoader.h.
Generated at Mon Sep 6 00:41:18 2010 by Doxygen version 1.4.7 for Racer version svn335.