| Qore DataProvider Module Reference 3.2.2

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | List of all members
DataProvider::DataProviderTypeEntry Class Reference

the DataProviderTypeEntry class More...

`#include <DataProviderTypeEntry.qc.dox.h>`

Inheritance diagram for DataProvider::DataProviderTypeEntry:
[legend]

## Public Member Functions
| addChild (string child)
| Adds a child node to the entry.
bool | checkLocked (*bool throw_exception)
| Returns the locked status and optionally throws an exception if locked.
bool | checkRemoveChild (string child)
| Checks if the given child can be removed, if it exists.
bool | checkRemoveChildEx (string child)
| Checks if the given child can be removed, if it exists.
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.
*DataProviderTypeEntry | getChildEx (string child)
| Returns the given child, if any, otherwise throws an exception.
*list< string > | getChildNames ()
| Returns a list of child entry names, if any.
DataProviderTypeEntry | getCreateChild (string child)
| Returns the given child and creates it if necessary.
string | getDesc ()
| Returns the description of the entry.
string | getDisplayName ()
| Returns the display name of the entry.
*int | getEpheremalTypeId ()
| Returns the epheremal type ID.
*hash< auto > | getFreeFormInfo ()
| Returns free-form information related to the type, if any.
hash< DataProviderTypeEntryInfo > | getInfo (*bool rec_children_only)
| Returns information about this entry.
string | getName ()
| Returns the name of the entry.
string | getPath ()
| Returns the path of the entry.
string | getShortDescription ()
| Returns the short description of the entry.
*AbstractDataProviderType | getType ()
| Returns the type at the entry level, if any.
*AbstractDataProviderType | getTypeEx ()
| Returns the type at the entry level, if any, otherwise throws an exception.
bool | hasType ()
| Returns True if the entry has a type.
bool | isLocked ()
| Returns the locked status.
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.
*list< string > | listTypes ()
| Returns a list of registered data provider type paths.
bool | lock ()
| Locks the entry, so it can't be removed or changed.
| lockAll ()
| Locks all types.
DataProviderTypeEntry | removeChild (string child)
| Removes the given child, if it exists.
*AbstractDataProviderType | setOrReplaceType (AbstractDataProviderType type, *int id, *hash< auto > info)
| Sets or replaces the type for the entry.
bool | setType (AbstractDataProviderType type, bool locked=False)
| Sets the type for the entry.

## Static Public Member Functions
static | setEpheremalIdStart (int n)
| Sets the start of the sequence for epheremal IDs.

## Static Protected Member Functions
static Sequence | seq (1)
| Sequence for epheremal IDs for types.

## Protected Attributes
*hash< string, DataProviderTypeEntry > | children
| Children of this entry.
*int | epheremal_type_id
| Epheremal ID for the type.
*hash< auto > | info
| Free-form information related to the type.
bool | locked = False
| True if the entry is locked and therefore cannot be deleted or updated
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, DataProviderTypeEntry > | rec_children
| Names of attributes that can be referenced as children that have their own fields.
*AbstractDataProviderType | type
| The type at this location.
*hash< string, DataProviderTypeEntry > | type_children
| Names of attributes that can be referenced as children.

## Static Protected Attributes
static bool | neg
| If epheremal IDs should be negative.

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

## Detailed Description

the DataProviderTypeEntry class

## Member Function Documentation

## ◆ addChild()

DataProvider::DataProviderTypeEntry::addChild | ( | string | child | ) |

Adds a child node to the entry.

Parameters

  child | the name of the child node to add

Exceptions

  CHILD-ERROR | a child with the same name already exists

## ◆ checkLocked()

bool DataProvider::DataProviderTypeEntry::checkLocked | ( | *bool | throw_exception | ) |

Returns the locked status and optionally throws an exception if locked.

Parameters

  throw_exception | if True then an exception is thrown if the entry is locked

Since
  DataProvider 3.2.1

## ◆ checkRemoveChild()

bool DataProvider::DataProviderTypeEntry::checkRemoveChild | ( | string | child | ) |

Checks if the given child can be removed, if it exists.

Returns
  True if the child exists and can be removed, False if not

## ◆ checkRemoveChildEx()

bool DataProvider::DataProviderTypeEntry::checkRemoveChildEx | ( | string | child | ) |

Checks if the given child can be removed, if it exists.

Returns
  True if the child exists and can be removed, False if not

Exceptions

  TYPE-LOCK-ERROR | the given child cannot be removed, because it is locked

## ◆ 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-CHILD | the 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

## ◆ getEpheremalTypeId()

*int DataProvider::DataProviderTypeEntry::getEpheremalTypeId | ( |  | ) |

Returns the epheremal type ID.

Since
  DataProvider 3.0

## ◆ getFreeFormInfo()

*hash< auto > DataProvider::DataProviderTypeEntry::getFreeFormInfo | ( |  | ) |

Returns free-form information related to the type, if any.

Note
  Not to be confused with getInfo()

Since
  DataProvider 3.2.1

## ◆ getInfo()

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

Returns information about this entry.

Parameters

  rec_children_only | if True, then only children with fields are returned

Returns
  information about this entry

Note
  Not to be confused with getFreeFormInfo()

## ◆ 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-TYPE | this entry has no type, only children

## ◆ isLocked()

bool DataProvider::DataProviderTypeEntry::isLocked | ( |  | ) |

Returns the locked status.

Since
  DataProvider 3.0

## ◆ 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-ERROR | the entry cannot be locked, because it does not have a type

Note
  Locking is a one-way operation

## ◆ removeChild()

DataProviderTypeEntry DataProvider::DataProviderTypeEntry::removeChild | ( | string | child | ) |

Removes the given child, if it exists.

Returns
  the type entry removed

Exceptions

  TYPE-LOCK-ERROR | the given child cannot be removed because it is locked

## ◆ setEpheremalIdStart()

static DataProvider::DataProviderTypeEntry::setEpheremalIdStart | ( | int | n | ) |
| static

Sets the start of the sequence for epheremal IDs.

Parameters

  n | the new sequence start number, if the number is negative, negative IDs will be assigned

Exceptions

  TYPE-ID-ERROR | Cannot set the ID start after IDs have already been assigned

Since
  DataProvider 3.0

## ◆ setOrReplaceType()

*AbstractDataProviderType DataProvider::DataProviderTypeEntry::setOrReplaceType | ( | AbstractDataProviderType | type,
|  | *int | id,
|  | *hash< auto > | info )

Sets or replaces the type for the entry.

Parameters

  type | the type to set for this entry
  id | optional epheremal type ID
  info | optional additional free-form information related to the type

Returns
  True if a new type was added, False if not

Exceptions

  TYPE-LOCK-ERROR | type 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

  type | the type to set for this entry
  locked | if the data type should be locked, prohibiting updates and deletions

Returns
  True if a new type was added, False if not

Exceptions

  TYPE-ERROR | a type has already been set for this entry

## Member Data Documentation

## ◆ locked

bool DataProvider::DataProviderTypeEntry::locked = False
| protected

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

Note
  only type entries can be locked