company logo

Dictionary :: extentDefinition - Provide extent definition

The function provides an extent definition from the internal dictionary as PropertyDefinition. The requested extent definition has to be defined as extent in a global or local namespace. Defined extents are enumerations and extents defined for user defined complex data types.

Besides application-defined extents, the dictionary provides extent definitions for system extents, which might be referred to in an application as well (e.g. ADM_User, DSC_Topic or AccessModes).

Return value:  Property definition ( odaba::PropertyDefinition  )

The property definition provides meta-information about the property.

Implementation overview

Implementation details

  1. Get extent definition by namespace hierarchy
    odaba::PropertyDefinition Dictionary  :: extentDefinition ( odaba::String &sScope, odaba::String &sExtentName )

    Since extent names are unique within a namespace, only, locating an extent usually requires a namespace, which may be passed as namespace hierarchy in sScope. Namespaces in the hierarchy are separated by '::'. When passing an empty string in sScope,the function tries to locate an extent with the passed name in the global name space.

    The extend is looked for in the requested namespace, only, and not in the namespace hierarchy. When not being found, the function throws an exception.

    • sScope - Scope name

      The scope name addresses a namespace (or class) defined in the database. The scope name may refer to a namespace hierarchy. Namespace names in a hierarchical path are separated by double colon (::).

    • sExtentName - Extent name
  2. to list
  3. Get extent definition by namespace number
    odaba::PropertyDefinition Dictionary  :: extentDefinition ( int32 iNamespace, odaba::String &sExtentName )

    Since extent names are unique within a namespace, only, locating an extent is also possible by passing the unique namespace number in iNamespace.

    When the extent could not be found, the function throws an exception.

    Notes:

    When the extent definition has not yet been loaded from the external dictionary, it will be loaded now.

    • iNamespace - Namespace number

      The namespace number is a unique namespace identifier assigned by ODABA when defining a namespace. The namespace number allows identifying without passing the complete hierarchy. The namespace number for the global namespace is 0.

    • sExtentName - Extent name
  4. to list
  5. Get extent definition at position
    odaba::PropertyDefinition Dictionary  :: extentDefinition ( int32 iPosition )

    In order to read the list of extent definitions, one may request an extent definition at position. Reading extent definitions by position only returns the extent definitions loaded to the dictionary. Usually, extent definitions are loaded to the dictionary on demand.

    In order to avoid exceptions at end of list, the count of extents currently loaded should be checked.

    ... fragment ( Dictionary &dict ) {

      int                count = dict.extentDefinitionCount();

      int                pos   = 0;

      PropertyDefinition pd;

      

      while ( pos < count ) {

        pd = dict.extentDefinition(pos++);

        // ... do something

      }

    • iPosition - Position in collection

      The position of an element in a collection is beginning with 0 for the first element.

  6. to list
  7. Get extent definition by scoped name
    odaba::PropertyDefinition Dictionary  :: extentDefinition ( odaba::String &sExtentName )

    Since extent names are unique within a namespace, only, locating an extent requires a namespace identification. Scoped names are preceding extent names with a namespace hierarchy, which allows identifying the requested namespace. Extents defined in the global namespace require the extent name (without scope), only.

    The extend is looked for in the requested namespace, but not in the namespace hierarchy. When not being found, the function throws an exception.

    In order to get an extent definition defined in the global name space, the extent name might be prefixed with '::'. When just passing a namespace name without preceding namespace, the function tries to locate an extent in any namespace defined in the dictionary.

    Notes:

    When the extent definition has not yet been loaded from the external dictionary, it will be loaded now.

    • sExtentName - Extent name
  8. to list