World Ocean Simulation System (WOSS) library
woss-db-creator.h
Go to the documentation of this file.
1/* WOSS - World Ocean Simulation System -
2 *
3 * Copyright (C) 2009 Federico Guerra
4 * and regents of the SIGNET lab, University of Padova
5 *
6 * Author: Federico Guerra - federico@guerra-tlc.com
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation;
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22/*
23 * This software has been developed by Federico Guerra and SIGNET lab,
24 * University of Padova, in collaboration with the NATO Centre for
25 * Maritime Research and Experimentation (http://www.cmre.nato.int ;
26 * E-mail: pao@cmre.nato.int), whose support is gratefully acknowledged.
27 */
28
29
40#ifndef WOSS_DB_CREATOR_H
41#define WOSS_DB_CREATOR_H
42
43
44#include <string>
45
46
47namespace woss {
48
49
50 class WossDb;
51
52
65
66
67 public:
68
69
74
75 virtual ~WossDbCreator();
76
77
83 virtual WossDb* const createWossDb() = 0;
84
85
86 WossDbCreator& setDebug( bool flag ) { debug = flag; return *this; }
87
88 WossDbCreator& setWossDebug( bool flag ) { woss_db_debug = flag; return *this; }
89
90
91 WossDbCreator& setDbPathName( const ::std::string& name ) { pathname = name; return *this; }
92
93
94 bool isUsingDebug() const { return debug; }
95
96 bool isUsingWossDbDebug() const { return woss_db_debug; }
97
98
99 ::std::string getDbPathName() const { return pathname; }
100
101
102 protected:
103
104
108 bool debug;
109
114
115
119 ::std::string pathname;
120
121
127 virtual bool initializeDb( WossDb* const woss_db ) = 0;
128
129
130 };
131
132
133}
134
135
136#endif /* WOSS_DB_CREATOR_H */
137
138
Abstract class that provides the interface of database creator ( Factory object )
Definition woss-db-creator.h:64
bool woss_db_debug
Definition woss-db-creator.h:113
virtual bool initializeDb(WossDb *const woss_db)=0
Definition woss-db-creator.cpp:61
virtual WossDb *const createWossDb()=0
WossDbCreator()
Definition woss-db-creator.cpp:47
::std::string pathname
Definition woss-db-creator.h:119
bool debug
Definition woss-db-creator.h:108
Abstract class that provides the interface of databases.
Definition woss-db.h:89