Loading...
Searching...
No Matches
extComputationContextInternal.h
1//
2// Copyright 2017 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_IMAGING_HD_EXT_COMPUTATION_CONTEXT_INTERNAL_H
8#define PXR_IMAGING_HD_EXT_COMPUTATION_CONTEXT_INTERNAL_H
9
10#include "pxr/pxr.h"
11
12#include "pxr/imaging/hd/api.h"
13#include "pxr/imaging/hd/extComputationContext.h"
14
15#include <map>
16
17PXR_NAMESPACE_OPEN_SCOPE
18
24public:
25 HD_API
27
28 HD_API
30
37 HD_API
38 virtual const VtValue &GetInputValue(const TfToken &name) const override;
39
45 HD_API
47 const TfToken &name) const override;
51 HD_API
52 virtual void SetOutputValue(const TfToken &name,
53 const VtValue &output) override;
54
55
58 HD_API
59 void SetInputValue(const TfToken &name, const VtValue &input);
60
63 HD_API
64 bool GetOutputValue(const TfToken &name, VtValue *output) const;
65
68 HD_API
70
75 HD_API
76 virtual void RaiseComputationError() override;
77
78private:
79 typedef std::map<TfToken, VtValue> ValueMap;
80
81 ValueMap m_inputs;
82 ValueMap m_outputs;
83 bool m_compuationError;
84
85
87 = delete;
89 const HdExtComputationContextInternal &) = delete;
90
91};
92
93PXR_NAMESPACE_CLOSE_SCOPE
94
95#endif // PXR_IMAGING_HD_EXT_COMPUTATION_CONTEXT_INTERNAL_H
Interface class that defines the execution environment for the client to run a computation.
Hydra implementation of the HdExtComputationContext public interface.
virtual HD_API void SetOutputValue(const TfToken &name, const VtValue &output) override
Sets the value of the specified output.
virtual HD_API const VtValue * GetOptionalInputValuePtr(const TfToken &name) const override
Obtains the value of an named input to the computation.
virtual HD_API void RaiseComputationError() override
Called to indicate an error occurred while executing a computation so that it's output are invalid.
HD_API void SetInputValue(const TfToken &name, const VtValue &input)
Adds the named input to the execution environment.
HD_API bool GetOutputValue(const TfToken &name, VtValue *output) const
Fetches the named output from the execution environment.
HD_API bool HasComputationError()
returns true is an error occur in processing, such that the outputs are invalid.
virtual HD_API const VtValue & GetInputValue(const TfToken &name) const override
Obtains the value of an named input to the computation.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:152