ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/include/ermyth/database.h
Revision: 1.3
Committed: Sun Sep 16 18:54:42 2007 UTC (16 years, 8 months ago) by pippijn
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +5 -5 lines
Log Message:
#defines to enum

File Contents

# Content
1 /**
2 * database.h: Modular database support
3 *
4 * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team
5 * Rights to this code are as documented in doc/pod/gplicense.pod.
6 *
7 * $Id: database.h,v 1.2 2007-09-05 11:23:13 pippijn Exp $
8 */
9
10 #ifndef ERMYTH_DATABASE_H
11 #define ERMYTH_DATABASE_H
12
13 #include <ermyth/factory.h>
14
15 namespace database
16 {
17 struct handler
18 {
19 /* global.C */
20 static bool loaded;
21
22 handler ()
23 {
24 loaded = true;
25 }
26
27 virtual ~handler ()
28 {
29 loaded = false;
30 }
31
32 virtual void save () = 0;
33 virtual void load () = 0;
34 };
35 }
36
37 #define FACREG_TYPE database::handler
38 #define FACREG_TYPE_NAME "database_handler"
39 #define FACREG_TYPE_IS_ABSTRACT
40 #include <ermyth/factory_reg.h>
41
42 /* global.C */
43 E database::handler *backend;
44
45 /* Check the database for (version) problems common to all backends */
46 E void db_check (void);
47
48 #endif