A CYIViewAdapter implementation that delegates its responsibilities to a CYIDelegatingViewAdapter::Delegate implementation.
CYIDelegatingViewAdapter allows the extension of existing classes, such as CYIAbstractScreenViewController subclasses, with CYIViewAdapter responsibilities. The adapter does not take ownership of the delegate and so the delegate may be re-used across adapter instances.
In order to make use of this adapter, extend CYIDelegatingViewAdapter::Delegate and construct this adapter with the delegate implementation.
- See also
- CYIViewAdapter
-
CYINodeAdapter
-
CYIDelegatingNodeAdapter
#include <streamer/YiDelegatingViewAdapter.h>
Creates a new delegate adapter using delegate pDelegate and an optional view recycler pViewRecycler. pDelegate must be non-null. The created object does not take ownership of the pointer pDelegate.
If pViewRecycler is nullptr, the adapter will use a CYICreateDeleteViewRecycler.
| virtual CYIDelegatingViewAdapter::~CYIDelegatingViewAdapter |
( |
| ) |
|
|
virtual |
| Delegate* CYIDelegatingViewAdapter::GetDelegate |
( |
| ) |
const |
Returns the delegate assigned to this adapter.
| virtual uint32_t CYIDelegatingViewAdapter::GetItemsCount |
( |
| ) |
const |
|
overridevirtual |
Returns the number of items managed by this adapter. This may be queried throughout the lifetime of the adapter and must report the correct value as items are added and removed. The number of items will be used to produce the 0-based consecutive indices. Indices may be invalidated when the number of items have changed and may no longer correspond to the same visual representations.
- See also
- CYINodeAdapter::ItemAddedAtIndex
-
CYINodeAdapter::ItemRemovedAtIndex
Implements CYIViewAdapter.
| virtual const CYIRuntimeTypeInfo* CYIDelegatingViewAdapter::GetViewClass |
( |
uint32_t |
uIndex | ) |
const |
|
overridevirtual |
Returns the class type for the item at adapter index uIndex. Returns nullptr by default, indicating that the class type from the view template should be used. The class type must be derived from CYISceneView. Subclasses can override this function to provide a view class for the item at adapter index uIndex.
- See also
- GetViewTemplate
-
CYIViewTemplate::GetViewClassName
Reimplemented from CYIViewAdapter.
| virtual std::shared_ptr<CYIAssetViewTemplate> CYIDelegatingViewAdapter::GetViewTemplate |
( |
uint32_t |
uIndex | ) |
const |
|
overridevirtual |
Returns the view template that will be used to construct the item at adapter index uIndex. The size of this template will be used as the initial node size for adapter index uIndex.
Implements CYIViewAdapter.
| virtual void CYIDelegatingViewAdapter::OnReleaseView |
( |
uint32_t |
uIndex, |
|
|
CYISceneView * |
pView |
|
) |
| |
|
overrideprotectedvirtual |
| virtual void CYIDelegatingViewAdapter::PopulateView |
( |
uint32_t |
uIndex, |
|
|
CYISceneView * |
pView |
|
) |
| |
|
overrideprotectedvirtual |
Populates the view pView, which is associated with adapter index uIndex.
Implements CYIViewAdapter.
The documentation for this class was generated from the following file: