Qore DataProvider Module Reference 2.7.5
Loading...
Searching...
No Matches
DataProvider::DataProviderTypeEntry Class Reference

the DataProviderTypeEntry class More...

#include <DataProviderTypeEntry.qc.dox.h>

Inheritance diagram for DataProvider::DataProviderTypeEntry:
[legend]

Public Member Methods

 addChild (string child)
 Adds a child node to the entry. More...
 
bool clear ()
 Clears the type hierarchy of all non-locked types.
 
 constructor ()
 Creates the entry as a root node.
 
 constructor (string path, string name)
 Creates the entry as a child node.
 
*DataProviderTypeEntry getChild (string child)
 Returns the given child, if any. More...
 
*DataProviderTypeEntry getChildEx (string child)
 Returns the given child, if any, otherwise throws an exception. More...
 
*list< string > getChildNames ()
 Returns a list of child entry names, if any. More...
 
DataProviderTypeEntry getCreateChild (string child)
 Returns the given child and creates it if necessary. More...
 
string getDesc ()
 Returns the description of the entry.
 
hash< DataProviderTypeEntryInfogetInfo (*bool rec_children_only)
 Returns information about this entry. More...
 
string getName ()
 Returns the name of the entry.
 
string getPath ()
 Returns the path of the entry.
 
*AbstractDataProviderType getType ()
 Returns the type at the entry level, if any. More...
 
*AbstractDataProviderType getTypeEx ()
 Returns the type at the entry level, if any, otherwise throws an exception. More...
 
bool hasType ()
 Returns True if the entry has a type.
 
bool isParent ()
 Returns True if the entry is a "parent" entry, meaning that all children were added with this entry.
 
*list< string > listParentTypes ()
 Returns a list of registered data provider type paths where each type listed is a "parent" type. More...
 
*list< string > listTypes ()
 Returns a list of registered data provider type paths. More...
 
bool lock ()
 Locks the entry, so it can't be removed or changed. More...
 
 lockAll ()
 Locks all types.
 
 removeChild (string child)
 Removes the given child, if it exists. More...
 
*AbstractDataProviderType setOrReplaceType (AbstractDataProviderType type)
 Sets or replaces the type for the entry. More...
 
bool setType (AbstractDataProviderType type, bool locked=False)
 Sets the type for the entry. More...
 

Private Attributes

*hash< string, DataProviderTypeEntrychildren
 Children of this entry.
 
bool locked = False
 True if the entry is locked and therefore cannot be deleted or updated More...
 
string name
 The name of this entry.
 
bool parent = False
 True if this entry is a "parent" type; if the children were added atomically with this entry
 
string path
 The path to this entry.
 
*hash< string, DataProviderTypeEntryrec_children
 Names of attributes that can be referenced as children that have their own fields.
 
*AbstractDataProviderType type
 The type at this location.
 
*hash< string, DataProviderTypeEntrytype_children
 Names of attributes that can be referenced as children.
 

Private:Internal Member Methods

 constructor (string path, string name, AbstractDataProviderType type)
 Creates the entry as a child node.
 
 setTypeChildren ()
 Sets up attributes as children.
 

Detailed Description

Member Function Documentation

◆ addChild()

DataProvider::DataProviderTypeEntry::addChild ( string  child)

Adds a child node to the entry.

Parameters
childthe name of the child node to add
Exceptions
CHILD-ERRORa child with the same name already exists

◆ getChild()

*DataProviderTypeEntry DataProvider::DataProviderTypeEntry::getChild ( string  child)

Returns the given child, if any.

Returns
the given child, if any

◆ getChildEx()

*DataProviderTypeEntry DataProvider::DataProviderTypeEntry::getChildEx ( string  child)

Returns the given child, if any, otherwise throws an exception.

Returns
the given child, if any, otherwise throws an exception
Exceptions
INVALID-CHILDthe given child is unknown

◆ getChildNames()

*list< string > DataProvider::DataProviderTypeEntry::getChildNames ( )

Returns a list of child entry names, if any.

Returns
a list of child entry names, if any

◆ getCreateChild()

DataProviderTypeEntry DataProvider::DataProviderTypeEntry::getCreateChild ( string  child)

Returns the given child and creates it if necessary.

Returns
the given child and creates it if necessary

◆ getInfo()

hash< DataProviderTypeEntryInfo > DataProvider::DataProviderTypeEntry::getInfo ( *bool  rec_children_only)

Returns information about this entry.

Parameters
rec_children_onlyif True, then only children with fields are returned
Returns
information about this entry

◆ getType()

*AbstractDataProviderType DataProvider::DataProviderTypeEntry::getType ( )

Returns the type at the entry level, if any.

Returns
the type at the entry level, if any

◆ getTypeEx()

*AbstractDataProviderType DataProvider::DataProviderTypeEntry::getTypeEx ( )

Returns the type at the entry level, if any, otherwise throws an exception.

Returns
the type at the entry level, if any, otherwise throws an exception
Exceptions
NO-TYPEthis entry has no type, only children

◆ listParentTypes()

*list< string > DataProvider::DataProviderTypeEntry::listParentTypes ( )

Returns a list of registered data provider type paths where each type listed is a "parent" type.

"Parent" types are types where children are 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::DataProviderTypeEntry::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)

◆ lock()

bool DataProvider::DataProviderTypeEntry::lock ( )

Locks the entry, so it can't be removed or changed.

Returns
the previous lock status
Exceptions
TYPE-LOCK-ERRORthe entry cannot be locked, because it does not have a type
Note
Locking is a one-way operation

◆ removeChild()

DataProvider::DataProviderTypeEntry::removeChild ( string  child)

Removes the given child, if it exists.

Exceptions
TYPE-LOCK-ERRORthe given child cannot be removed because it is locked

◆ setOrReplaceType()

*AbstractDataProviderType DataProvider::DataProviderTypeEntry::setOrReplaceType ( AbstractDataProviderType  type)

Sets or replaces the type for the entry.

Parameters
typethe type to set for this entry
Returns
True if a new type was added, False if not
Exceptions
TYPE-LOCK-ERRORtype entry cannot be replaced, because it is locked

◆ setType()

bool DataProvider::DataProviderTypeEntry::setType ( AbstractDataProviderType  type,
bool  locked = False 
)

Sets the type for the entry.

Parameters
typethe type to set for this entry
lockedif the data type should be locked, prohibiting updates and deletions
Returns
True if a new type was added, False if not
Exceptions
TYPE-ERRORa type has already been set for this entry

Member Data Documentation

◆ locked

bool DataProvider::DataProviderTypeEntry::locked = False
private

True if the entry is locked and therefore cannot be deleted or updated

Note
only type entries can be locked