9 #ifndef __PDGE_EVALUATOR_H__
10 #define __PDGE_EVALUATOR_H__
82 int64 getMemoryUsage(
bool inclusive) const override;
87 inline
State evaluationState()
const
106 void cancelEvaluator();
110 void resetEvaluator();
115 void invalidateEvaluator();
124 {
return myRootDependency.hasDependency(root); }
161 template <
typename WrappedFunction,
typename... Args>
164 if (myOptions.mySerial)
166 WrappedFunction functor(
167 std::forward<Args>(
args)...);
172 ScopedFunctor<WrappedFunction> functor(
174 std::forward<Args>(
args)...);
175 functor.setTaskScope(myTaskScope);
176 myTaskGroup->run(std::move(functor));
209 template <
typename WrappedFunctor>
210 class ScopedFunctor :
public WrappedFunctor
213 template <
typename... Args>
214 ScopedFunctor(
bool blocking, Args&&...
args)
215 : WrappedFunctor(std::forward<Args>(
args)...)
222 template <
typename... Args>
223 inline void operator()(Args&&...
args)
226 return WrappedFunctor::operator()(
227 std::forward<Args>(
args)...);
230 template <
typename... Args>
231 inline void operator()(Args&&...
args)
const
234 return WrappedFunctor::operator()(
235 std::forward<Args>(
args)...);
238 inline void setTaskScope(
const UT_TaskScope* parent_scope)
239 { myScope = parent_scope; }
258 template <
typename WrappedFunctor>
259 class ScopedReduce :
public ScopedFunctor<WrappedFunctor>
262 using Base = ScopedFunctor<WrappedFunctor>;
265 ScopedReduce(
const ScopedReduce<WrappedFunctor>& other,
UT_Split split)
266 : Base(false, other, split)
268 Base::setTaskScope(other.myScope);
273 using ResolveQueue = UT_ConcurrentQueue<PDGE_Resolutions>;
279 ResolveQueue myResolveQueue;
281 TaskGroupPtr myTaskGroup;
State
The state of the evaluator object.
static const UT_TaskScope * getCurrent()
void runFunctor(Args &&...args)
virtual bool preEvaluation()
The evaluator is evaluating.
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
bool hasRootDependency(PDGE_Dependency *root) const
Returns true if this evaluator depends on the specified dependency.
The evaluator is uninitialize and evaluation has not yet begun.
This object is invalid because it was cleaned up during shutdown.
virtual UT_StringHolder debugName() const =0
virtual void postEvaluation(State state, bool canceled)
virtual bool tickEvaluation()
const PDGE_EvaluationOptions & evaluationOptions() const
Returns the evaluation options used for the current cook.
The evaluator is canceling the current evaluation.
virtual PDGE_Dependency::State evalResolve(PDGE_Resolutions &, const PDGE_Evaluator &, PDGE_Dependency *)
Called when a dependency owned by this object is resolved.
**If you just want to fire and args
void OIIO_UTIL_API split(string_view str, std::vector< string_view > &result, string_view sep=string_view(), int maxsplit=-1)