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,
127 int thread) const = 0;
146 virtual
bool tickCook(const PDGE_EvaluationOptions&) = 0;
149 virtual
void stopCook(
150 const PDGE_EvaluationOptions&,
154 virtual
bool defaultWorkItemLabel(
181 virtual void evaluate() = 0;
203 static bool canUseFarm();
207 static bool areDependenciesDirty(
fpreal t);
233 template <
typename Task,
typename... Args>
236 TaskPtr new_task = UTmakeShared<Task>(
237 std::forward<Args>(
args)...);
238 pushDeferredTask(new_task);
243 template <
typename Func>
246 bool did_unlock =
false;
248 did_unlock = theAppShim->unlockApp();
253 theAppShim->lockApp();
259 static bool tickMainThread();
262 static bool isExperimental();
267 static bool trySaveScene();
280 virtual bool canAppUseFarm()
const = 0;
281 virtual bool areAppDependenciesDirty(
fpreal t)
const = 0;
282 virtual void dirtyAppDependencies(
fpreal t,
284 virtual void addAppDependency(
int thread,
289 virtual bool getAppVariable(
const char*
name,
291 virtual void setAppVariable(
const char*
name,
296 virtual bool tickAppMainThread();
298 virtual bool unlockApp()
const = 0;
299 virtual bool lockApp()
const = 0;
301 virtual bool trySaveAppScene()
const = 0;
304 static void pushDeferredTask(TaskPtr&
ptr);
309 DeferredQueue myDeferredTasks;
310 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 GLfloat * value
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