Qore Programming Language Reference Manual  1.10.0
Pseudo_QC_Nothing.dox.h
1 
3 namespace Qore {
5 /***/
6 class <nothing> : public <value> {
7 
8 public:
10 
25 
26 public:
28 
43 nothing firstKey();
44 
45 public:
47 
62 nothing firstValue();
63 
64 public:
66 
83 bool hasKey(softstring key);
84 
85 public:
87 
104 bool hasKeyValue(softstring key);
105 
106 public:
108 
123 
124 public:
126 
141 list<string> keys();
142 
143 public:
145 
160 nothing lastKey();
161 
162 public:
164 
179 nothing lastValue();
180 
181 public:
183 
196 int lsize();
197 
198 public:
200 
213 
214 public:
216 
231 
232 public:
234 
248 int typeCode();
249 
250 public:
252 
267 list<auto> values();
268 };
269 }
This class defines a simple iterator to be used to iterate single values (or complex objects where no...
Definition: QC_SingleValueIterator.dox.h:25
Methods in this pseudo-class can be executed on NOTHING.
Definition: Pseudo_QC_Nothing.dox.h:6
SingleValueIterator contextIterator()
Returns an empty SingleValueIterator object.
nothing firstValue()
Returns NOTHING.
SingleValueIterator rangeIterator()
Returns an empty SingleValueIterator object.
nothing firstKey()
Returns NOTHING.
list< auto > values()
Returns an empty list.
bool hasKeyValue(softstring key)
Returns True if the key exists and is assigned to a value, False if not.
SingleValueIterator keyIterator()
Returns an empty SingleValueIterator object.
bool hasKey(softstring key)
Returns True if the key exists in the hash (may or may not be assigned a value), False if not.
list< string > keys()
Returns an empty list.
int lsize()
Returns 0.
nothing lastValue()
Returns NOTHING.
int typeCode()
Returns Qore::NT_NOTHING.
nothing lastKey()
Returns NOTHING.
SingleValueIterator pairIterator()
Returns an empty SingleValueIterator object.
Methods in this pseudo-class are available to be executed on any value type (even NOTHING); this is t...
Definition: Pseudo_QC_All.dox.h:6
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:3
_provider_1_1_data_provider_type_cache.html#a998e682873fb90fca221feb1a31cad5e">size ()  Returns the number of types in the cache.
 

Protected Member Functions

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. More...
 

Protected Attributes

int size = 0
 The size of the cache.
 

Detailed Description

Data provider type cache class.

Member Function Documentation

◆ getType()

*AbstractDataProviderType DataProvider::DataProviderTypeCache::getType ( string  path)

Returns the given data provider type or NOTHING if not present.

Parameters
patha "/" separated path for the type; trailing path elements can be a path into fields
Returns
the given data provider type; NOTHING is returned if the type cannot be resolved
Note
types are stored based on the path provided which may differ from their type names (which may be generic and therefore not suitable for indexing)

◆ getTypeEx()

AbstractDataProviderType DataProvider::DataProviderTypeCache::getTypeEx ( string  path)

Returns the given data provider type or throws an exception if not present.

Parameters
patha "/" separated path for the type; trailing path elements can be a path into fields
Returns
the given data provider type; an exception is thrown if the data provider is unknown
Exceptions
PROVIDER-ERRORthe given data provider type path is unknown
Note
types are stored based on the path provided which may differ from their type names (which may be generic and therefore not suitable for indexing)

◆ getTypeFromFields()

static *AbstractDataProviderType DataProvider::DataProviderTypeCache::getTypeFromFields ( string  path,
AbstractDataProviderType  type,
list< string type_path,
bool  throw_exception 
)
staticprotected

Returns the given data provider type and either throws an exception if not present or returns NOTHING.

Parameters
patha "/" separated path for the type
typethe base type for the search
type_paththe path in the type for fields leading to the final return type
throw_exceptionif True then an exception is thrown if the path cannot be resolved, otherwise NOTHING is returned
Returns
the given data provider type or NOTHING is returned if the path cannot be resolved and the throw_exception argument is False
Exceptions
PROVIDER-ERRORthe given data provider type path is unknown; only thrown if the throw_exception argument is True
Note
types are stored based on the path provided which may differ from their type names (which may be generic and therefore not suitable for indexing)

◆ getTypeImpl()

*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.

Parameters
patha "/" separated path for the type
throw_exceptionif True then an exception is thrown if the path cannot be resolved, otherwise NOTHING is returned
type_loadera closure taking a list of strings giving the full path to the type and returning *AbstractDataProviderType
Returns
the given data provider type or NOTHING is returned if the path cannot be resolved and the throw_exception argument is False
Exceptions
PROVIDER-ERRORthe given data provider type path is unknown; only thrown if the throw_exception argument is True
Note
types are stored based on the path provided which may differ from their type names (which may be generic and therefore not suitable for indexing)

◆ getTypeInfo()

*hash<DataProviderTypeEntryInfo> DataProvider::DataProviderTypeCache::getTypeInfo ( string  path,
*bool  rec_children_only 
)

Returns the given data provider type or NOTHING if not present.

Parameters
patha "/" separated path for the type; trailing path elements can be a path into fields
rec_children_onlyif True, then only children with fields are returned
Returns
the given data provider type; NOTHING is returned if the type cannot be resolved
Note
types are stored based on the path provided which may differ from their type names (which may be generic and therefore not suitable for indexing)

◆ getTypeInfoEx()

hash<DataProviderTypeEntryInfo> DataProvider::DataProviderTypeCache::getTypeInfoEx ( string  path,
*bool  rec_children_only 
)

Returns the given data provider type or throws an exception if not present.

Parameters
patha "/" separated path for the type; trailing path elements can be a path into fields
rec_children_onlyif True, then only children with fields are returned
Returns
the given data provider type; an exception is thrown if the data provider is unknown
Exceptions
PROVIDER-ERRORthe given data provider type path is unknown
Note
types are stored based on the path provided which may differ from their type names (which may be generic and therefore not suitable for indexing)

◆ getTypeInfoImpl()

*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.

Parameters
patha "/" separated path for the type
throw_exceptionif True then an exception is thrown if the path cannot be resolved, otherwise NOTHING is returned
rec_children_onlyif True, then only children with fields are returned
Returns
information for the given data provider type or NOTHING is returned if the path cannot be resolved and the throw_exception argument is False
Exceptions
PROVIDER-ERRORthe given data provider type path is unknown; only thrown if the throw_exception argument is True
Note
types are stored based on the path provided which may differ from their type names (which may be generic and therefore not suitable for indexing)

◆ listParentTypes()

*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

Note
types are stored based on the path provided which may differ from their type names (which may be generic and therefore not suitable for indexing)

◆ listTypes()

*list<string> DataProvider::DataProviderTypeCache::listTypes ( )

Returns a list of registered data provider type paths.

Note
types are stored based on the path provided which may differ from their type names (which may be generic and therefore not suitable for indexing)

◆ registerOrReplaceType()

bool DataProvider::DataProviderTypeCache::registerOrReplaceType ( string  path,
AbstractDataProviderType  type 
)

Register or replaces a data provider type in the cache.

Parameters
patha "/" separated path for the type; this is the lookup index
typethe new data provider type
Returns
True if the type was replaced or added
Exceptions
TYPE-LOCK-ERRORtype entry cannot be replaced, because it is locked
Note
types are stored based on the path provided which may differ from their type names (which may be generic and therefore not suitable for indexing)

◆ registerType()

DataProvider::DataProviderTypeCache::registerType ( string  path,
AbstractDataProviderType  type,
bool  locked = False 
)

Register a new data provider type in the cache.

Parameters
patha "/" separated path for the type; this is the lookup index
typethe new data provider type
lockedif the data type should be locked, prohibiting updates and deletions
Exceptions
PROVIDER-ERRORthe given provider has already been registered
Note
types are stored based on the path provided which may differ from their type names (which may be generic and therefore not suitable for indexing)

◆ removeType()

*AbstractDataProviderType DataProvider::DataProviderTypeCache::removeType ( string  path)

Removes a type from the type cache.

Parameters
patha "/" separated path for the type; this is the lookup index
Returns
the type removed or NOTHING if the type was not present
Exceptions
TYPE-LOCK-ERRORthe given type cannot be removed, because it is locked