From f4c20290509d7ed3a8fd5304577e7a4cc0b9d974 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 3 Apr 2007 03:49:53 +0000 Subject: Ok, no code is left in src, it's all in src/old. We'll gradually move code back into src as it's fixed and re-org'd. This includes tests, which, I may write a unit test system into libbu++ just to make my life easier. --- src/old/serializable.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/old/serializable.h (limited to 'src/old/serializable.h') diff --git a/src/old/serializable.h b/src/old/serializable.h new file mode 100644 index 0000000..06def29 --- /dev/null +++ b/src/old/serializable.h @@ -0,0 +1,34 @@ +#ifndef SERIALIZER_H +#define SERIALIZER_H + +//#include "serializer.h" + +/** + * The base class for any class you want to serialize. Simply include this as + * a base class, implement the purely virtual serialize function and you've got + * an easily serializable class. + */ +class Serializable +{ +public: + /** + * Does nothing, here for completeness. + */ + Serializable(); + + /** + * Here to ensure the deconstructor is virtual. + */ + virtual ~Serializable(); + + /** + * This is the main workhorse of the serialization system, just override and + * you've got a serializable class. A reference to the Serializer archive + * used is passed in as your only parameter, query it to discover if you are + * loading or saving. + * @param ar A reference to the Serializer object to use. + */ + virtual void serialize( class Serializer &ar )=0; +}; + +#endif -- cgit v1.2.3