company logo

BaseContext :: parent - Get parent context

The function returns the next higher context in accordance with passed parameters. A context is parent context of another one, when it is the next higher context or any other context in the parent hierarchy (parent's parent etc.).

Parent context may be requested by resource name and/or context type. Since resource names are not necessarily unique, the context type might be passed in addition.

The parent context is returned as BaseContext and has to be casted to the type expected. Run-time type information is available, i.e. dynamic cast can be used in C++.

When no context instance could be provided, the function throws an exception.

Notes:

The function replaces the function highContext, which will be removed in version 14.

Return value:  Base context handle ( odaba::BaseContext & )

Implementation overview

Implementation details

  1. Get nearest parent context
    odaba::BaseContext & BaseContext  :: parent (  )

    The function returns the next higher context. For a property context, the parent context is a type or object space context. For a type context, it is always a property context. The high context for a control context (GUI) is, usually, a control context.

  2. to list
  3. Get parent context by resource name
    odaba::BaseContext & BaseContext  :: parent ( odaba::String &sResourceName )

    The function looks for the next higher context for the resource name passed in sResourceName. The resource name is the property name (property context), the type name (type context) or the control name (control context in GUi applications).

    The function should not be called in order to obtain the database or project context, which might be provided by specialized functions in DBBaseContext or GUIBaseContext.

    • sResourceName - Resource name

      The resource name is the name of a GUI or database definition resource associated with a context class instance.

  4. to list
  5. Get parent context by context type and resource name
    odaba::BaseContext & BaseContext  :: parent ( odaba::String &sResourceName, odaba::ContextTypes eContextType )

    The function looks for the next higher context for the resource name passed in sResourceName and the context type passed in eContextTypes. The resource name is the property name (property context), the type name (type context) or the control name (control context in GUI applications).

    The function should not be called in order to obtain the database or project context, which might be provided by specialized functions in DBBaseContext or GUIBaseContext.

    • sResourceName - Resource name

      The resource name is the name of a GUI or database definition resource associated with a context class instance.

    • eContextType - - internal feature (not documented)
  6. to list
  7. Get parent context by type
    odaba::BaseContext & BaseContext  :: parent ( odaba::ContextTypes eContextType )

    The function returns the next higher context with the context type passed in eContextType.

    • eContextType - - internal feature (not documented)
  8. to list