aboutsummaryrefslogtreecommitdiff
path: root/src/archival.h
blob: d758f3d6bcf254a90c9da3d0aafefb9718f87256 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
 * Copyright (C) 2007-2008 Xagasoft, All rights reserved.
 *
 * This file is part of the libbu++ library and is released under the
 * terms of the license contained in the file LICENSE.
 */

#ifndef BU_ARCHIVAL_H
#define BU_ARCHIVAL_H

namespace Bu
{
	/**
	 * The base class for any class you want to archive.  Simply include this as
	 * a base class, implement the purely virtual archive function and you've
	 * got an easily archiveable class.
	 *
	 * Archival: "of or pertaining to archives or valuable records; contained
	 * in or comprising such archives or records."
	 */
	class Archival
	{
	public:
		/**
		 * Does nothing, here for completeness.
		 */
		Archival();

		/**
		 * Here to ensure the deconstructor is virtual.
		 */
		virtual ~Archival();

		/**
		 * This is the main workhorse of the archive system, just override and
		 * you've got a archiveable class.  A reference to the 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 Archive object to use.
		 */
		virtual void archive( class Archive &ar )=0;
	};
}

#endif