| Qore DataProvider Module Reference 2.3

DataProvider.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3
27 namespace DataProvider {
29 class DataProvider {
30
31 public:
33 const FactoryMap = ...;
34
35
37 const TypeMap = ...;
38
39
41 const FactoryModuleList = keys (map {$1: True}, FactoryMap.iterator());
42 // "map" is used above to ensure that the values only appear once in the final list
43
44 protected:
46 static hash<string, AbstractDataProviderFactory> factory_cache;
47
49 static hash<string, string> factory_module_map;
50
52 static Mutex factory_cache_lock();
53
55 static DataProviderTypeCache type_cache();
56
58 static hash<string, string> type_module_map;
59
61
63 static bool allow_env_config = False;
64
66 static bool env_config_locked = False;
67
69 static hash<string, bool> mod_map;
70
71 public:
72
74
78 static registerFactory(AbstractDataProviderFactory factory);
79
81 static *AbstractDataProviderFactory getFactory(string name);
82
84
90 static AbstractDataProviderFactory getFactoryEx(string name);
91
93
98 static AbstractDataProvider getFactoryObject(string path, *hash<auto> options);
99
101
110 static AbstractDataProvider getFactoryObjectFromString(string name);
111
113
122 static AbstractDataProvider getFactoryObjectFromStringUseEnv(string name);
123
125 protected:
126 static hash<FactoryInfo> getFactoryInfoFromString(string name);
127 public:
128
129
131 static *list<string> listFactories();
132
134 static DataProviderTypeCache getTypeCache();
135
137
145 static registerType(string path, AbstractDataProviderType type);
146
148
155 static *AbstractDataProviderType getType(string path);
156
158
167 static AbstractDataProviderType getTypeEx(string path);
168
170 static DataProviderTypeEntry getTypeRoot();
171
173 static lockAllTypes();
174
176
180 static *list<string> listTypes();
181
183 static registerKnownFactories();
184
186 static loadProvidersFromEnvironment();
187
189 static *AbstractDataProvider tryLoadProviderForConnectionFromEnv(string name);
190
192 static registerKnownTypes();
193
195 static loadTypesFromEnvironment();
196
198
201 static hash<auto> getInfoAsData(hash<auto> info0, *bool with_type_info);
202
204
208 static setAutoConfig();
209
211 static bool getAutoConfig();
212
214 static list<string> getPathList(string path);
215
217 protected:
218 static checkRequest();
219 public:
220
221
223 protected:
224 static *string tryGetFactoryModuleName(string name);
225 public:
226
227
229 protected:
230 static *string tryGetTypeModuleName(string name);
231 public:
232
233
235 protected:
236 static *string tryGetModuleName(string name, string func, string type);
237 public:
238
239
241 protected:
242 static *DataProviderTypeEntry tryLoadTypeFromPath(list<string> type_path);
243 public:
244
245
247 protected:
248 static bool tryLoad(string module_str, *bool verbose);
249 public:
250
251
253 protected:
254 static *object loadFromEnvironment(string func, string type, *hash<SymbolInfo> info);
255 public:
256
257
259 protected:
260 static *object checkSymbol(hash<SymbolInfo> info);
261 public:
262
263
265 protected:
266 static bool checkInjection(object obj, hash<string, string> module_map);
267 public:
268
269 };
270
271 // private hashdecls
272 hashdecl SymbolInfo {
273 // symbol type
274 string type;
275 // symbol name
276 string name;
277 }
278 hashdecl FactoryInfo {
279 // factory name
280 string name;
281 // path to final data provider in factory
282 list<string> path_list;
283 // factory options
284 auto options;
285 }
286 }
DataProvider::AbstractDataProviderFactory
Data provider factory class.
Definition: AbstractDataProviderFactory.qc.dox.h:58
DataProvider::AbstractDataProvider
The AbstractDataProvider class.
Definition: AbstractDataProvider.qc.dox.h:476
DataProvider::AbstractDataProviderType
describes a data type
Definition: AbstractDataProviderType.qc.dox.h:112
DataProvider::DataProvider::getPathList
static list< string > getPathList(string path)
Returns a list of strings in a path separated by "/" characters.
DataProvider::DataProvider::getType
static *AbstractDataProviderType getType(string path)
Returns the given data provider type or NOTHING if not present.
DataProvider::DataProvider::getTypeEx
static AbstractDataProviderType getTypeEx(string path)
Returns the given data provider type or throws an exception if not present.
DataProvider::DataProvider::registerKnownFactories
static registerKnownFactories()
Registers all known data provider factories.
DataProvider::DataProvider::tryLoadTypeFromPath
static *DataProviderTypeEntry tryLoadTypeFromPath(list< string > type_path)
Tries to load the given type.
DataProvider::DataProvider::setAutoConfig
static setAutoConfig()
Sets the flag that allows for automatic configuration from environment variables.
DataProvider::DataProvider::getFactoryObjectFromString
static AbstractDataProvider getFactoryObjectFromString(string name)
Returns a data provider object from the given factory string.
DataProvider::DataProvider::checkRequest
static checkRequest()
Sets the env_config_locked variable if not already set.
DataProvider::DataProvider::listFactories
static *list< string > listFactories()
Returns a list of registered data provider factories.
DataProvider::DataProvider::registerFactory
static registerFactory(AbstractDataProviderFactory factory)
Register a new data provider factory.
DataProvider::DataProvider::getFactory
static *AbstractDataProviderFactory getFactory(string name)
Returns the given data provider factory or NOTHING if not present.
DataProvider::DataProvider::getFactoryEx
static AbstractDataProviderFactory getFactoryEx(string name)
Returns the given data provider factory or throws an exception if not present.
DataProvider::DataProvider::factory_cache_lock
static Mutex factory_cache_lock()
data provider factory cache lock
DataProvider::DataProvider::loadProvidersFromEnvironment
static loadProvidersFromEnvironment()
Loads data providers from the environment.
DataProvider::DataProvider::getTypeCache
static DataProviderTypeCache getTypeCache()
Returns the data provider cache.
DataProvider::DataProvider::registerType
static registerType(string path, AbstractDataProviderType type)
Register a new data provider type.
DataProvider::DataProvider::getFactoryObjectFromStringUseEnv
static AbstractDataProvider getFactoryObjectFromStringUseEnv(string name)
Returns a data provider object from the given factory string using environment variables to find the ...
DataProvider::DataProvider::getFactoryInfoFromString
static hash< FactoryInfo > getFactoryInfoFromString(string name)
Returns a hash of factory information from a string.
DataProvider::DataProvider::tryGetModuleName
static *string tryGetModuleName(string name, string func, string type)
Tries to load a module corresponding to the given factory.
DataProvider::DataProvider::checkInjection
static bool checkInjection(object obj, hash< string, string > module_map)
Check if the object is from a module that has been subject to dependency injections.
DataProvider::DataProvider::type_module_map
static hash< string, string > type_module_map
data provider type module map
Definition: DataProvider.qc.dox.h:58
DataProvider::DataProvider::listTypes
static *list< string > listTypes()
Returns a list of registered data provider type paths.
DataProvider::DataProvider::getInfoAsData
static hash< auto > getInfoAsData(hash< auto > info0, *bool with_type_info)
Converts an info hash with objects to a hash with string descriptions instead of the objects.
DataProvider::DataProvider::loadTypesFromEnvironment
static loadTypesFromEnvironment()
Loads data types from the environment.
DataProvider::DataProvider::factory_cache
static hash< string, AbstractDataProviderFactory > factory_cache
data provider factory cache
Definition: DataProvider.qc.dox.h:46
DataProvider::DataProvider::checkSymbol
static *object checkSymbol(hash< SymbolInfo > info)
Returns True if an object of the given type has been loaded.
DataProvider::DataProvider::type_cache
static DataProviderTypeCache type_cache()
data provider data type cache
DataProvider::DataProvider::tryLoad
static bool tryLoad(string module_str, *bool verbose)
Try to load the given module.
DataProvider::DataProvider::getTypeRoot
static DataProviderTypeEntry getTypeRoot()
Returns the root type entry.
DataProvider::DataProvider::registerKnownTypes
static registerKnownTypes()
Registers all known data provider types.
DataProvider::DataProvider::lockAllTypes
static lockAllTypes()
Locks all types.
DataProvider::DataProvider::tryLoadProviderForConnectionFromEnv
static *AbstractDataProvider tryLoadProviderForConnectionFromEnv(string name)
Tries to load a data provider from the environment from the connection name.
DataProvider::DataProvider::mod_map
static hash< string, bool > mod_map
set of module already loaded
Definition: DataProvider.qc.dox.h:69
DataProvider::DataProvider::getFactoryObject
static AbstractDataProvider getFactoryObject(string path, *hash< auto > options)
Returns a data provider object from the given factory, created with the given constructor options.
DataProvider::DataProvider::tryGetTypeModuleName
static *string tryGetTypeModuleName(string name)
Tries to load a module corresponding to the given factory.
DataProvider::DataProvider::factory_module_map
static hash< string, string > factory_module_map
data provider factory module map
Definition: DataProvider.qc.dox.h:49
DataProvider::DataProvider::getAutoConfig
static bool getAutoConfig()
Returns the auto config flag.
DataProvider::DataProvider::loadFromEnvironment
static *object loadFromEnvironment(string func, string type, *hash< SymbolInfo > info)
Loads modules from the QORE_DATA_PROVIDERS environment variable.
DataProvider::DataProvider::tryGetFactoryModuleName
static *string tryGetFactoryModuleName(string name)
Tries to load a module corresponding to the given factory.
DataProvider::DataProviderTypeCache
Data provider type cache class.
Definition: DataProviderTypeCache.qc.dox.h:29
DataProvider::DataProviderTypeEntry
the DataProviderTypeEntry class
Definition: DataProviderTypeEntry.qc.dox.h:55
True
const True
False
const False
type
string type(auto arg)
DataProvider
Qore AbstractDataField class definition.
Definition: AbstractDataField.qc.dox.h:27