OpenAssetIO [beta]
An abstract API for generalising interactions between a host application and an asset management system

The Context object is used to convey information about the calling environment to a manager. More...

#include <Context.hpp>

Public Types

using Ptr = ContextPtr
 
using ConstPtr = ContextConstPtr
 

Static Public Member Functions

static ContextPtr make (trait::TraitsDataPtr locale=trait::TraitsData::make(), managerApi::ManagerStateBasePtr managerState=nullptr)
 Constructs a new context. More...
 

Public Attributes

trait::TraitsDataPtr locale
 In many situations, the Trait Set of the desired entity itself is not entirely sufficient information to realize many functions that a manager wishes to implement. More...
 
managerApi::ManagerStateBasePtr managerState
 The opaque state token owned by the manager, used to correlate all API calls made using this context. More...
 

Detailed Description

The Context object is used to convey information about the calling environment to a manager.

It holds additional information about the host that may be useful to the manager. Optionally, it holds arbitrary, opaque (to the host), serializable manager state, which can be used by the manager plugin to tie together related calls.

A Manager will also use this information to ensure it presents the correct UI, or behavior.

The Context is passed to many calls in this API, and it may, or may not need to be used directly.

Warning
Contexts should never be directly constructed. Hosts should use createContext or createChildContext. A Manager implementation should never need to create a context of it's own, one will always be supplied through the ManagerInterface entry points.

Member Typedef Documentation

using Ptr = ContextPtr

Member Function Documentation

static ContextPtr make ( trait::TraitsDataPtr  locale = trait::TraitsData::make(),
managerApi::ManagerStateBasePtr  managerState = nullptr 
)
static

Constructs a new context.

Warning
This method should never be called directly by host code - Manager.createContext should always be used instead.

Member Data Documentation

In many situations, the Trait Set of the desired entity itself is not entirely sufficient information to realize many functions that a manager wishes to implement.

For example, when determining the final file path for an Image that is about to be published - knowing it came from a render catalog, rather than a 'Write node' from a comp tree could result in different behavior.

The Locale uses a TraitsData to describe in more detail, what specific part of a host is requesting an action. In the case of a file browser for example, it may also include information such as whether or not multi-selection is required.

The opaque state token owned by the manager, used to correlate all API calls made using this context.

See also
Stable Entity Resolution

The documentation for this class was generated from the following file:
  • /src/src/openassetio-core/include/openassetio/Context.hpp