2 #ifndef vsl_binary_loader_h_ 3 #define vsl_binary_loader_h_ 16 # include <vcl_msvc_warnings.h> 48 template<
class BaseClass>
71 void add(
const BaseClass& b) {
object_.push_back(b.clone());}
84 std::string
is_a()
const;
94 template<
class BaseClass>
102 template<
class BaseClass>
105 #endif // vsl_binary_loader_h_ A binary output adaptor for any std::ostream.
static vsl_binary_loader< BaseClass > & instance()
Returns the instance variable for the singleton.
void vsl_b_read(vsl_b_istream &bfs, BaseClass *&b)
Loads object and sets base class pointer.
void add(const BaseClass &b)
Add example object to list of those that can be loaded.
static vsl_binary_loader< BaseClass > * instance_
the singleton object.
void vsl_b_write(vsl_b_ostream &bfs, const BaseClass *b)
Binary file stream output operator for pointer to class.
const std::vector< BaseClass * > & object()
Return current list of class objects which can be loaded.
Base class for vsl_binary_loader objects.
Class to load objects by baseclass pointer.
void make_empty()
Remove all example objects.
vsl_binary_loader()=default
Constructor.
An adaptor for any std::istream to make it suitable for binary input.
std::vector< BaseClass * > object_
List of concrete classes that this loader can deal with.
Set of functions, and objects to perform binary IO.
~vsl_binary_loader() override
Destructor.
void load_object(vsl_b_istream &is, BaseClass *&b)
Loads object and sets base class pointer.