cesium-native 0.43.0
Loading...
Searching...
No Matches
CesiumGltf::PropertyArrayCopy< ElementType > Class Template Reference

A copy of an array element of a PropertyTableProperty or PropertyTextureProperty. More...

#include <CesiumGltf/PropertyArrayView.h>

Public Member Functions

 PropertyArrayCopy ()
 Constructs an empty array view.
 
 PropertyArrayCopy (const std::vector< ElementType > &values) noexcept
 Constructs an array view from a buffer.
 
 PropertyArrayCopy (PropertyArrayCopy &&)=default
 Default move constructor.
 
PropertyArrayCopyoperator= (PropertyArrayCopy &&)=default
 Default move assignment operator.
 
 PropertyArrayCopy (std::vector< std::byte > &&buffer) noexcept
 Creates a new PropertyArrayCopy directly from a buffer of bytes, which will be moved into this copy.
 
 PropertyArrayCopy (const PropertyArrayCopy &rhs)
 Copy constructor.
 
PropertyArrayCopyoperator= (const PropertyArrayCopy &rhs)
 Copy assignment operator.
 
const ElementType & operator[] (int64_t index) const noexcept
 Returns the ElementType at the given index from this copy.
 
int64_t size () const noexcept
 The number of elements in this array.
 
auto begin ()
 The begin iterator.
 
auto end ()
 The end iterator.
 
auto begin () const
 The begin iterator.
 
auto end () const
 The end iterator.
 
const PropertyArrayView< ElementType > & view () const
 Obtains a PropertyArrayView over the contents of this copy.
 
PropertyArrayView< ElementType > toViewAndExternalBuffer (std::vector< std::byte > &outBuffer) &&
 Obtains a buffer and view from the copied data, leaving this PropertyArrayCopy empty.
 

Detailed Description

template<typename ElementType>
class CesiumGltf::PropertyArrayCopy< ElementType >

A copy of an array element of a PropertyTableProperty or PropertyTextureProperty.

Whereas PropertyArrayView is a pointer to data stored in a separate place, a PropertyArrayCopy owns the data that it's viewing.

Provides utility to retrieve the data stored in the array of elements via the array index operator.

Definition at line 77 of file PropertyArrayView.h.

Constructor & Destructor Documentation

◆ PropertyArrayCopy() [1/4]

template<typename ElementType >
CesiumGltf::PropertyArrayCopy< ElementType >::PropertyArrayCopy ( )
inline

Constructs an empty array view.

Definition at line 82 of file PropertyArrayView.h.

◆ PropertyArrayCopy() [2/4]

template<typename ElementType >
CesiumGltf::PropertyArrayCopy< ElementType >::PropertyArrayCopy ( const std::vector< ElementType > & values)
inlinenoexcept

Constructs an array view from a buffer.

Parameters
valuesThe buffer containing the values.

Definition at line 89 of file PropertyArrayView.h.

◆ PropertyArrayCopy() [3/4]

template<typename ElementType >
CesiumGltf::PropertyArrayCopy< ElementType >::PropertyArrayCopy ( std::vector< std::byte > && buffer)
inlinenoexcept

Creates a new PropertyArrayCopy directly from a buffer of bytes, which will be moved into this copy.

Definition at line 108 of file PropertyArrayView.h.

◆ PropertyArrayCopy() [4/4]

template<typename ElementType >
CesiumGltf::PropertyArrayCopy< ElementType >::PropertyArrayCopy ( const PropertyArrayCopy< ElementType > & rhs)
inline

Copy constructor.

Definition at line 112 of file PropertyArrayView.h.

Member Function Documentation

◆ begin() [1/2]

template<typename ElementType >
auto CesiumGltf::PropertyArrayCopy< ElementType >::begin ( )
inline

The begin iterator.

Definition at line 136 of file PropertyArrayView.h.

◆ begin() [2/2]

template<typename ElementType >
auto CesiumGltf::PropertyArrayCopy< ElementType >::begin ( ) const
inline

The begin iterator.

Definition at line 140 of file PropertyArrayView.h.

◆ end() [1/2]

template<typename ElementType >
auto CesiumGltf::PropertyArrayCopy< ElementType >::end ( )
inline

The end iterator.

Definition at line 138 of file PropertyArrayView.h.

◆ end() [2/2]

template<typename ElementType >
auto CesiumGltf::PropertyArrayCopy< ElementType >::end ( ) const
inline

The end iterator.

Definition at line 142 of file PropertyArrayView.h.

◆ operator=()

template<typename ElementType >
PropertyArrayCopy & CesiumGltf::PropertyArrayCopy< ElementType >::operator= ( const PropertyArrayCopy< ElementType > & rhs)
inline

Copy assignment operator.

Definition at line 116 of file PropertyArrayView.h.

◆ operator[]()

template<typename ElementType >
const ElementType & CesiumGltf::PropertyArrayCopy< ElementType >::operator[] ( int64_t index) const
inlinenoexcept

Returns the ElementType at the given index from this copy.

Parameters
indexThe index to obtain.
Returns
The ElementType at that index from the internal view.

Definition at line 128 of file PropertyArrayView.h.

◆ size()

template<typename ElementType >
int64_t CesiumGltf::PropertyArrayCopy< ElementType >::size ( ) const
inlinenoexcept

The number of elements in this array.

Definition at line 133 of file PropertyArrayView.h.

◆ toViewAndExternalBuffer()

template<typename ElementType >
PropertyArrayView< ElementType > CesiumGltf::PropertyArrayCopy< ElementType >::toViewAndExternalBuffer ( std::vector< std::byte > & outBuffer) &&
inline

Obtains a buffer and view from the copied data, leaving this PropertyArrayCopy empty.

Parameters
outBufferThe destination where this copy's internal buffer will be moved to.

Definition at line 157 of file PropertyArrayView.h.

◆ view()

template<typename ElementType >
const PropertyArrayView< ElementType > & CesiumGltf::PropertyArrayCopy< ElementType >::view ( ) const
inline

Obtains a PropertyArrayView over the contents of this copy.

Definition at line 147 of file PropertyArrayView.h.


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