7 #ifndef PXR_EXEC_VDF_FIXED_SIZE_HOLDER_H
8 #define PXR_EXEC_VDF_FIXED_SIZE_HOLDER_H
13 #include "pxr/base/tf/mallocTag.h"
16 #include <type_traits>
28 TfAutoMallocTag tag(
"Vdf",
"Vdf_FixedSizeHolder::ctor",
30 _pointer.reset(
new T);
35 TfAutoMallocTag tag(
"Vdf",
"Vdf_FixedSizeHolder::ctor",
37 _pointer.reset(
new T(std::forward<U>(
value)));
42 TfAutoMallocTag tag(
"Vdf",
"Vdf_FixedSizeHolder::copy ctor",
44 _pointer.reset(
new T(other.
Get()));
49 TfAutoMallocTag tag(
"Vdf",
"Vdf_FixedSizeHolder::assignment",
51 _pointer.reset(
new T(other.
Get()));
61 inline T const &
Get()
const {
68 std::unique_ptr<T> _pointer;
81 : _value(std::forward<U>(
value))
83 inline T const &
Get()
const {
105 template <
class T,
size_t Size>
111 "Size too small to allow remote storage");
115 typedef typename std::conditional<
119 >::
type _StorageType;
136 : _storage(other._storage)
141 : _storage(std::move(other._storage))
146 _storage.~_StorageType();
150 _storage = other._storage;
155 _storage = std::move(other._storage);
159 inline T const &Get()
const {
160 return _storage.Get();
163 inline T &GetMutable() {
164 return _storage.GetMutable();
167 inline void Set(
T const &
value) {
168 _storage.GetMutable() =
value;
171 inline void Set(
T &&value) {
172 _storage.GetMutable() = std::move(value);
177 _StorageType _storage;
184 #endif // PXR_EXEC_VDF_FIXED_SIZE_HOLDER_H
Vdf_FixedSizeHolderLocalStorage()=default
Vdf_FixedSizeHolderLocalStorage(U &&value)
#define PXR_NAMESPACE_OPEN_SCOPE
GLsizei const GLfloat * value
Vdf_FixedSizeHolderRemoteStorage(U &&value)
Vdf_FixedSizeHolderRemoteStorage & operator=(Vdf_FixedSizeHolderRemoteStorage const &other)
GLint GLint GLsizei GLint GLenum GLenum type
#define __ARCH_PRETTY_FUNCTION__
LeafData & operator=(const LeafData &)=delete
#define PXR_NAMESPACE_CLOSE_SCOPE
Vdf_FixedSizeHolderRemoteStorage(Vdf_FixedSizeHolderRemoteStorage const &other)
Vdf_FixedSizeHolderRemoteStorage()