Fawkes API  Fawkes Development Version
mongodb_conncreator.h
1 
2 /***************************************************************************
3  * mongodb_conncreator.h - Fawkes MongoDB connection creator
4  *
5  * Created: Mon Dec 06 21:20:16 2010
6  * Copyright 2006-2010 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __PLUGINS_MONGODB_ASPECT_MONGODB_CONNCREATOR_H_
25 #define __PLUGINS_MONGODB_ASPECT_MONGODB_CONNCREATOR_H_
26 
27 namespace mongo {
28  class DBClientBase;
29 }
30 
31 namespace fawkes {
32 #if 0 /* just to make Emacs auto-indent happy */
33 }
34 #endif
35 
36 /** @class MongoDBConnCreator <plugins/mongodb/aspect/mongodb_conncreator.h>
37  * Interface for a MongoDB connection creator.
38  * @author Tim Niemueller
39  */
41 {
42  public:
43  /** Create a new MongoDB client.
44  * @param config_name MongoDB client configuration name for the desired
45  * connection. May be 0 in which case the default configuration is used.
46  * @return MongoDB client for the given (or the default) configuration.
47  * @exception thrown if the initialization fails or the configuration for
48  * the given name does not exist.
49  */
50  virtual mongo::DBClientBase * create_client(const char *config_name = 0) = 0;
51 
52  /** Delete a client.
53  * @param client client to delete
54  */
55  virtual void delete_client(mongo::DBClientBase *client) = 0;
56 };
57 
58 } // end namespace fawkes
59 
60 #endif
Fawkes library namespace.
Definition: mongodb.h:29
Interface for a MongoDB connection creator.