BaseContext :: parentContext - 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.
The function replaces the function highContext, which will be removed in version 14. Since the function returns a BaseContext instance, it is suggestet calling qualified context functions as propertyContext or typeContext.
Implementation overview
- Get nearest parent context
BaseContext :: parentContext (  ) - Get parent context by resource name
BaseContext :: parentContext ( sResourceName ) - Get parent context by context type and resource name
BaseContext :: parentContext ( sResourceName, eContextType ) - Get parent context by type
BaseContext :: parentContext ( eContextType )
Implementation details
-
Get nearest parent context
odaba::BaseContext & BaseContext  :: parentContext (  )
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.
to list
-
Get parent context by resource name
odaba::BaseContext & BaseContext  :: parentContext ( 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.
to list
- sResourceName
- Resource name
-
Get parent context by context type and resource name
odaba::BaseContext & BaseContext  :: parentContext ( 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
to list
- sResourceName
- Resource name
-
Get parent context by type
odaba::BaseContext & BaseContext  :: parentContext ( odaba::ContextTypes eContextType )
The function returns the next higher context with the context type passed in eContextType.
- eContextType - Type of specialized context
to list