MAK Data Logger API Documentation for HLA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
databaseDriverFactory.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 1992-2024 MAK Technologies, Inc
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
9 #ifndef databaseDriverFactory_H_
10 #define databaseDriverFactory_H_
11 
12 #include "vlDatabase.h"
13 
14 #include <map>
15 #include <vlutil/vlMutex.h>
16 #include <vector>
17 
18 class DtString;
19 
20 class DtDatabaseDriver;
21 
24 {
25 public:
28 
30  static std::vector<DtString> getInstalledDrivers();
31 
34  static const DtDatabaseDriver* getDriver(const DtString& driverName);
35 
40  static void registerDriver(DtDatabaseDriver* driver);
41 
45  static void replaceDriver(DtDatabaseDriver* driver);
46 
48  static std::vector<DtString> getDataSources(const DtString& driver);
49 
50 private:
55 
56 
57 protected:
58 
60  static DtDatabaseDriverFactory* acquire();
61 
63  static void release();
64 
66  explicit DtDatabaseDriverFactory();
67 
69  DtDatabaseDriver* lookupDriverByName(const DtString& driverName);
70 
73  bool registerDriver(DtDatabaseDriver* driver,bool allowReplace);
74 
75  static DtMutex theFactoryMutex;
77 
78  typedef std::map<DtString,DtDatabaseDriver*> DriverMap;
80 };
81 
82 #endif
A Static interface for creating Database drivers.
Definition: databaseDriverFactory.h:23
An abstract database driver which provides a set of objects for a given database type.
Definition: databaseDriver.h:24
Contains DLL macros.
std::map< DtString, DtDatabaseDriver * > DriverMap
Definition: databaseDriverFactory.h:78
static DtDatabaseDriverFactory theDriverFactory
Definition: databaseDriverFactory.h:76
static DtMutex theFactoryMutex
Definition: databaseDriverFactory.h:75
#define DT_DLL_VLDB
Definition: vlDatabase.h:20
DriverMap myDriverMap
Definition: databaseDriverFactory.h:79

Document ID: Generated on Thu Oct 3 15:35:11 EDT 2024 from SVN revision 270037
Copyright © 2024 MAK Technologies. All Rights Reserved (www.mak.com)