company logo

BaseContext :: highContext - High context by resource name

The function returns the high context with the resource name passed to the function. A context is high context of another one, when it is the parent context or any other context in the parent hierarchy (parent's parent etc.).

Since resource names are not unique, the context type might be passed in addition. Passing CtxUndefined, any context with the resource name passed will be returned.

The high 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 has been replaced by parent() and 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  :: highContext (  )

    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 type
    odaba::BaseContext & BaseContext  :: highContext ( odaba::ContextTypes eContextType )

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

    • eContextType - Type of specialized context
  4. to list
  5. Get parent context by resource name
    odaba::BaseContext & BaseContext  :: highContext ( 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.

  6. to list
  7. Get parent context by context type and resource name
    odaba::BaseContext & BaseContext  :: highContext ( 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 - Type of specialized context
  8. to list