9 #ifndef __PDG_APPLICATION_SHIM_H__
10 #define __PDG_APPLICATION_SHIM_H__
53 virtual
int64 getMemoryUsage(
bool inclusive)
const = 0;
77 virtual
int nodeID() const = 0;
81 virtual
bool hasCooked() const = 0;
88 virtual
bool pop(
int thread) = 0;
92 virtual
bool parmEval(const
PDG_Port* port,
100 virtual
bool parmEval(const
PDG_Port* port,
108 virtual
bool parmEval(const
PDG_Port* port,
136 virtual
bool tickCook(const PDGE_EvaluationOptions&) = 0;
139 virtual
void stopCook(
140 const PDGE_EvaluationOptions&,
144 virtual
bool defaultWorkItemLabel(
171 virtual void evaluate() = 0;
193 static bool canUseFarm();
197 static bool areDependenciesDirty(
fpreal t);
223 template <
typename Task,
typename... Args>
226 TaskPtr new_task = UTmakeShared<Task>(
227 std::forward<Args>(
args)...);
228 pushDeferredTask(new_task);
233 template <
typename Func>
236 bool did_unlock =
false;
238 did_unlock = theAppShim->unlockApp();
243 theAppShim->lockApp();
249 static bool tickMainThread();
252 static bool isExperimental();
257 static bool trySaveScene();
270 virtual bool canAppUseFarm()
const = 0;
271 virtual bool areAppDependenciesDirty(
fpreal t)
const = 0;
272 virtual void dirtyAppDependencies(
fpreal t,
274 virtual void addAppDependency(
int thread,
279 virtual bool getAppVariable(
const char*
name,
281 virtual void setAppVariable(
const char*
name,
286 virtual bool tickAppMainThread();
288 virtual bool unlockApp()
const = 0;
289 virtual bool lockApp()
const = 0;
291 virtual bool trySaveAppScene()
const = 0;
294 static void pushDeferredTask(TaskPtr&
ptr);
299 DeferredQueue myDeferredTasks;
300 bool myIsExperimental;
*pool push(my_func, arg1,...)
GLuint GLsizei const GLchar * label
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
GLsizei const GLchar *const * path
State
Evaluation context state.
static TaskPtr pushDeferred(Args &&...args)
**But if you need a result
PDG_EvaluationContext::State myState
const PDG_WorkItem * myWorkItem
UT_ConcurrentQueue< TaskPtr > DeferredQueue
static void unlockedExecute(const Func &func)
Runs a functor with the application unlocked.
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
UT_SharedPtr< DeferredTask > TaskPtr
Managed pointer to a deferred task.
GLuint const GLchar * name
**Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
virtual ~PDG_ApplicationShim()
PDG_GraphContext * myContext
**If you just want to fire and args