OpenAssetIO
An abstract API for generalising interactions between a host application and an asset management system
|
Deals with the retrieval of paginated data from the backend at the behest of the host. More...
#include <EntityReferencePagerInterface.hpp>
Public Types | |
using | Ptr = EntityReferencePagerInterfacePtr |
using | ConstPtr = EntityReferencePagerInterfaceConstPtr |
using | Page = std::vector< EntityReference > |
Public Member Functions | |
EntityReferencePagerInterface ()=default | |
Defaulted default constructor. More... | |
EntityReferencePagerInterface (const EntityReferencePagerInterface &)=delete | |
Deleted copy constructor. More... | |
EntityReferencePagerInterface & | operator= (const EntityReferencePagerInterface &)=delete |
Deleted copy assignment operator. More... | |
EntityReferencePagerInterface (EntityReferencePagerInterface &&) noexcept=default | |
Defaulted move constructor. More... | |
EntityReferencePagerInterface & | operator= (EntityReferencePagerInterface &&) noexcept=default |
Defaulted move assignment operator. More... | |
virtual | ~EntityReferencePagerInterface ()=default |
Manager should override destructor to be notified when query has finished. More... | |
virtual bool | hasNext (const HostSessionPtr &)=0 |
Returns whether or not there is more data accessible by advancing the page. More... | |
virtual Page | get (const HostSessionPtr &)=0 |
Return the current page of data. More... | |
virtual void | next (const HostSessionPtr &)=0 |
Advance the page. More... | |
virtual void | close (const HostSessionPtr &hostSession) |
Close the paging query. More... | |
Deals with the retrieval of paginated data from the backend at the behest of the host.
The manager is expected to extend this type, and store data necessary to perform the paging operations on the extended object, utilizing caching when possible to reduce redundant queries.
Thread-safety of operations is not expected. Hosts will synchronize calls themselves, if required.
This is a non-copyable object that will be held in a shared_ptr
, meaning multiple references may be held, but only to a single instance of the ongoing query, whose destructor will be called when all references are released. As such, the destructor of this class is a good place to place any complex cleanup operations (e.g. closing open connections).
To support as wide array of possible backends as possible, OpenAssetIO places no restraints on the behaviour of this type concerning performance, however, it is considered friendly to document the performance characteristics of your Pager implementation.
using Page = std::vector<EntityReference> |
using Ptr = EntityReferencePagerInterfacePtr |
|
default |
Defaulted default constructor.
|
explicitdelete |
Deleted copy constructor.
Copying of pagers is disallowed, for convenience of implementation.
However, be aware that multiple references to the pager may be held.
|
defaultnoexcept |
Defaulted move constructor.
|
virtualdefault |
Manager should override destructor to be notified when query has finished.
|
virtual |
Close the paging query.
Signals that the host is finished with the paging query, allowing for any potential cleanup that may need to be performed. This method is guaranteed to be called only once, and no other interface methods will be called by the host thereafter.
This method is called from a destructor. Thrown exceptions will be caught and logged as errors if possible. Despite that, throwing from this function is nonetheless discouraged.
|
pure virtual |
Return the current page of data.
If the current page has advanced beyond the last page, an empty list should be returned.
|
pure virtual |
Returns whether or not there is more data accessible by advancing the page.
The mechanism to acquire this information is variable, and left up to the specifics of the backend implementation.
true
if another page is available, false
otherwise.
|
pure virtual |
|
delete |
Deleted copy assignment operator.
Copying of pagers is disallowed, for convenience of implementation.
However, be aware that multiple references to the pager may be held.
|
defaultnoexcept |
Defaulted move assignment operator.
Copyright 2013-2023 The Foundry Visionmongers Ltd. OpenAssetIO is released under the Apache 2.0 License