Repository navigation
Expand file tree
/
Copy pathSQLPluginList.h
More file actions
118 lines (103 loc) · 3.65 KB
/
Copy pathSQLPluginList.h
File metadata and controls
118 lines (103 loc) · 3.65 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
* SQLPluginList.h
*
* This file is part of the SQLHandler a C++ library to add relational
* database access to the OPeNDAP Hyrax back-end server.
* Copyright (C) 2010 Carlo Cancellieri <ccancellieri@hotmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*
* Created on: 10/Ago/2010
* Author: carlo cancellieri
*/
#ifndef SQLPLUGINLIST_H_
#define SQLPLUGINLIST_H_
#include <string>
#include <BESInternalFatalError.h>
#include "SQLDefinitions.h"
#include "SQLPlugin.h"
class SQLPlugin;
class SQLPluginList {
public:
SQLPluginList() {};
virtual ~SQLPluginList() {};
/**
* update the wrap_count and return
* @param name the name of the function handler
* @oaram add set to true if the counter should be
* increased or to false if should be decreased.
* @return true only if the function handler
* (named 'name') should be deleted.
*/
virtual bool
update_wrap_count(const std::string &name, bool add)
throw(BESInternalFatalError) = 0;
/**
* @brief Used to find an SQLPlugin into the list
* @param name the name of the SQLPlugin to find
* @return a pointer to the found plugin or NULL
* if no SQLPlugin is found.
*/
virtual SQLPlugin *
find_sql_handler(const std::string &name) = 0;
/**
* @brief Remove an SQLPlugin from the list.
* @param name the name of the SQLPlugin to remove
* @return true if remove is correctly completed
*/
virtual bool
remove_sql_handler(const std::string &name) = 0;
/**
* @brief Remove all the SQLPlugin from the list.
*/
virtual void
remove_sql_handlers() = 0;
/**
* @brief Add an SQLPlugin to the list.
* @param name the name of the SQLPlugin to add
* @param handler a new pointer instance to a SQLPlugin
* implementation
* @return true if add is correctly completed
*/
virtual bool
add_sql_handler(const std::string &name, SQLPlugin *handler) = 0;
/**
* @brief Add wrapper for this command, this will enable
* the wrapper to call not predefined commands.
* This method is called by SQLPlugin::add_handler to
* make sure that the added SQLPlugin handler function
* is correctly wrapped by a function in the
* SQLRequestHandler.
* @return 'true' if the 'command' is already wrapped
* 'false' otherwise.
*/
virtual bool
add_sql_wrapper(const std::string &command) = 0;
/**
* @brief test deletion of the wrapper for this command,
* this will check how many handlers are wrapped by this
* command, if _wrap_count is '1' the wrapping function
* is removed.
* This method is called by SQLPlugin::remove_handler to
* make sure that the wrapper for the SQLPlugin function
* is correctly removed.
* @return 'true' if the 'command' is correctly removed
* 'false' otherwise.
*/
virtual bool
remove_sql_wrapper(const std::string &command) = 0;
};
#endif /* SQLPLUGINLIST_H_ */