24 #ifndef PXR_IMAGING_HD_BUFFER_SOURCE_H
25 #define PXR_IMAGING_HD_BUFFER_SOURCE_H
87 virtual void const*
GetData()
const = 0;
98 return _state >= RESOLVED;
103 return _state == RESOLVE_ERROR;
150 TF_VERIFY(_state == BEING_RESOLVED);
164 TF_VERIFY(_state == BEING_RESOLVED);
165 _state = RESOLVE_ERROR;
174 State oldState = UNRESOLVED;
175 return _state.compare_exchange_strong(oldState, BEING_RESOLVED);
201 enum State { UNRESOLVED=0, BEING_RESOLVED, RESOLVED, RESOLVE_ERROR};
202 std::atomic<State> _state;
220 virtual void const*
GetData()
const override;
243 virtual void const*
GetData()
const override;
257 #endif //PXR_IMAGING_HD_BUFFER_SOURCE_H
virtual HD_API bool HasChainedBuffer() const
Returns true if this buffer has any chained buffer(s)
virtual void const * GetData() const =0
Following interfaces will be called after Resolve.
virtual HD_API void const * GetData() const override
Following interfaces will be called after Resolve.
virtual HD_API size_t ComputeHash() const override
Computes and returns a hash value for the underlying data.
virtual HD_API TfToken const & GetName() const override
Return the name of this buffer source.
virtual TfToken const & GetName() const =0
Return the name of this buffer source.
std::vector< HdBufferSourceSharedPtr > HdBufferSourceSharedPtrVector
virtual HD_API void GetBufferSpecs(HdBufferSpecVector *specs) const override
**But if you need a result
virtual HD_API bool HasPreChainedBuffer() const
Returns true if this buffer has a pre-chained buffer.
virtual HD_API size_t GetNumElements() const override
bool HasResolveError() const
Returns true if an error occurred during resolve.
virtual size_t GetNumElements() const =0
std::vector< struct HdBufferSpec > HdBufferSpecVector
virtual bool _CheckValid() const =0
virtual void GetBufferSpecs(HdBufferSpecVector *specs) const =0
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
virtual HD_API size_t ComputeHash() const override
Computes and returns a hash value for the underlying data.
virtual HD_API size_t ComputeHash() const
Computes and returns a hash value for the underlying data.
virtual HD_API size_t GetNumElements() const override
void _SetResult(HdBufferSourceSharedPtr const &result)
virtual HdTupleType GetTupleType() const =0
Returns the data type and count (array size) for this buffer source.
#define PXR_NAMESPACE_CLOSE_SCOPE
virtual HD_API HdTupleType GetTupleType() const override
Returns the data type and count (array size) for this buffer source.
virtual HD_API TfToken const & GetName() const override
Return the name of this buffer source.
virtual HD_API void const * GetData() const override
Following interfaces will be called after Resolve.
virtual HD_API HdTupleType GetTupleType() const override
Returns the data type and count (array size) for this buffer source.
std::shared_ptr< HdBufferSource const > HdBufferSourceConstSharedPtr
virtual HD_API HdBufferSourceSharedPtr GetPreChainedBuffer() const
Returns the pre-chained buffer.
std::shared_ptr< class HdBufferSource > HdBufferSourceSharedPtr
virtual HD_API ~HdBufferSource()
bool IsResolved() const
Returns true it this computation has already been resolved.
HD_API bool IsValid() const
std::weak_ptr< HdBufferSource > HdBufferSourceWeakPtr
virtual HD_API HdBufferSourceSharedPtrVector GetChainedBuffers() const
Returns the vector of chained buffers.