Quantum 3 3.1.0

Public Member Functions | Properties | List of all members
ReadOnlyRef< T > Struct Template Reference

A pointer to a read-only component value. More...

Inheritance diagram for ReadOnlyRef< T >:
IComponentRef

Public Member Functions

unsafe ReadOnlyRef< T > AsTyped< T > ()
 Casts the underlying pointer to T* and returns a typed ReadOnlyRef<T>. More...
 
ReadOnlyRef AsUntyped ()
 Returns an untyped ReadOnlyRef. More...
 
unsafe readonly ref readonly T Value< T > ()
 Casts the underlying pointer to T* and returns a reference to the pointed-at component value. More...
 

Properties

readonly bool HasValue [get]
 Returns true if this reference points at a component value. Only then can Value be used. More...
 
readonly ref readonly T Value [get]
 A read-only reference to the pointed-at component value. More...
 

Detailed Description

A pointer to a read-only component value.

A pointer to a read-only component value with unknown type.

Template Parameters
T

This pointer can be invalidated when frame commands are committed, so it isn't safe to cache. When using copy-on-write, this pointer might not observe writes made elsewhere.

This pointer can be invalidated when frame commands are committed, so it isn't safe to cache. When using copy-on-write, this pointer might not observe writes made elsewhere.

Type Constraints
T :unmanaged 
T :IComponent 

Member Function Documentation

◆ AsUntyped()

ReadOnlyRef ReadOnlyRef< T >.AsUntyped ( )
inline

Returns an untyped ReadOnlyRef.

◆ Value< T >()

unsafe readonly ref readonly T ReadOnlyRef< T >.Value< T > ( )
inline

Casts the underlying pointer to T* and returns a reference to the pointed-at component value.

Type Constraints
T :unmanaged 
T :IComponent 

◆ AsTyped< T >()

unsafe ReadOnlyRef<T> ReadOnlyRef< T >.AsTyped< T > ( )
inline

Casts the underlying pointer to T* and returns a typed ReadOnlyRef<T>.

Type Constraints
T :unmanaged 
T :IComponent 

Property Documentation

◆ Value

readonly ref readonly T ReadOnlyRef< T >.Value
get

A read-only reference to the pointed-at component value.

◆ HasValue

readonly bool ReadOnlyRef< T >.HasValue
get

Returns true if this reference points at a component value. Only then can Value be used.

Returns true if this reference points at a component value. Only then can Value<T> be used.