9 #ifndef __PDG_APPLICATION_SHIM_H__
10 #define __PDG_APPLICATION_SHIM_H__
54 virtual
int64 getMemoryUsage(
bool inclusive) const = 0;
82 virtual
bool hasCooked() const = 0;
89 virtual
bool pop(
int thread) = 0;
93 virtual
bool parmEval(const
PDG_Port* port,
101 virtual
bool parmEval(const
PDG_Port* port,
109 virtual
bool parmEval(const
PDG_Port* port,
137 virtual
bool tickCook(const PDGE_EvaluationOptions&) = 0;
140 virtual
void stopCook(
141 const PDGE_EvaluationOptions&,
145 virtual
bool defaultWorkItemLabel(
172 virtual void evaluate() = 0;
194 static bool canUseFarm();
198 static bool areDependenciesDirty(
fpreal t);
224 template <
typename Task,
typename... Args>
227 TaskPtr new_task = UTmakeShared<Task>(
228 std::forward<Args>(
args)...);
229 pushDeferredTask(new_task);
234 template <
typename Func>
237 bool did_unlock =
false;
239 did_unlock = theAppShim->unlockApp();
244 theAppShim->lockApp();
250 static bool tickMainThread();
253 static bool isExperimental();
258 static bool trySaveScene();
271 virtual bool canAppUseFarm()
const = 0;
272 virtual bool areAppDependenciesDirty(
fpreal t)
const = 0;
273 virtual void dirtyAppDependencies(
fpreal t,
275 virtual void addAppDependency(
int thread,
280 virtual bool getAppVariable(
const char*
name,
282 virtual void setAppVariable(
const char*
name,
287 virtual bool tickAppMainThread();
289 virtual bool unlockApp()
const = 0;
290 virtual bool lockApp()
const = 0;
292 virtual bool trySaveAppScene()
const = 0;
295 static void pushDeferredTask(TaskPtr&
ptr);
300 DeferredQueue myDeferredTasks;
301 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
int PDG_NodeID
Node ID type.
**If you just want to fire and args