omni::graph::exec::unstable::ImplementsCastWithoutAcquire

Defined in omni/graph/exec/unstable/IBase.h

template<typename T, typename ...Rest>
struct ImplementsCastWithoutAcquire : public T, public Rest

Helper template for implementing the castWithoutAcquire function for one or more interfaces.

Subclassed by omni::graph::exec::unstable::Implements< IExecutionContext >, omni::graph::exec::unstable::Implements< IExecutor >, omni::graph::exec::unstable::Implements< Bases… >, omni::graph::exec::unstable::Implements< IScheduleFunction >, omni::graph::exec::unstable::Implements< ITopology >

Public Functions

inline void *cast(omni::core::TypeId id) noexcept

See omni::core::IObject::cast.

inline void *castWithoutAcquire(omni::core::TypeId id) noexcept

See omni::graph::exec::unstable::IBase_abi::castWithoutAcquire_abi.

Protected Functions

virtual ~ImplementsCastWithoutAcquire() noexcept = default
inline void *cast_abi(omni::core::TypeId id) noexcept override

Returns a pointer to the interface defined by the given type id if this object implements the type id’s interface.

Objects can support multiple interfaces, even interfaces that are in different inheritance chains.

The returned object will have omni::core::IObject::acquire() called on it before it is returned, meaning it is up to the caller to call omni::core::IObject::release() on the returned pointer.

The returned pointer can be safely reinterpret_cast<> to the type id’s C++ class. For example, “omni.windowing.IWindow” can be cast to omni::windowing::IWindow.

Do not directly use this method, rather use a wrapper function like omni::core::cast() or omni::core::ObjectPtr::as().

Thread Safety

This method is thread safe.

inline void *castWithoutAcquire_abi(omni::core::TypeId id) noexcept override

Casts this object to the type described the the given id.

Returns nullptr if the cast was not successful.

Unlike omni::core::IObject::cast(), this casting method does not call omni::core::IObject::acquire().

Thread Safety

This method is thread safe.