![]() |
Qore DataProvider Module Reference 3.1
|
Data provider type cache class. More...
#include <DataProviderTypeCache.qc.dox.h>
Public Member Functions | |
| 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. | |
| AbstractDataProviderType | getTypeEx (string path) |
| Returns the given data provider type or throws an exception if not present. | |
| *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. | |
| *hash< DataProviderTypeEntryInfo > | getTypeInfo (string path, *bool rec_children_only) |
| Returns the given data provider type or nothing if not present. | |
| hash< DataProviderTypeEntryInfo > | getTypeInfoEx (string path, *bool rec_children_only) |
| Returns the given data provider type or throws an exception if not present. | |
| *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. | |
| *list< string > | listParentTypes () |
| Returns a list of registered data provider type paths where the types are "parent" types. | |
| *list< hash< DataProviderTypeEntryInfo > > | listRegisteredTypeEntries () |
| Returns a list of information for all registered data provider type entries. | |
| *list< string > | listRegisteredTypes () |
| Returns a list of registered data provider type paths. | |
| *list< string > | listTypes () |
| Returns a list of registered data provider type paths. | |
| lockAll () | |
| Locks all types. | |
| *DataProviderTypeEntry | lookupTypeEntryFromId (int id) |
| Returns a type from its epheremal ID. | |
| DataProviderTypeEntry | lookupTypeEntryFromIdEx (int id) |
| Returns a type from its epheremal ID; throws an exception if the ID is unknown. | |
| *DataProviderTypeEntry | lookupTypeEntryFromPath (string path) |
| Returns a type from its path. | |
| DataProviderTypeEntry | lookupTypeEntryFromPathEx (string path) |
| Returns a type from its path; throws an exception if the path is unknown. | |
| *AbstractDataProviderType | lookupTypeFromId (int id) |
| Returns a type from its epheremal ID. | |
| AbstractDataProviderType | lookupTypeFromIdEx (int id) |
| Returns a type from its epheremal ID; throws an exception if the ID is unknown. | |
| *AbstractDataProviderType | lookupTypeFromPath (string path) |
| Returns a type from its path. | |
| AbstractDataProviderType | lookupTypeFromPathEx (string path) |
| Returns a type from its path; throws an exception if the path is unknown. | |
| bool | registerOrReplaceType (string path, AbstractDataProviderType type, *int id) |
| Register or replaces a data provider type in the cache. | |
| registerType (string path, AbstractDataProviderType type, bool locked=False, *bool set_rollback) | |
| Register a new data provider type in the cache. | |
| *AbstractDataProviderType | removeType (string path) |
| Removes a type from the type cache. | |
| int | size () |
| Returns the number of types in the cache. | |
Protected Member Functions | |
| deregisterType (string path) | |
| Deregisters the type at the given path. | |
| DataProviderTypeEntry | root () |
| Data provider data type cache. | |
| transient RWLock | rwlock () |
| Data provider type cache lock. | |
Static Protected Member Functions | |
| 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. | |
Protected Attributes | |
| int | size = 0 |
| The size of the cache. | |
| hash< string, DataProviderTypeEntry > | tmap |
| Map of epheremal type IDs to types. | |
| hash< string, DataProviderTypeEntry > | trmap |
| Map of path names to types. | |
Data provider type cache class.
|
protected |
Deregisters the type at the given path.
| path | a "/" separated path for the type; this is the lookup index |
| *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 |
|
staticprotected |
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< hash< DataProviderTypeEntryInfo > > DataProvider::DataProviderTypeCache::listRegisteredTypeEntries | ( | ) |
Returns a list of information for all registered data provider type entries.
| *list< string > DataProvider::DataProviderTypeCache::listRegisteredTypes | ( | ) |
Returns a list of registered data provider type paths.
| *list< string > DataProvider::DataProviderTypeCache::listTypes | ( | ) |
Returns a list of registered data provider type paths.
This method traverses the entire type hierarchy to return all possible types stored in it
| *DataProviderTypeEntry DataProvider::DataProviderTypeCache::lookupTypeEntryFromId | ( | int | id | ) |
Returns a type from its epheremal ID.
| id | the epheremal type ID for the type |
| DataProviderTypeEntry DataProvider::DataProviderTypeCache::lookupTypeEntryFromIdEx | ( | int | id | ) |
Returns a type from its epheremal ID; throws an exception if the ID is unknown.
| id | the epheremal type ID for the type |
| TYPE-ARG-ERROR | Unknown type ID |
| *DataProviderTypeEntry DataProvider::DataProviderTypeCache::lookupTypeEntryFromPath | ( | string | path | ) |
Returns a type from its path.
| path | the full path for the type |
| DataProviderTypeEntry DataProvider::DataProviderTypeCache::lookupTypeEntryFromPathEx | ( | string | path | ) |
Returns a type from its path; throws an exception if the path is unknown.
| path | the full path for the type |
| TYPE-ARG-ERROR | Unknown type path |
| *AbstractDataProviderType DataProvider::DataProviderTypeCache::lookupTypeFromId | ( | int | id | ) |
Returns a type from its epheremal ID.
| id | the epheremal type ID for the type |
| AbstractDataProviderType DataProvider::DataProviderTypeCache::lookupTypeFromIdEx | ( | int | id | ) |
Returns a type from its epheremal ID; throws an exception if the ID is unknown.
| id | the epheremal type ID for the type |
| TYPE-ARG-ERROR | Unknown type ID |
| *AbstractDataProviderType DataProvider::DataProviderTypeCache::lookupTypeFromPath | ( | string | path | ) |
Returns a type from its path.
| path | the full path for the type |
| AbstractDataProviderType DataProvider::DataProviderTypeCache::lookupTypeFromPathEx | ( | string | path | ) |
Returns a type from its path; throws an exception if the path is unknown.
| path | the full path for the type |
| TYPE-ARG-ERROR | Unknown type path |
| bool DataProvider::DataProviderTypeCache::registerOrReplaceType | ( | string | path, |
| AbstractDataProviderType | type, | ||
| *int | id ) |
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 |
| id | optional epheremal type ID |
| TYPE-LOCK-ERROR | type entry cannot be replaced, because it is locked |
| TYPE-ARG-ERROR | the type is already registered under a different path |
| DataProvider::DataProviderTypeCache::registerType | ( | string | path, |
| AbstractDataProviderType | type, | ||
| bool | locked = False, | ||
| *bool | set_rollback ) |
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 |
| set_rollback | set rollback code; for use in module registration |
| PROVIDER-ERROR | the given provider has already been registered |
| TYPE-ARG-ERROR | the type is already registered under a different path |
| *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 |