World Ocean Simulation System (WOSS) library
woss-controller.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_CONTROLLER_H
41#define WOSS_CONTROLLER_H
42
43
44#include <cassert>
46
47
48namespace woss {
49
50
51 class WossDbCreator;
52 class WossCreator;
53 class WossDbManager;
54 class WossManager;
55 class TransducerHandler;
56
57
65
66
67 public:
68
69
74
79
84
85
89 virtual ~WossController();
90
91
95 bool initialize();
96
97
98 WossController& setBathymetryDbCreator( WossDbCreator* const ptr ) { bathymetry_db_creator = ptr; return *this; }
99
100 WossController& setSedimentDbCreator( WossDbCreator* const ptr ) { sediment_db_creator = ptr; return *this; }
101
102 WossController& setSSPDbCreator( WossDbCreator* const ptr ) { ssp_db_creator = ptr; return *this; }
103
104 WossController& setPressureDbCreator( WossDbCreator* const ptr ) { pressure_result_db_creator = ptr; return *this; }
105
106 WossController& setTimeArrDbCreator( WossDbCreator* const ptr ) { timearr_result_db_creator = ptr; return *this; }
107
108 WossController& setWossCreator( WossCreator* const ptr ) { woss_creator = ptr; return *this; }
109
110 WossController& setWossDbManager( WossDbManager* const ptr ) { woss_db_manager = ptr; return *this; }
111
112 WossController& setWossManager( WossManager* const ptr ) { woss_manager = ptr; return *this; }
113
114 WossController& setTransducerHandler( TransducerHandler* const ptr ) { transducer_handler = ptr; return *this; }
115
116 void setDebug( bool flag) { debug = flag;}
117
118 const WossDbCreator* const getBathymetryDbCreator() const { assert(initialized); return bathymetry_db_creator; }
119
120 const WossDbCreator* const getSedimentDbCreator() const { assert(initialized); return sediment_db_creator; }
121
122 const WossDbCreator* const getSSPDbCreator() const { assert(initialized); return ssp_db_creator; }
123
124 const WossDbCreator* const getPressureDbCreator() const { assert(initialized); return pressure_result_db_creator; }
125
126 const WossDbCreator* const getTimeArrDbCreator() const { assert(initialized); return timearr_result_db_creator; }
127
128 const WossCreator* const getWossCreator() const { assert(initialized); return woss_creator; }
129
130 const WossDbManager* const getWossDbManager() const { assert(initialized); return woss_db_manager; }
131
132 WossManager* const getWossManager() const { assert(initialized); return woss_manager; }
133
134 TransducerHandler* const getTransducerHandler() const { assert(initialized); return transducer_handler; }
135
136 bool getDebug() const { return debug; }
137
138 protected:
139
140
144 double debug;
145
150
151
152 WossDbCreator* bathymetry_db_creator;
153
154 WossDbCreator* sediment_db_creator;
155
156 WossDbCreator* ssp_db_creator;
157
158 WossDbCreator* pressure_result_db_creator;
159
160 WossDbCreator* timearr_result_db_creator;
161
162 WossCreator* woss_creator;
163
164 WossDbManager* woss_db_manager;
165
166 WossManager* woss_manager;
167
168 TransducerHandler* transducer_handler;
169
170
171 };
172
173
180
181
182}
183
184
185#endif /* WOSS_CONTROLLER_H */
186
Singleton design pattern template.
Definition singleton-definitions.h:54
Transducer creator and handler class.
Definition transducer-handler.h:63
Class for managing all WOSS classes involved.
Definition woss-controller.h:64
bool initialized
Definition woss-controller.h:149
WossController & operator=(WossController &copy)
Definition woss-controller.cpp:109
double debug
Definition woss-controller.h:144
virtual ~WossController()
Definition woss-controller.cpp:70
bool initialize()
Definition woss-controller.cpp:139
WossController()
Definition woss-controller.cpp:53
Abstract class that provides correctly initialized Woss objects.
Definition woss-creator.h:65
Abstract class that provides the interface of database creator ( Factory object )
Definition woss-db-creator.h:64
Abstraction layer for database and data manipulation.
Definition woss-db-manager.h:84
Abstract class that interfaces Pressure or TimeArr requests from user layer.
Definition woss-manager.h:93
Definitions of woss::Singleton template.