OpenVDB 13.0.0

Loading...
Searching...
No Matches
TypedAttributeArray< ValueType_, Codec_ > Class Template Referencefinal

Typed class for storing attribute data. More...

`#include <openvdb/points/AttributeArray.h>`

Inheritance diagram for TypedAttributeArray< ValueType_, Codec_ >:

## Public Types
using | Ptr = std::shared_ptr<TypedAttributeArray>
using | ConstPtr = std::shared_ptr<const TypedAttributeArray>
using | ValueType = ValueType_
using | Codec = Codec_
using | StorageType = typename Codec::template Storage<ValueType>::Type
enum | Flag { TRANSIENT = 0x1 , HIDDEN = 0x2 , CONSTANTSTRIDE = 0x8 , STREAMING = 0x10 , PARTIALREAD = 0x20 }
enum | SerializationFlag { WRITESTRIDED = 0x1 , WRITEUNIFORM = 0x2 , WRITEMEMCOMPRESS = 0x4 , WRITEPAGED = 0x8 }
using | FactoryMethod = Ptr (*)(Index, Index, bool, const Metadata*)

## Public Member Functions
| TypedAttributeArray (Index n=1, Index strideOrTotalSize=1, bool constantStride=true, const ValueType &uniformValue=zeroVal< ValueType >())
| Default constructor, always constructs a uniform attribute.
| TypedAttributeArray (const TypedAttributeArray &)
TypedAttributeArray & | operator= (const TypedAttributeArray &)
| TypedAttributeArray (TypedAttributeArray &&)=delete
| Move constructor disabled.
TypedAttributeArray & | operator= (TypedAttributeArray &&)=delete
| Move assignment operator disabled.
| ~TypedAttributeArray () override
AttributeArray::Ptr | copy () const override
const NamePair & | type () const override
| Return the name of this attribute's type.
Index | size () const override
| Return the number of elements in this array.
Index | stride () const override
Index | dataSize () const override
| Return the size of the data in this array.
Name | valueType () const override
| Return the name of the value type of a single element in this array (e.g., "float" or "vec3d").
Name | codecType () const override
| Return the name of the codec used by this array (e.g., "trnc" or "fxpt").
Index | valueTypeSize () const override
| Return the size in bytes of the value type of a single element in this array.
Index | storageTypeSize () const override
bool | valueTypeIsFloatingPoint () const override
| Return `true` if the value type is floating point.
bool | valueTypeIsClass () const override
| Return `true` if the value type is a class (ie vector, matrix or quaternion return true).
bool | valueTypeIsVector () const override
| Return `true` if the value type is a vector.
bool | valueTypeIsQuaternion () const override
| Return `true` if the value type is a quaternion.
bool | valueTypeIsMatrix () const override
| Return `true` if the value type is a matrix.
size_t | memUsage () const override
| Return the number of bytes of memory used by this attribute.
size_t | memUsageIfLoaded () const override
ValueType | getUnsafe (Index n) const
| Return the value at index n (assumes in-core).
ValueType | get (Index n) const
| Return the value at index n.
template<typename T>
void | getUnsafe (Index n, T &value) const
| Return the value at index n (assumes in-core).
template<typename T>
void | get (Index n, T &value) const
| Return the value at index n.
void | setUnsafe (Index n, const ValueType &value)
| Set value at the given index n (assumes in-core).
void | set (Index n, const ValueType &value)
| Set value at the given index n.
template<typename T>
void | setUnsafe (Index n, const T &value)
| Set value at the given index n (assumes in-core).
template<typename T>
void | set (Index n, const T &value)
| Set value at the given index n.
bool | isUniform () const override
| Return `true` if this array is stored as a single uniform value.
void | expand (bool fill=true) override
| Replace the single value storage with an array of length size().
void | collapse () override
| Replace the existing array with a uniform zero value.
bool | compact () override
| Compact the existing array to become uniform if all values are identical.
void | collapse (const ValueType &uniformValue)
| Replace the existing array with the given uniform value.
void | fill (const ValueType &value)
| Fill the existing array with the given value.
void | read (std::istream &) override
| Read attribute data from a stream.
void | write (std::ostream &os, bool outputTransient) const override
void | write (std::ostream &) const override
| Write attribute data to a stream, don't write transient attributes.
void | readMetadata (std::istream &) override
| Read attribute metadata from a stream.
void | writeMetadata (std::ostream &os, bool outputTransient, bool paged) const override
void | readBuffers (std::istream &) override
| Read attribute buffers from a stream.
void | writeBuffers (std::ostream &os, bool outputTransient) const override
void | readPagedBuffers (compression::PagedInputStream &) override
| Read attribute buffers from a paged stream.
void | writePagedBuffers (compression::PagedOutputStream &os, bool outputTransient) const override
bool | isOutOfCore () const
| Return `true` if this buffer's values have not yet been read from disk.
void | loadData () const override
| Ensures all data is in-core.
bool | isDataLoaded () const override
| Return `true` if all data has been loaded.
const StorageType * | constData () const
| Return the raw data buffer.
template<typename AttributeArrayType>
bool | isType () const
| Return `true` if this attribute is of the same type as the template parameter.
template<typename ValueType>
bool | hasValueType () const
| Return `true` if this attribute has a value type the same as the template parameter.
template<typename IterT>
void | copyValuesUnsafe (const AttributeArray &sourceArray, const IterT &iter)
| Copy values into this array from a source array to a target array as referenced by an iterator.
template<typename IterT>
void | copyValues (const AttributeArray &sourceArray, const IterT &iter, bool compact=true)
| Like copyValuesUnsafe(), but if compact is true, attempt to collapse this array.
void | setHidden (bool state)
| Specify whether this attribute should be hidden (e.g., from UI or iterators).
bool | isHidden () const
| Return `true` if this attribute is hidden (e.g., from UI or iterators).
void | setTransient (bool state)
| Specify whether this attribute should only exist in memory and not be serialized during stream output.
bool | isTransient () const
| Return `true` if this attribute is not serialized during stream output.
void | setStreaming (bool state)
| Specify whether this attribute is to be streamed off disk, in which case, the attributes are collapsed after being first loaded leaving them in a destroyed state.
bool | isStreaming () const
| Return `true` if this attribute is in streaming mode.
bool | hasConstantStride () const
| Return `true` if this attribute has a constant stride.
uint8_t | flags () const
| Retrieve the attribute array flags.
bool | operator== (const AttributeArray &other) const
bool | operator!= (const AttributeArray &other) const
const char * | constDataAsByteArray () const
| Indirect virtual function to retrieve the data buffer cast to a char byte array.

## Static Public Member Functions
static Ptr | create (Index n, Index strideOrTotalSize=1, bool constantStride=true, const Metadata *metadata=nullptr)
| Return a new attribute array of the given length n and stride with uniform value zero.
static TypedAttributeArray & | cast (AttributeArray &attributeArray)
| Cast an AttributeArray to TypedAttributeArray<T>.
static const TypedAttributeArray & | cast (const AttributeArray &attributeArray)
| Cast an AttributeArray to TypedAttributeArray<T>.
static const NamePair & | attributeType ()
| Return the name of this attribute's type (includes codec).
static bool | isRegistered ()
| Return `true` if this attribute type is registered.
static void | registerType ()
| Register this attribute type along with a factory function.
static void | unregisterType ()
| Remove this attribute type from the registry.
static ValueType | getUnsafe (const AttributeArray *array, const Index n)
static void | setUnsafe (AttributeArray *array, const Index n, const ValueType &value)
static void | collapse (AttributeArray *array, const ValueType &value)
| Non-member equivalent to collapse() that static_casts array to this TypedAttributeArray.
static void | fill (AttributeArray *array, const ValueType &value)
| Non-member equivalent to fill() that static_casts array to this TypedAttributeArray.
static Ptr | create (const NamePair &type, Index length, Index stride=1, bool constantStride=true, const Metadata *metadata=nullptr, const ScopedRegistryLock *lock=nullptr)
static bool | isRegistered (const NamePair &type, const ScopedRegistryLock *lock=nullptr)
| Return `true` if the given attribute type name is registered.
static void | clearRegistry (const ScopedRegistryLock *lock=nullptr)
| Clear the attribute type registry.

## Protected Types
using | AccessorBasePtr = std::shared_ptr<AccessorBase>

## Protected Member Functions
AccessorBasePtr | getAccessor () const override
| Obtain an Accessor that stores getter and setter functors.
StorageType * | data ()
| Return the raw data buffer.
const StorageType * | data () const
bool | validData () const
| Verify that data is not out-of-core or in a partially-read state.
void | setConstantStride (bool state)
| Specify whether this attribute has a constant stride or not.

## Static Protected Member Functions
static void | registerType (const NamePair &type, FactoryMethod, const ScopedRegistryLock *lock=nullptr)
| Register a attribute type along with a factory function.
static void | unregisterType (const NamePair &type, const ScopedRegistryLock *lock=nullptr)
| Remove a attribute type from the registry.

## Protected Attributes
bool | mIsUniform = true
tbb::spin_mutex | mMutex
uint8_t | mFlags = 0
uint8_t | mUsePagedRead = 0
std::atomic< Index32 > | mOutOfCore
union { |
compression::PageHandle::Ptr mPageHandle |
size_t mCompressedBytes |
}; |
| used for out-of-core, paged reading

## Friends
class | ::TestAttributeArray

## Detailed Description

template<typename ValueType_, typename Codec_ = NullCodec>
class openvdb::v13_0::points::TypedAttributeArray< ValueType_, Codec_ >

Typed class for storing attribute data.

## Member Typedef Documentation

## ◆ AccessorBasePtr

using AccessorBasePtr = std::shared_ptr<AccessorBase>
| protected inherited

## ◆ Codec

template<typename ValueType_, typename Codec_ = NullCodec>

using Codec = Codec_

## ◆ ConstPtr

template<typename ValueType_, typename Codec_ = NullCodec>

using ConstPtr = std::shared_ptr<const TypedAttributeArray>

## ◆ FactoryMethod

using FactoryMethod = Ptr (*)(Index, Index, bool, const Metadata*)
| inherited

## ◆ Ptr

template<typename ValueType_, typename Codec_ = NullCodec>

using Ptr = std::shared_ptr<TypedAttributeArray>

## ◆ StorageType

template<typename ValueType_, typename Codec_ = NullCodec>

using StorageType = typename Codec::template Storage<ValueType>::Type

## ◆ ValueType

template<typename ValueType_, typename Codec_ = NullCodec>

using ValueType = ValueType_

## Member Enumeration Documentation

## ◆ Flag

enum Flag
| inherited

Enumerator
TRANSIENT |
HIDDEN | by default not written to disk
CONSTANTSTRIDE | hidden from UIs or iterators
STREAMING | stride size does not vary in the array
PARTIALREAD | streaming mode collapses attributes when first accessed

## ◆ SerializationFlag

enum SerializationFlag
| inherited

Enumerator
WRITESTRIDED |
WRITEUNIFORM | data is marked as strided when written
WRITEMEMCOMPRESS | data is marked as uniform when written
WRITEPAGED | data is marked as compressed in-memory when written (deprecated flag as of ABI=6)

## Constructor & Destructor Documentation

## ◆ TypedAttributeArray() [1/3]

template<typename ValueType_, typename Codec_>

TypedAttributeArray | ( | Index | n = 1,
|  | Index | strideOrTotalSize = 1,
|  | bool | constantStride = true,
|  | const ValueType & | uniformValue = zeroVal<ValueType>() )
| explicit

Default constructor, always constructs a uniform attribute.

## ◆ TypedAttributeArray() [2/3]

template<typename ValueType_, typename Codec_>

TypedAttributeArray | ( | const TypedAttributeArray< ValueType_, Codec_ > & | rhs | ) |

Deep copy constructor.

Note
  This method is thread-safe (as of ABI=7) for concurrently reading from the source attribute array while being deep-copied. Specifically, this means that the attribute array being deep-copied can be out-of-core and safely loaded in one thread while being copied using this copy-constructor in another thread. It is not thread-safe for write.

## ◆ TypedAttributeArray() [3/3]

template<typename ValueType_, typename Codec_ = NullCodec>

TypedAttributeArray | ( | TypedAttributeArray< ValueType_, Codec_ > && |  | ) |
| delete

Move constructor disabled.

## ◆ ~TypedAttributeArray()

template<typename ValueType_, typename Codec_ = NullCodec>

~TypedAttributeArray | ( |  | ) |
| inline override

## Member Function Documentation

## ◆ attributeType()

template<typename ValueType_, typename Codec_>

const NamePair & attributeType | ( |  | ) |
| inline static

Return the name of this attribute's type (includes codec).

## ◆ cast() [1/2]

template<typename ValueType_, typename Codec_>

TypedAttributeArray< ValueType_, Codec_ > & cast | ( | AttributeArray & | attributeArray | ) |
| inline static

Cast an AttributeArray to TypedAttributeArray<T>.

## ◆ cast() [2/2]

template<typename ValueType_, typename Codec_>

const TypedAttributeArray< ValueType_, Codec_ > & cast | ( | const AttributeArray & | attributeArray | ) |
| inline static

Cast an AttributeArray to TypedAttributeArray<T>.

## ◆ clearRegistry()

void clearRegistry | ( | const ScopedRegistryLock * | lock = nullptr | ) |
| static inherited

Clear the attribute type registry.

## ◆ codecType()

template<typename ValueType_, typename Codec_ = NullCodec>

Name codecType | ( |  | ) | const
| inline override virtual

Return the name of the codec used by this array (e.g., "trnc" or "fxpt").

Implements AttributeArray.

## ◆ collapse() [1/3]

template<typename ValueType_, typename Codec_>

void collapse | ( |  | ) |
| override virtual

Replace the existing array with a uniform zero value.

Implements AttributeArray.

## ◆ collapse() [2/3]

template<typename ValueType_, typename Codec_>

void collapse | ( | AttributeArray * | array,
|  | const ValueType & | value )
| static

Non-member equivalent to collapse() that static_casts array to this TypedAttributeArray.

## ◆ collapse() [3/3]

template<typename ValueType_, typename Codec_>

void collapse | ( | const ValueType & | uniformValue | ) |

Replace the existing array with the given uniform value.

## ◆ compact()

template<typename ValueType_, typename Codec_>

bool compact | ( |  | ) |
| override virtual

Compact the existing array to become uniform if all values are identical.

Implements AttributeArray.

## ◆ constData()

template<typename ValueType_, typename Codec_ = NullCodec>

const StorageType * constData | ( |  | ) | const
| inline

Return the raw data buffer.

## ◆ constDataAsByteArray()

const char * constDataAsByteArray | ( |  | ) | const
| inline inherited

Indirect virtual function to retrieve the data buffer cast to a char byte array.

## ◆ copy()

template<typename ValueType_, typename Codec_>

AttributeArray::Ptr copy | ( |  | ) | const
| override virtual

Return a copy of this attribute.

Note
  This method is thread-safe.

Implements AttributeArray.

## ◆ copyValues()

template<typename IterT>

void copyValues | ( | const AttributeArray & | sourceArray,
|  | const IterT & | iter,
|  | bool | compact = true )
| inherited

Like copyValuesUnsafe(), but if compact is true, attempt to collapse this array.

Note
  This method is not thread-safe, it must be guaranteed that this array is not concurrently modified by another thread and that the source array is also not modified.

## ◆ copyValuesUnsafe()

template<typename IterT>

void copyValuesUnsafe | ( | const AttributeArray & | sourceArray,
|  | const IterT & | iter )
| inherited

Copy values into this array from a source array to a target array as referenced by an iterator.

Iterators must adhere to the ForwardIterator interface described in the example below:

struct MyIterator
{
// returns true if the iterator is referencing valid copying indices
operator bool() const;
// increments the iterator
MyIterator& operator++();
// returns the source index that the iterator is referencing for copying
Index sourceIndex() const;
// returns the target index that the iterator is referencing for copying
Index targetIndex() const;
};
openvdb::v13_0::Index
Index32 Index
Definition Types.h:34

Note
  It is assumed that the strided storage sizes match, the arrays are both in-core, and both value types are floating-point or both integer.
  It is possible to use this method to write to a uniform target array if the iterator does not have non-zero target indices.
  This method is not thread-safe, it must be guaranteed that this array is not concurrently modified by another thread and that the source array is also not modified.

## ◆ create() [1/2]

Ptr create | ( | const NamePair & | type,
|  | Index | length,
|  | Index | stride = 1,
|  | bool | constantStride = true,
|  | const Metadata * | metadata = nullptr,
|  | const ScopedRegistryLock * | lock = nullptr )
| static inherited

Create a new attribute array of the given (registered) type, length and stride.

If lock is non-null, the AttributeArray registry mutex has already been locked

## ◆ create() [2/2]

template<typename ValueType_, typename Codec_>

TypedAttributeArray< ValueType_, Codec_ >::Ptr create | ( | Index | n,
|  | Index | strideOrTotalSize = 1,
|  | bool | constantStride = true,
|  | const Metadata * | metadata = nullptr )
| inline static

Return a new attribute array of the given length n and stride with uniform value zero.

## ◆ data() [1/2]

template<typename ValueType_, typename Codec_ = NullCodec>

StorageType * data | ( |  | ) |
| inline protected

Return the raw data buffer.

## ◆ data() [2/2]

template<typename ValueType_, typename Codec_ = NullCodec>

const StorageType * data | ( |  | ) | const
| inline protected

## ◆ dataSize()

template<typename ValueType_, typename Codec_ = NullCodec>

Index dataSize | ( |  | ) | const
| inline override virtual

Return the size of the data in this array.

Implements AttributeArray.

## ◆ expand()

template<typename ValueType_, typename Codec_>

void expand | ( | bool | fill = true | ) |
| override virtual

Replace the single value storage with an array of length size().

Note
  Non-uniform attributes are unchanged.

Parameters

  fill | toggle to initialize the array elements with the pre-expanded value.

Implements AttributeArray.

## ◆ fill() [1/2]

template<typename ValueType_, typename Codec_>

void fill | ( | AttributeArray * | array,
|  | const ValueType & | value )
| static

Non-member equivalent to fill() that static_casts array to this TypedAttributeArray.

## ◆ fill() [2/2]

template<typename ValueType_, typename Codec_>

void fill | ( | const ValueType & | value | ) |

Fill the existing array with the given value.

Note
  Identical to collapse() except a non-uniform array will not become uniform.

## ◆ flags()

uint8_t flags | ( |  | ) | const
| inline inherited

Retrieve the attribute array flags.

## ◆ get() [1/2]

template<typename ValueType_, typename Codec_>

TypedAttributeArray< ValueType_, Codec_ >::ValueType get | ( | Index | n | ) | const

Return the value at index n.

## ◆ get() [2/2]

template<typename ValueType_, typename Codec_>
template<typename T>

void get | ( | Index | n,
|  | T & | value ) const

Return the value at index n.

## ◆ getAccessor()

template<typename ValueType_, typename Codec_>

AttributeArray::AccessorBasePtr getAccessor | ( |  | ) | const
| override protected virtual

Obtain an Accessor that stores getter and setter functors.

Implements AttributeArray.

## ◆ getUnsafe() [1/3]

template<typename ValueType_, typename Codec_>

TypedAttributeArray< ValueType_, Codec_ >::ValueType getUnsafe | ( | const AttributeArray * | array,
|  | const Index | n )
| static

Non-member equivalent to getUnsafe() that static_casts array to this TypedAttributeArray (assumes in-core)

## ◆ getUnsafe() [2/3]

template<typename ValueType_, typename Codec_>

TypedAttributeArray< ValueType_, Codec_ >::ValueType getUnsafe | ( | Index | n | ) | const

Return the value at index n (assumes in-core).

## ◆ getUnsafe() [3/3]

template<typename ValueType_, typename Codec_>
template<typename T>

void getUnsafe | ( | Index | n,
|  | T & | value ) const

Return the value at index n (assumes in-core).

## ◆ hasConstantStride()

bool hasConstantStride | ( |  | ) | const
| inline inherited

Return `true` if this attribute has a constant stride.

## ◆ hasValueType()

template<typename ValueType>

bool hasValueType | ( |  | ) | const
| inline inherited

Return `true` if this attribute has a value type the same as the template parameter.

## ◆ isDataLoaded()

template<typename ValueType_, typename Codec_>

bool isDataLoaded | ( |  | ) | const
| override virtual

Return `true` if all data has been loaded.

Implements AttributeArray.

## ◆ isHidden()

bool isHidden | ( |  | ) | const
| inline inherited

Return `true` if this attribute is hidden (e.g., from UI or iterators).

## ◆ isOutOfCore()

template<typename ValueType_, typename Codec_>

bool isOutOfCore | ( |  | ) | const
| inline

Return `true` if this buffer's values have not yet been read from disk.

## ◆ isRegistered() [1/2]

bool isRegistered | ( | const NamePair & | type,
|  | const ScopedRegistryLock * | lock = nullptr )
| static inherited

Return `true` if the given attribute type name is registered.

## ◆ isRegistered() [2/2]

template<typename ValueType_, typename Codec_>

bool isRegistered | ( |  | ) |
| inline static

Return `true` if this attribute type is registered.

## ◆ isStreaming()

bool isStreaming | ( |  | ) | const
| inline inherited

Return `true` if this attribute is in streaming mode.

## ◆ isTransient()

bool isTransient | ( |  | ) | const
| inline inherited

Return `true` if this attribute is not serialized during stream output.

## ◆ isType()

template<typename AttributeArrayType>

bool isType | ( |  | ) | const
| inline inherited

Return `true` if this attribute is of the same type as the template parameter.

## ◆ isUniform()

template<typename ValueType_, typename Codec_ = NullCodec>

bool isUniform | ( |  | ) | const
| inline override virtual

Return `true` if this array is stored as a single uniform value.

Implements AttributeArray.

## ◆ loadData()

template<typename ValueType_, typename Codec_>

void loadData | ( |  | ) | const
| override virtual

Ensures all data is in-core.

Implements AttributeArray.

## ◆ memUsage()

template<typename ValueType_, typename Codec_>

size_t memUsage | ( |  | ) | const
| override virtual

Return the number of bytes of memory used by this attribute.

Implements AttributeArray.

## ◆ memUsageIfLoaded()

template<typename ValueType_, typename Codec_>

size_t memUsageIfLoaded | ( |  | ) | const
| override virtual

Return the number of bytes of memory used by this attribute array once it has been deserialized (this may be different to memUsage() if delay-loading is in use). Note that this method does NOT consider the fact that a uniform attribute could be expanded and only deals with delay-loading.

Implements AttributeArray.

## ◆ operator!=()

bool operator!= | ( | const AttributeArray & | other | ) | const
| inline inherited

## ◆ operator=() [1/2]

template<typename ValueType_, typename Codec_>

TypedAttributeArray< ValueType_, Codec_ > & operator= | ( | const TypedAttributeArray< ValueType_, Codec_ > & | rhs | ) |

Deep copy assignment operator.

Note
  this operator is thread-safe.

## ◆ operator=() [2/2]

template<typename ValueType_, typename Codec_ = NullCodec>

TypedAttributeArray & operator= | ( | TypedAttributeArray< ValueType_, Codec_ > && |  | ) |
| delete

Move assignment operator disabled.

## ◆ operator==()

bool operator== | ( | const AttributeArray & | other | ) | const
| inherited

Check the compressed bytes and flags. If they are equal, perform a deeper comparison check necessary on the inherited types (TypedAttributeArray) Requires non operator implementation due to inheritance

## ◆ read()

template<typename ValueType_, typename Codec_>

void read | ( | std::istream & | is | ) |
| override virtual

Read attribute data from a stream.

Implements AttributeArray.

## ◆ readBuffers()

template<typename ValueType_, typename Codec_>

void readBuffers | ( | std::istream & | is | ) |
| override virtual

Read attribute buffers from a stream.

Implements AttributeArray.

## ◆ readMetadata()

template<typename ValueType_, typename Codec_>

void readMetadata | ( | std::istream & | is | ) |
| override virtual

Read attribute metadata from a stream.

Implements AttributeArray.

## ◆ readPagedBuffers()

template<typename ValueType_, typename Codec_>

void readPagedBuffers | ( | compression::PagedInputStream & | is | ) |
| override virtual

Read attribute buffers from a paged stream.

Implements AttributeArray.

## ◆ registerType() [1/2]

void registerType | ( | const NamePair & | type,
|  | FactoryMethod | ,
|  | const ScopedRegistryLock * | lock = nullptr )
| static protected inherited

Register a attribute type along with a factory function.

## ◆ registerType() [2/2]

template<typename ValueType_, typename Codec_>

void registerType | ( |  | ) |
| inline static

Register this attribute type along with a factory function.

## ◆ set() [1/2]

template<typename ValueType_, typename Codec_>
template<typename T>

void set | ( | Index | n,
|  | const T & | value )

Set value at the given index n.

## ◆ set() [2/2]

template<typename ValueType_, typename Codec_>

void set | ( | Index | n,
|  | const ValueType & | value )

Set value at the given index n.

## ◆ setConstantStride()

void setConstantStride | ( | bool | state | ) |
| protected inherited

Specify whether this attribute has a constant stride or not.

## ◆ setHidden()

void setHidden | ( | bool | state | ) |
| inherited

Specify whether this attribute should be hidden (e.g., from UI or iterators).

This is useful if the attribute is used for blind data or as scratch space for a calculation.

Note
  Attributes are not hidden by default.

## ◆ setStreaming()

void setStreaming | ( | bool | state | ) |
| inherited

Specify whether this attribute is to be streamed off disk, in which case, the attributes are collapsed after being first loaded leaving them in a destroyed state.

Note
  This operation is not thread-safe.

## ◆ setTransient()

void setTransient | ( | bool | state | ) |
| inherited

Specify whether this attribute should only exist in memory and not be serialized during stream output.

Note
  Attributes are not transient by default.

## ◆ setUnsafe() [1/3]

template<typename ValueType_, typename Codec_>

void setUnsafe | ( | AttributeArray * | array,
|  | const Index | n,
|  | const ValueType & | value )
| static

Non-member equivalent to setUnsafe() that static_casts array to this TypedAttributeArray (assumes in-core)

## ◆ setUnsafe() [2/3]

template<typename ValueType_, typename Codec_>
template<typename T>

void setUnsafe | ( | Index | n,
|  | const T & | value )

Set value at the given index n (assumes in-core).

## ◆ setUnsafe() [3/3]

template<typename ValueType_, typename Codec_>

void setUnsafe | ( | Index | n,
|  | const ValueType & | value )

Set value at the given index n (assumes in-core).

## ◆ size()

template<typename ValueType_, typename Codec_ = NullCodec>

Index size | ( |  | ) | const
| inline override virtual

Return the number of elements in this array.

Implements AttributeArray.

## ◆ storageTypeSize()

template<typename ValueType_, typename Codec_ = NullCodec>

Index storageTypeSize | ( |  | ) | const
| inline override virtual

Return the size in bytes of the storage type of a single element of this array.

Note
  If the Codec is a NullCodec, valueSize() == storageSize()

Implements AttributeArray.

## ◆ stride()

template<typename ValueType_, typename Codec_ = NullCodec>

Index stride | ( |  | ) | const
| inline override virtual

Return the stride of this array.

Note
  A return value of zero means a variable stride

Implements AttributeArray.

## ◆ type()

template<typename ValueType_, typename Codec_ = NullCodec>

const NamePair & type | ( |  | ) | const
| inline override virtual

Return the name of this attribute's type.

Implements AttributeArray.

## ◆ unregisterType() [1/2]

void unregisterType | ( | const NamePair & | type,
|  | const ScopedRegistryLock * | lock = nullptr )
| static protected inherited

Remove a attribute type from the registry.

## ◆ unregisterType() [2/2]

template<typename ValueType_, typename Codec_>

void unregisterType | ( |  | ) |
| inline static

Remove this attribute type from the registry.

## ◆ validData()

template<typename ValueType_, typename Codec_ = NullCodec>

bool validData | ( |  | ) | const
| inline protected

Verify that data is not out-of-core or in a partially-read state.

## ◆ valueType()

template<typename ValueType_, typename Codec_ = NullCodec>

Name valueType | ( |  | ) | const
| inline override virtual

Return the name of the value type of a single element in this array (e.g., "float" or "vec3d").

Implements AttributeArray.

## ◆ valueTypeIsClass()

template<typename ValueType_, typename Codec_>

bool valueTypeIsClass | ( |  | ) | const
| override virtual

Return `true` if the value type is a class (ie vector, matrix or quaternion return true).

Implements AttributeArray.

## ◆ valueTypeIsFloatingPoint()

template<typename ValueType_, typename Codec_>

bool valueTypeIsFloatingPoint | ( |  | ) | const
| override virtual

Return `true` if the value type is floating point.

Implements AttributeArray.

## ◆ valueTypeIsMatrix()

template<typename ValueType_, typename Codec_>

bool valueTypeIsMatrix | ( |  | ) | const
| override virtual

Return `true` if the value type is a matrix.

Implements AttributeArray.

## ◆ valueTypeIsQuaternion()

template<typename ValueType_, typename Codec_>

bool valueTypeIsQuaternion | ( |  | ) | const
| override virtual

Return `true` if the value type is a quaternion.

Implements AttributeArray.

## ◆ valueTypeIsVector()

template<typename ValueType_, typename Codec_>

bool valueTypeIsVector | ( |  | ) | const
| override virtual

Return `true` if the value type is a vector.

Implements AttributeArray.

## ◆ valueTypeSize()

template<typename ValueType_, typename Codec_ = NullCodec>

Index valueTypeSize | ( |  | ) | const
| inline override virtual

Return the size in bytes of the value type of a single element in this array.

Implements AttributeArray.

## ◆ write() [1/2]

template<typename ValueType_, typename Codec_>

void write | ( | std::ostream & | os | ) | const
| override virtual

Write attribute data to a stream, don't write transient attributes.

Implements AttributeArray.

## ◆ write() [2/2]

template<typename ValueType_, typename Codec_>

void write | ( | std::ostream & | os,
|  | bool | outputTransient ) const
| override virtual

Write attribute data to a stream.

Parameters

  os | the output stream
  outputTransient | if true, write out transient attributes

Implements AttributeArray.

## ◆ writeBuffers()

template<typename ValueType_, typename Codec_>

void writeBuffers | ( | std::ostream & | os,
|  | bool | outputTransient ) const
| override virtual

Write attribute buffers to a stream.

Parameters

  os | the output stream
  outputTransient | if true, write out transient attributes

Implements AttributeArray.

## ◆ writeMetadata()

template<typename ValueType_, typename Codec_>

void writeMetadata | ( | std::ostream & | os,
|  | bool | outputTransient,
|  | bool | paged ) const
| override virtual

Write attribute metadata to a stream.

Parameters

  os | the output stream
  outputTransient | if true, write out transient attributes
  paged | if true, data is written out in pages

Implements AttributeArray.

## ◆ writePagedBuffers()

template<typename ValueType_, typename Codec_>

void writePagedBuffers | ( | compression::PagedOutputStream & | os,
|  | bool | outputTransient ) const
| override virtual

Write attribute buffers to a paged stream.

Parameters

  os | the output stream
  outputTransient | if true, write out transient attributes

Implements AttributeArray.

## Friends And Related Symbol Documentation

## ◆ ::TestAttributeArray

template<typename ValueType_, typename Codec_ = NullCodec>

friend class ::TestAttributeArray
| friend

## Member Data Documentation

## ◆ [union]

union { ... }

used for out-of-core, paged reading

## ◆ mCompressedBytes

size_t mCompressedBytes
| inherited

## ◆ mFlags

uint8_t mFlags = 0
| protected inherited

## ◆ mIsUniform

bool mIsUniform = true
| protected inherited

## ◆ mMutex

tbb::spin_mutex mMutex
| mutable protected inherited

## ◆ mOutOfCore

std::atomic<Index32> mOutOfCore
| protected inherited

## ◆ mPageHandle

compression::PageHandle::Ptr mPageHandle
| inherited

## ◆ mUsePagedRead

uint8_t mUsePagedRead = 0
| protected inherited