public abstract

Inheritance Graph

graph BT
	AttributeAccessor
	AttributeAccessor --> ReferenceCounter
	click AttributeAccessor "classUtil_1_1AttributeAccessor"
	click ReferenceCounter "classUtil_1_1ReferenceCounter"

Description

AttributeAccessor Generic accessor for attributes of a resource format.

Public Types

   
   
typedef Reference < AttributeAccessor > Ref
   
typedef std::function< Ref (uint8_t *, size_t, const AttributeFormat &, size_t)> AccessorFactory_t
(uint8_t* ptr, size_t size, const AttributeFormat & attr, size_t stride) -> Ref

Protected Functions

   
   
  AttributeAccessor(uint8_t * ptr, size_t size, const AttributeFormat & attr, size_t stride)
   
void assertRange(uint32_t index) const

Public Functions

   
   
  ~AttributeAccessor()
   
void readRaw(size_t index, uint8_t * data, size_t size) const
   
void readValues(size_t index, int8_t * values, size_t count) const
   
void readValues(size_t index, int16_t * values, size_t count) const
   
void readValues(size_t index, int32_t * values, size_t count) const
   
void readValues(size_t index, int64_t * values, size_t count) const
   
void readValues(size_t index, uint8_t * values, size_t count) const
   
void readValues(size_t index, uint16_t * values, size_t count) const
   
void readValues(size_t index, uint32_t * values, size_t count) const
   
void readValues(size_t index, uint64_t * values, size_t count) const
   
void readValues(size_t index, float * values, size_t count) const
   
void readValues(size_t index, double * values, size_t count) const
template< typename T >  
T readValue(size_t index)
template< typename T >  
std::vector< T > readValues(size_t index)
   
void writeRaw(size_t index, const uint8_t * data, size_t size) const
   
void writeValues(size_t index, const int8_t * values, size_t count) const
   
void writeValues(size_t index, const int16_t * values, size_t count) const
   
void writeValues(size_t index, const int32_t * values, size_t count) const
   
void writeValues(size_t index, const int64_t * values, size_t count) const
   
void writeValues(size_t index, const uint8_t * values, size_t count) const
   
void writeValues(size_t index, const uint16_t * values, size_t count) const
   
void writeValues(size_t index, const uint32_t * values, size_t count) const
   
void writeValues(size_t index, const uint64_t * values, size_t count) const
   
void writeValues(size_t index, const float * values, size_t count) const
   
void writeValues(size_t index, const double * values, size_t count) const
template< typename T >  
void writeValue(size_t index, const T & value)
template< typename T >  
void writeValues(size_t index, const std::vector< T > & values)
   
const AttributeFormat & getAttribute() const
   
bool checkRange(uint32_t index) const
template< typename number_t >  
number_t * _ptr(size_t index) const
   
size_t getDataSize() const
Get the size in bytes of the accessed data.

Public Static Functions

   
   
Ref create(uint8_t * ptr, size_t size, const AttributeFormat & attr, size_t stride)
Creates a new attribute accessor for the given data using the specified resource format.
   
Ref create(uint8_t * ptr, size_t size, const ResourceFormat & format, const StringIdentifier & name)
   
bool registerAccessor(uint32_t internalType, const AccessorFactory_t & factory)
Registers an accessor for an internal type.
   
bool hasAccessor(const AttributeFormat & attr)

Documentation

typedef
Util::AttributeAccessor::Ref

public
 
 
typedef Reference < AttributeAccessor > Ref

Defined in Util/Resources/AttributeAccessor.h:41


typedef
Util::AttributeAccessor::AccessorFactory_t

public
 
 
typedef std::function< Ref (uint8_t *, size_t, const AttributeFormat &, size_t)> AccessorFactory_t

(uint8_t* ptr, size_t size, const AttributeFormat & attr, size_t stride) -> Ref

Defined in Util/Resources/AttributeAccessor.h:49


function
Util::AttributeAccessor::AttributeAccessor

protected inline
     
     
AttributeAccessor( uint8_t * ptr,
  size_t size,
  const AttributeFormat & attr,
  size_t stride
)    

