FastUIDraw
Public Member Functions | Friends | List of all members
fastuidraw::PainterPackedValue< T > Class Template Reference

A PainterPackedValue represents a handle to an object that stores packed state data and tracks if that underlying data is already is already copied to PainterDraw::m_store. More...

#include <painter_packed_value.hpp>

Inheritance diagram for fastuidraw::PainterPackedValue< T >:
Inheritance graph
[legend]

Public Member Functions

 PainterPackedValue (void)
 
c_array< const reference_counted_ptr< const Image > > bind_images (void) const
 
void * opaque_data (void) const
 
 operator unspecified_bool_type (void) const
 
bool operator!= (const PainterPackedValue &rhs) const
 
bool operator< (const PainterPackedValue &rhs) const
 
bool operator== (const PainterPackedValue &rhs) const
 
c_array< uvec4packed_data (void) const
 
void reset (void)
 
void swap (PainterPackedValue &obj)
 

Friends

class PainterPackedValuePool
 

Detailed Description

template<typename T>
class fastuidraw::PainterPackedValue< T >

A PainterPackedValue represents a handle to an object that stores packed state data and tracks if that underlying data is already is already copied to PainterDraw::m_store.

If already on a store, then rather than copying the data again, the data is reused. The object behind the handle is NOT thread safe. In addition the underlying reference count is not either. Hence any access (even dtor, copy ctor and equality operator) on a fixed object cannot be done from multiple threads simutaneously. A fixed PainterPackedValue can be used by different Painter objects, subject to that the access is done from same thread.

Definition at line 33 of file painter_packed_value.hpp.

Constructor & Destructor Documentation

◆ PainterPackedValue()

template<typename T>
fastuidraw::PainterPackedValue< T >::PainterPackedValue ( void  )
inline

Ctor, initializes handle to nullptr, i.e. no underlying value object.

Definition at line 96 of file painter_packed_value.hpp.

Member Function Documentation

◆ bind_images()

template<typename T>
c_array<const reference_counted_ptr<const Image> > fastuidraw::PainterPackedValue< T >::bind_images ( void  ) const
inline

Returns the images needed for binding, only makes sense when T = PainterBrushShaderData

Definition at line 138 of file painter_packed_value.hpp.

◆ opaque_data()

template<typename T>
void* fastuidraw::PainterPackedValue< T >::opaque_data ( void  ) const
inline

Pointer to opaque data of PainterPackedValueBase, used internally by fastuidraw. Do not touch!

Definition at line 192 of file painter_packed_value.hpp.

◆ operator unspecified_bool_type()

template<typename T>
fastuidraw::PainterPackedValue< T >::operator unspecified_bool_type ( void  ) const
inline

Used to allow using object as a boolean without accidentally converting to a boolean (since it returns a pointer to a function).

Definition at line 149 of file painter_packed_value.hpp.

◆ operator!=()

template<typename T>
bool fastuidraw::PainterPackedValue< T >::operator!= ( const PainterPackedValue< T > &  rhs) const
inline

Comparison operator to underlying object storing value.

Parameters
rhshandle to which to compare

Definition at line 171 of file painter_packed_value.hpp.

◆ operator<()

template<typename T>
bool fastuidraw::PainterPackedValue< T >::operator< ( const PainterPackedValue< T > &  rhs) const
inline

Comparison operator to underlying object storing value.

Parameters
rhshandle to which to compare

Definition at line 182 of file painter_packed_value.hpp.

◆ operator==()

template<typename T>
bool fastuidraw::PainterPackedValue< T >::operator== ( const PainterPackedValue< T > &  rhs) const
inline

Comparison operator to underlying object storing value.

Parameters
rhshandle to which to compare

Definition at line 160 of file painter_packed_value.hpp.

◆ packed_data()

template<typename T>
c_array<uvec4> fastuidraw::PainterPackedValue< T >::packed_data ( void  ) const
inline

Returns the data of the PainterPackedValue

Definition at line 128 of file painter_packed_value.hpp.

◆ reset()

template<typename T>
void fastuidraw::PainterPackedValue< T >::reset ( void  )
inline

Resets the object to not refer to anything. Provided as a conveniance, equivalent to

Definition at line 118 of file painter_packed_value.hpp.

◆ swap()

template<typename T>
void fastuidraw::PainterPackedValue< T >::swap ( PainterPackedValue< T > &  obj)
inline

Swap operation

Parameters
objobject with which to swap

Definition at line 104 of file painter_packed_value.hpp.


The documentation for this class was generated from the following file: