7#ifndef PXR_EXEC_VDF_VECTOR_DATA_H
8#define PXR_EXEC_VDF_VECTOR_DATA_H
12#include "pxr/exec/vdf/api.h"
13#include "pxr/exec/vdf/fixedSizePolymorphicHolder.h"
19PXR_NAMESPACE_OPEN_SCOPE
22class Vt_ArrayForeignDataSource;
36 static const size_t _SmallBufferSize =
sizeof(size_t)*3 +
sizeof(
void *);
39 static const size_t _DataHolderSize = _SmallBufferSize +
sizeof(
void*);
42 static constexpr size_t _VectorSharingSize = 5000;
62 virtual const std::type_info &GetTypeInfo()
const = 0;
69 virtual void NewEmpty(
size_t size,
DataHolder *destData)
const = 0;
76 virtual void NewSingle(
DataHolder *destData)
const = 0;
83 virtual void NewSparse(
size_t size,
size_t first,
size_t last,
91 virtual void NewDense(
size_t size,
DataHolder *destData)
const = 0;
98 virtual void MoveInto(
DataHolder *destData) = 0;
104 virtual void Clone(
DataHolder *destData)
const = 0;
111 virtual void CloneSubset(
const VdfMask &mask,
137 virtual void Expand(
size_t first,
size_t last);
142 virtual size_t GetSize()
const = 0;
146 virtual size_t GetNumStoredElements()
const = 0;
153 virtual Vt_ArrayForeignDataSource* GetSharedSource()
const;
158 virtual bool IsSharable()
const;
164 enum class Layout : uint8_t {
169 enum class Ownership : uint8_t {
181 Layout layout_ = Info::Layout::Unboxed,
182 Ownership ownership_ = Info::Ownership::Exclusive) :
187 compressedIndexMapping(compressedIndexMapping_),
189 ownership(ownership_)
216 virtual Info GetInfo() = 0;
221 virtual size_t EstimateElementMemory()
const = 0;
232 static bool ShouldStoreCompressed(
241 void DebugPrint(
const VdfMask &mask, std::ostream *o)
const;
244PXR_NAMESPACE_CLOSE_SCOPE
Fast, compressed bit array which is capable of performing logical operations without first decompress...
This collection of IndexBlockMappings is all the info required to take a logical index into a compres...
Used to implement small object optimizations for the type-erasure (Any) pattern.
Abstract base class for storing data in a VdfVector.
A VdfMask is placed on connections to specify the data flowing through them.