Defined in Util/Resources/AttributeAccessor.h:30


function
Util::AttributeAccessor::assertRange

protected const inline
     
     
void assertRange( uint32_t index ) const

Defined in Util/Resources/AttributeAccessor.h:33


function
Util::AttributeAccessor::~AttributeAccessor

public virtual
   
   
~AttributeAccessor( )

Defined in Util/Resources/AttributeAccessor.h:42


function
Util::AttributeAccessor::readRaw

public const
     
     
void readRaw( size_t index,
  uint8_t * data,
  size_t size
) const    

Defined in Util/Resources/AttributeAccessor.h:55


function
Util::AttributeAccessor::readValues

public const virtual
     
     
void readValues( size_t index,
  int8_t * values,
  size_t count
) const    

Defined in Util/Resources/AttributeAccessor.h:56


function
Util::AttributeAccessor::readValues

public const virtual
     
     
void readValues( size_t index,
  int16_t * values,
  size_t count
) const    

Defined in Util/Resources/AttributeAccessor.h:57


function
Util::AttributeAccessor::readValues

public const virtual
     
     
void readValues( size_t index,
  int32_t * values,
  size_t count
) const    

Defined in Util/Resources/AttributeAccessor.h:58


function
Util::AttributeAccessor::readValues

public const virtual
     
     
void readValues( size_t index,
  int64_t * values,
  size_t count
) const    

Defined in Util/Resources/AttributeAccessor.h:59


function
Util::AttributeAccessor::readValues

public const virtual
     
     
void readValues( size_t index,
  uint8_t * values,
  size_t count
) const    

Defined in Util/Resources/AttributeAccessor.h:60


function
Util::AttributeAccessor::readValues

public const virtual
     
     
void readValues( size_t index,
  uint16_t * values,
  size_t count
) const    

Defined in Util/Resources/AttributeAccessor.h:61


function
Util::AttributeAccessor::readValues

public const virtual
     
     
void readValues( size_t index,
  uint32_t * values,
  size_t count
) const    

Defined in Util/Resources/AttributeAccessor.h:62


function
Util::AttributeAccessor::readValues

public const virtual
     
     
void readValues( size_t index,
  uint64_t * values,
  size_t count
) const    

Defined in Util/Resources/AttributeAccessor.h:63


function
Util::AttributeAccessor::readValues

public const virtual
     
     
void readValues( size_t index,
  float * values,
  size_t count
) const    

Defined in Util/Resources/AttributeAccessor.h:64


function
Util::AttributeAccessor::readValues

public const virtual
     
     
void readValues( size_t index,
  double * values,
  size_t count
) const    

Defined in Util/Resources/AttributeAccessor.h:65


function
Util::AttributeAccessor::readValue

public inline
     
template< typename T >    
T readValue( size_t index )

Reads a single value of any primitive type from the resource, starting at the given index. The value is internally converted to the correct type.

Defined in Util/Resources/AttributeAccessor.h:72


function
Util::AttributeAccessor::readValues

public inline
     
template< typename T >    
std::vector< T > readValues( size_t index )

Reads multiple values of any primitive type from the resource, starting at the given index. The values are internally converted to the correct type.

Defined in Util/Resources/AttributeAccessor.h:83


function
Util::AttributeAccessor::writeRaw

public const
     
     
void writeRaw( size_t index,
  const uint8_t * data,
  size_t size
) const    

Defined in Util/Resources/AttributeAccessor.h:89


function
Util::AttributeAccessor::writeValues

public const virtual
     
     
void writeValues( size_t index,
  const int8_t * values,
  size_t count
) const    

Defined in Util/Resources/AttributeAccessor.h:90


function
Util::AttributeAccessor::writeValues

public const virtual
     
     
void writeValues( size_t index,
  const int16_t * values,
  size_t count
) const    

Defined in Util/Resources/AttributeAccessor.h:91


function
Util::AttributeAccessor::writeValues

public const virtual
     
     
void writeValues( size_t index,
  const int32_t * values,
  size_t count
) const    

