company logo

Dictionary :: typeDefinition - Get type definition

The function provides a type definition from the dictionary (TypeDefinition). The requested type definition has to be defined as type in a global or local namespace.

As type definitions, definitions for complex data types or enumerations can be provided. Type definitions that can be looked up in the dictionary refer to user-defined types, always.

Return value:  Type definition ( odaba::TypeDefinition  )

Type definition refers to a type descriptor for a complex data type (structure), view or enumeration.

Implementation overview

Implementation details

  1. Get type definition by namespace scope
    odaba::TypeDefinition Dictionary  :: typeDefinition ( odaba::String &sScope, odaba::String &sTypeName )

    Since type names are unique within a namespace, only, locating a type requires a namespace identification. The namespace name or hierarchy (scope name) passed in sScope allows identifying the requested namespace.

    The type is looked for in the requested namespace, only, and not in the namespace hierarchy. When not being found, the function throws an exception. Passing an empty scope name in sScope causes searching the type in the global scope.

    • 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 (::).

    • sTypeName - Type name

      The type name is the name of a data type (usually) defined in the database. The type name might be passed as simple identifier or as scoped name with preceding namespace names separated by double colon '::'.

      In order to pass no type name, an empty string ( String() ) may be passed.

  2. to list
  3. Get type definition by position
    odaba::TypeDefinition Dictionary  :: typeDefinition ( int32 iPosition )

    The function provides a type definition by current position in the dictionary. This allows browsing through all type definitions loaded to the dictionary.

    Notes:

    Since type definitions are loaded into the run-time dictionary on demand, the index number for a type definition may change.

    • iPosition - Position in collection

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

  4. to list
  5. Get type definition by scoped name
    odaba::TypeDefinition Dictionary  :: typeDefinition ( odaba::String &sTypeName )

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

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

    • sTypeName - Type name

      The type name is the name of a data type (usually) defined in the database. The type name might be passed as simple identifier or as scoped name with preceding namespace names separated by double colon '::'.

      In order to pass no type name, an empty string ( String() ) may be passed.

  6. to list