HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UN_GenericDataBufferRef< ContainerT, DataIDT > Class Template Reference

#include <UN_GenericData.h>

Public Member Functions

 UN_GenericDataBufferRef ()=default
 
 UN_GenericDataBufferRef (ContainerT &container, UN_GenericBufferID buf_id)
 
bool isValid () const
 
 operator bool () const
 
UN_GenericBufferID bufferID () const
 
ContainerT & container () const
 
UN_GenericBufferType bufferType (UN_GenericBufferID id) const
 Returns the data buffer type. More...
 
const UT_StringHolderbufferName (UN_GenericBufferID id) const
 Returns the name of the data buffer. More...
 
template<typename T >
void setData (DataIDT id, T &&value)
 Sets the data value for a given data ID. More...
 
template<typename T >
const TdataRef (DataIDT id) const
 Returns a const ref to the data value for a given data ID. More...
 
template<typename T >
T dataVal (DataIDT id) const
 Returns a copy of the data value for a given data ID. More...
 
template<typename T >
T stealData (DataIDT id)
 Moves the data value out of the buffer for a given data ID. More...
 
template<typename T , typename OP >
void updateData (DataIDT id, const OP &op)
 Updates the data value in-place via a callable. More...
 

Detailed Description

template<typename ContainerT, typename DataIDT>
class UN_GenericDataBufferRef< ContainerT, DataIDT >

A lightweight reference to a generic data buffer within a container. Wraps a container pointer and a UN_GenericBufferID, forwarding data access calls (set, get, steal, update) to the container.

Template parameters: ContainerT - The data container type (e.g., UN_NodeData). DataIDT - The strongly-typed ID for data items (e.g., UN_NodeID).

Definition at line 68 of file UN_GenericData.h.

Constructor & Destructor Documentation

template<typename ContainerT , typename DataIDT >
UN_GenericDataBufferRef< ContainerT, DataIDT >::UN_GenericDataBufferRef ( )
default
template<typename ContainerT , typename DataIDT >
UN_GenericDataBufferRef< ContainerT, DataIDT >::UN_GenericDataBufferRef ( ContainerT &  container,
UN_GenericBufferID  buf_id 
)
inline

Definition at line 72 of file UN_GenericData.h.

Member Function Documentation

template<typename ContainerT , typename DataIDT >
UN_GenericBufferID UN_GenericDataBufferRef< ContainerT, DataIDT >::bufferID ( ) const
inline

Definition at line 80 of file UN_GenericData.h.

template<typename ContainerT , typename DataIDT >
const UT_StringHolder& UN_GenericDataBufferRef< ContainerT, DataIDT >::bufferName ( UN_GenericBufferID  id) const
inline

Returns the name of the data buffer.

Definition at line 94 of file UN_GenericData.h.

template<typename ContainerT , typename DataIDT >
UN_GenericBufferType UN_GenericDataBufferRef< ContainerT, DataIDT >::bufferType ( UN_GenericBufferID  id) const
inline

Returns the data buffer type.

Definition at line 88 of file UN_GenericData.h.

template<typename ContainerT , typename DataIDT >
ContainerT& UN_GenericDataBufferRef< ContainerT, DataIDT >::container ( ) const
inline

Definition at line 81 of file UN_GenericData.h.

template<typename ContainerT , typename DataIDT >
template<typename T >
const T& UN_GenericDataBufferRef< ContainerT, DataIDT >::dataRef ( DataIDT  id) const
inline

Returns a const ref to the data value for a given data ID.

Definition at line 108 of file UN_GenericData.h.

template<typename ContainerT , typename DataIDT >
template<typename T >
T UN_GenericDataBufferRef< ContainerT, DataIDT >::dataVal ( DataIDT  id) const
inline

Returns a copy of the data value for a given data ID.

Definition at line 115 of file UN_GenericData.h.

template<typename ContainerT , typename DataIDT >
bool UN_GenericDataBufferRef< ContainerT, DataIDT >::isValid ( ) const
inline

Definition at line 77 of file UN_GenericData.h.

template<typename ContainerT , typename DataIDT >
UN_GenericDataBufferRef< ContainerT, DataIDT >::operator bool ( ) const
inlineexplicit

Definition at line 78 of file UN_GenericData.h.

template<typename ContainerT , typename DataIDT >
template<typename T >
void UN_GenericDataBufferRef< ContainerT, DataIDT >::setData ( DataIDT  id,
T &&  value 
)
inline

Sets the data value for a given data ID.

Definition at line 101 of file UN_GenericData.h.

template<typename ContainerT , typename DataIDT >
template<typename T >
T UN_GenericDataBufferRef< ContainerT, DataIDT >::stealData ( DataIDT  id)
inline

Moves the data value out of the buffer for a given data ID.

Definition at line 122 of file UN_GenericData.h.

template<typename ContainerT , typename DataIDT >
template<typename T , typename OP >
void UN_GenericDataBufferRef< ContainerT, DataIDT >::updateData ( DataIDT  id,
const OP &  op 
)
inline

Updates the data value in-place via a callable.

Definition at line 129 of file UN_GenericData.h.


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