Defined in Util/Resources/AttributeAccessor.h:92


function
Util::AttributeAccessor::writeValues

public const virtual
     
     
void writeValues( size_t index,
  const int64_t * values,
  size_t count
) const    

Defined in Util/Resources/AttributeAccessor.h:93


function
Util::AttributeAccessor::writeValues

public const virtual
     
     
void writeValues( size_t index,
  const uint8_t * values,
  size_t count
) const    

Defined in Util/Resources/AttributeAccessor.h:94


function
Util::AttributeAccessor::writeValues

public const virtual
     
     
void writeValues( size_t index,
  const uint16_t * values,
  size_t count
) const    

Defined in Util/Resources/AttributeAccessor.h:95


function
Util::AttributeAccessor::writeValues

public const virtual
     
     
void writeValues( size_t index,
  const uint32_t * values,
  size_t count
) const    

Defined in Util/Resources/AttributeAccessor.h:96


function
Util::AttributeAccessor::writeValues

public const virtual
     
     
void writeValues( size_t index,
  const uint64_t * values,
  size_t count
) const    

Defined in Util/Resources/AttributeAccessor.h:97


function
Util::AttributeAccessor::writeValues

public const virtual
     
     
void writeValues( size_t index,
  const float * values,
  size_t count
) const    

Defined in Util/Resources/AttributeAccessor.h:98


function
Util::AttributeAccessor::writeValues

public const virtual
     
     
void writeValues( size_t index,
  const double * values,
  size_t count
) const    

Defined in Util/Resources/AttributeAccessor.h:99


function
Util::AttributeAccessor::writeValue

public inline
     
template< typename T >    
void writeValue( size_t index,
  const T & value
)    

Writes a single value of any primitive type into the resource, starting at the given index. The value is internally converted to the correct type.

Defined in Util/Resources/AttributeAccessor.h:106


function
Util::AttributeAccessor::writeValues

public inline
     
template< typename T >    
void writeValues( size_t index,
  const std::vector< T > & values
)    

Writes multiple values of any primitive type into the resource, starting at the given index. The values are internally converted to the correct type.

Defined in Util/Resources/AttributeAccessor.h:115


function
Util::AttributeAccessor::getAttribute

public const inline
   
   
const AttributeFormat & getAttribute( ) const

Returns the resource format attribute this accessor is associated with.

Defined in Util/Resources/AttributeAccessor.h:122


function
Util::AttributeAccessor::checkRange

public const inline
     
     
bool checkRange( uint32_t index ) const

Checks whether theindexis in range.

Defined in Util/Resources/AttributeAccessor.h:127


function
Util::AttributeAccessor::_ptr

public const inline
     
template< typename number_t >    
number_t * _ptr( size_t index ) const

Returns the raw data pointer to the resource attribute at the given index.

Defined in Util/Resources/AttributeAccessor.h:133


function
Util::AttributeAccessor::getDataSize

public const inline
   
   
size_t getDataSize( ) const

Get the size in bytes of the accessed data.

Defined in Util/Resources/AttributeAccessor.h:136


function
Util::AttributeAccessor::create

public static
     
     
Ref create( uint8_t * ptr,
  size_t size,
  const AttributeFormat & attr,
  size_t stride
)    

Creates a new attribute accessor for the given data using the specified resource format.

Defined in Util/Resources/AttributeAccessor.h:45


function
Util::AttributeAccessor::create

public static
     
     
Ref create( uint8_t * ptr,
  size_t size,
  const ResourceFormat & format,
  const StringIdentifier & name
)    

Defined in Util/Resources/AttributeAccessor.h:46


function
Util::AttributeAccessor::registerAccessor

public static
     
     
bool registerAccessor( uint32_t internalType,
  const AccessorFactory_t & factory
)    

Registers an accessor for an internal type.

Defined in Util/Resources/AttributeAccessor.h:52


function
Util::AttributeAccessor::hasAccessor

public static
     
     
bool hasAccessor( const AttributeFormat & attr )

Defined in Util/Resources/AttributeAccessor.h:53