Qore DataProvider Module Reference 2.7.5
|
Data provider type cache class. More...
#include <DataProviderTypeCache.qc.dox.h>
Public Member Methods | |
clear () | |
Clears the type hierarchy of all non-locked types. | |
bool | empty () |
Returns True if the cache is empty, False if not. | |
RWLock | getLock () |
Returns the RWLock to allow for external serialization. | |
DataProviderTypeEntry | getRoot () |
Returns the root type entry. | |
*AbstractDataProviderType | getType (string path) |
Returns the given data provider type or NOTHING if not present. More... | |
AbstractDataProviderType | getTypeEx (string path) |
Returns the given data provider type or throws an exception if not present. More... | |
*AbstractDataProviderType | getTypeImpl (string path, bool throw_exception, *code type_loader) |
Returns the given data provider type and either throws an exception if not present or returns NOTHING. More... | |
*hash< DataProviderTypeEntryInfo > | getTypeInfo (string path, *bool rec_children_only) |
Returns the given data provider type or NOTHING if not present. More... | |
hash< DataProviderTypeEntryInfo > | getTypeInfoEx (string path, *bool rec_children_only) |
Returns the given data provider type or throws an exception if not present. More... | |
*hash< DataProviderTypeEntryInfo > | getTypeInfoImpl (string path, bool throw_exception, *bool rec_children_only) |
Returns information for the given data provider type and either throws an exception if not present or returns NOTHING. More... | |
*list< string > | listParentTypes () |
Returns a list of registered data provider type paths where the types are "parent" types. More... | |
*list< string > | listTypes () |
Returns a list of registered data provider type paths. More... | |
lockAll () | |
Locks all types. | |
bool | registerOrReplaceType (string path, AbstractDataProviderType type) |
Register or replaces a data provider type in the cache. More... | |
registerType (string path, AbstractDataProviderType type, bool locked=False) | |
Register a new data provider type in the cache. More... | |
*AbstractDataProviderType | removeType (string path) |
Removes a type from the type cache. More... | |
int | size () |
Returns the number of types in the cache. | |
Private Member Methods | |
DataProviderTypeEntry | root () |
Data provider data type cache. | |
transient RWLock | rwlock () |
Data provider type cache lock. | |
Static Private Member Methods | |
static *AbstractDataProviderType | getTypeFromFields (string path, AbstractDataProviderType type, list< string > type_path, bool throw_exception) |
Returns the given data provider type and either throws an exception if not present or returns NOTHING. More... | |
Private Attributes | |
int | size = 0 |
The size of the cache. | |
Data provider type cache class.
*AbstractDataProviderType DataProvider::DataProviderTypeCache::getType | ( | string | path | ) |
Returns the given data provider type or NOTHING if not present.
path | a "/" separated path for the type; trailing path elements can be a path into fields |
AbstractDataProviderType DataProvider::DataProviderTypeCache::getTypeEx | ( | string | path | ) |
Returns the given data provider type or throws an exception if not present.
path | a "/" separated path for the type; trailing path elements can be a path into fields |
PROVIDER-ERROR | the given data provider type path is unknown |
|
staticprivate |
Returns the given data provider type and either throws an exception if not present or returns NOTHING.
path | a "/" separated path for the type |
type | the base type for the search |
type_path | the path in the type for fields leading to the final return type |
throw_exception | if True then an exception is thrown if the path cannot be resolved, otherwise NOTHING is returned |
PROVIDER-ERROR | the given data provider type path is unknown; only thrown if the throw_exception argument is True |
*AbstractDataProviderType DataProvider::DataProviderTypeCache::getTypeImpl | ( | string | path, |
bool | throw_exception, | ||
*code | type_loader | ||
) |
Returns the given data provider type and either throws an exception if not present or returns NOTHING.
path | a "/" separated path for the type |
throw_exception | if True then an exception is thrown if the path cannot be resolved, otherwise NOTHING is returned |
type_loader | a closure taking a list of strings giving the full path to the type and returning *AbstractDataProviderType |
PROVIDER-ERROR | the given data provider type path is unknown; only thrown if the throw_exception argument is True |
*hash< DataProviderTypeEntryInfo > DataProvider::DataProviderTypeCache::getTypeInfo | ( | string | path, |
*bool | rec_children_only | ||
) |
Returns the given data provider type or NOTHING if not present.
path | a "/" separated path for the type; trailing path elements can be a path into fields |
rec_children_only | if True, then only children with fields are returned |
hash< DataProviderTypeEntryInfo > DataProvider::DataProviderTypeCache::getTypeInfoEx | ( | string | path, |
*bool | rec_children_only | ||
) |
Returns the given data provider type or throws an exception if not present.
path | a "/" separated path for the type; trailing path elements can be a path into fields |
rec_children_only | if True, then only children with fields are returned |
PROVIDER-ERROR | the given data provider type path is unknown |
*hash< DataProviderTypeEntryInfo > DataProvider::DataProviderTypeCache::getTypeInfoImpl | ( | string | path, |
bool | throw_exception, | ||
*bool | rec_children_only | ||
) |
Returns information for the given data provider type and either throws an exception if not present or returns NOTHING.
path | a "/" separated path for the type |
throw_exception | if True then an exception is thrown if the path cannot be resolved, otherwise NOTHING is returned |
rec_children_only | if True, then only children with fields are returned |
PROVIDER-ERROR | the given data provider type path is unknown; only thrown if the throw_exception argument is True |
*list< string > DataProvider::DataProviderTypeCache::listParentTypes | ( | ) |
Returns a list of registered data provider type paths where the types are "parent" types.
"Parent" types are types where children were added with the parent
*list< string > DataProvider::DataProviderTypeCache::listTypes | ( | ) |
Returns a list of registered data provider type paths.
bool DataProvider::DataProviderTypeCache::registerOrReplaceType | ( | string | path, |
AbstractDataProviderType | type | ||
) |
Register or replaces a data provider type in the cache.
path | a "/" separated path for the type; this is the lookup index |
type | the new data provider type |
TYPE-LOCK-ERROR | type entry cannot be replaced, because it is locked |
DataProvider::DataProviderTypeCache::registerType | ( | string | path, |
AbstractDataProviderType | type, | ||
bool | locked = False |
||
) |
Register a new data provider type in the cache.
path | a "/" separated path for the type; this is the lookup index |
type | the new data provider type |
locked | if the data type should be locked, prohibiting updates and deletions |
PROVIDER-ERROR | the given provider has already been registered |
*AbstractDataProviderType DataProvider::DataProviderTypeCache::removeType | ( | string | path | ) |
Removes a type from the type cache.
path | a "/" separated path for the type; this is the lookup index |
TYPE-LOCK-ERROR | the given type cannot be removed, because it is locked |