MCPcopy Create free account
hub / github.com/DiligentGraphics/DiligentFX / GetTaskContextData

Method GetTaskContextData

Hydrogent/interface/Tasks/HnTask.hpp:61–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59
60 template <typename ParamType>
61 bool GetTaskContextData(pxr::HdTaskContext* TaskCtx, const pxr::TfToken& Name, ParamType& Param, bool Required = true) const
62 {
63 if (TaskCtx == nullptr)
64 {
65 UNEXPECTED("Task context is null");
66 return false;
67 }
68
69 auto param_it = TaskCtx->find(Name);
70 if (param_it == TaskCtx->end())
71 {
72 if (Required)
73 {
74 UNEXPECTED("Parameter '", Name, "' is not set in the task context");
75 }
76 return false;
77 }
78
79 if (!param_it->second.IsHolding<ParamType>())
80 {
81 UNEXPECTED("Type ", param_it->second.GetTypeName(), " is not expected for parameter ", Name);
82 return false;
83 }
84
85 Param = param_it->second.UncheckedGet<ParamType>();
86 return true;
87 }
88
89 template <typename ParamType>
90 bool GetTaskParameter(pxr::HdSceneDelegate* Delegate, const pxr::TfToken& Name, ParamType& Param) const

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected