SharedRef< REFCLASS, WRAPPER > Class Template Reference

#include <sharedref.h>

Inheritance diagram for SharedRef< REFCLASS, WRAPPER >:

详细描述

template<typename REFCLASS, typename WRAPPER = SharedObject<REFCLASS>>
class maxon::SharedRef< REFCLASS, WRAPPER >

SharedRef encapsulates a REFCLASS (e.g. String , Url , ImageLayer, ImageTexture...) to access it from multiple SharedRefs. With this technique it is possible to store COW objects in structures and allow the modification of the objects from outside.

公共成员函数

Result < void >  创建 (const REFCLASS &ref)
Result < void >  创建 (REFCLASS &&ref)
const REFCLASS &  GetRef () const
REFCLASS &  GetRef ()
template<typename REFCLASSOUT >
const SharedRef < REFCLASSOUT, typename SharedRefHelper < WRAPPER >::template Rebind< REFCLASSOUT > > &  Cast () const
  operator Bool () const
auto  PrivateGetRef () const -> const decltype(this->_ref)&
auto  PrivateGetRef () -> decltype(this->_ref)&

私有成员函数

WRAPPER *  GetWrapper () const

成员函数文档编制

◆  Create() [1/2]

Result <void> Create ( const REFCLASS &  ref )

创建新的 SharedRef object from the REFCLASS object.

◆  Create() [2/2]

Result <void> Create ( REFCLASS &&  ref )

创建新的 SharedRef object from the REFCLASS object.

◆  GetRef() [1/2]

const REFCLASS& GetRef ( ) const

Acquire access to the REFCLASS object.

◆  GetRef() [2/2]

REFCLASS& GetRef ( )

Acquire access to the REFCLASS object.

◆  Cast()

const SharedRef <REFCLASSOUT, typename SharedRefHelper <WRAPPER>::template Rebind<REFCLASSOUT> >& Cast ( ) const

Casts the SharedRef into another compatible object. e.g.:

ImageBaseSharedRef i = _imageTexture.AddChildren(imageLayer, nullptr ) iferr_return ; entry->_loadingLayer = i.Cast<ImageLayer>() iferr_return ;

◆  operator Bool()

operator Bool ( ) const
explicit

◆  PrivateGetRef() [1/2]

auto PrivateGetRef ( ) const -> const decltype(this->_ref)&

◆  PrivateGetRef() [2/2]

auto PrivateGetRef ( ) -> decltype(this->_ref)&

◆  GetWrapper()

WRAPPER* GetWrapper ( ) const
private
iferr_return
#define iferr_return
定义: resultbase.h:1434