omni::graph::exec::unstable::detail::ExecutorSingleNode

Defined in omni/graph/exec/unstable/ExecutionContext.h

class ExecutorSingleNode : public omni::graph::exec::unstable::Executor<INode, ExecutionVisit, ExecutionNodeData, SerialScheduler, DefaultSchedulingStrategy>

Executor implementation that’s used to evaluate the associated definitions of single nodes via calls to omni::graph::exec::unstable::ExecutionContext::executeNode_abi. Prevents the executor from attempting to unnecessarily continue graph traversal and task scheduling downstream of the initially-computed node once said node’s evaluation has completed.

Public Functions

inline SchedulingInfo getSchedulingInfo(const ExecutionTask &task) const

Scheduling constraint to use when dispatching given task.

inline NodeData &getNodeData(INode *node)

Access custom data associated with each node.

inline const ExecutionPath &getPath() const

Execution path to node instantiating graph def associated with this executor.

inline IExecutionContext *getContext() const

Execution context.

inline void acquire() noexcept

Increments the object’s reference count.

Objects may have multiple reference counts (e.g. one per interface implemented). As such, it is important that you call omni::core::IObject::release() on the same pointer from which you called omni::core::IObject::acquire().

Do not directly use this method, rather use omni::core::ObjectPtr, which will manage calling omni::core::IObject::acquire() and omni::core::IObject::release() for you.

Thread Safety

This method is thread safe.

inline void release() noexcept

Decrements the objects reference count.

Most implementations will destroy the object if the reference count reaches 0 (though this is not a requirement).

Objects may have multiple reference counts (e.g. one per interface implemented). As such, it is important that you call omni::core::IObject::release() on the same pointer from which you called omni::core::IObject::acquire().

Do not directly use this method, rather use omni::core::ObjectPtr, which will manage calling omni::core::IObject::acquire() and omni::core::IObject::release() for you.

Thread Safety

This method is thread safe.

inline uint32_t getUseCount() noexcept

Returns the number of different instances (this included) referencing the current object.

Thread Safety

This method is thread safe.

inline void *cast(omni::core::TypeId id) noexcept

See omni::core::IObject::cast.

inline void *castWithoutAcquire(omni::core::TypeId id) noexcept

See omni::graph::exec::unstable::IBase_abi::castWithoutAcquire_abi.

Public Static Functions

static inline omni::core::ObjectPtr<ExecutorSingleNode> create(omni::core::ObjectParam<ITopology> toExecute, const ExecutionTask &thisTask)

Protected Functions

inline Status execute_abi() noexcept override

Main execution method. Called once by each node instantiating same graph definition.

inline Status schedule_abi(IScheduleFunction *fn, SchedulingInfo schedInfo) noexcept override

Implementation of base class schedule method available for work generation outside of traversal loop.

template<typename S = Scheduler>
inline Status scheduleInternal(ExecutionTask &&newTask, typename std::enable_if_t<!is_deferred<S>::value>* = nullptr)

Scheduling spawner of a task generated by traversal implementation.

template<typename S = Scheduler>
inline Status scheduleInternal(ExecutionTask &&newTask, typename std::enable_if_t<is_deferred<S>::value>* = nullptr)

Deferred scheduling spawner of a task generated by traversal implementation.

template<typename S = Scheduler>
inline Status scheduleExternal(IScheduleFunction *fn, SchedulingInfo schedInfo, typename std::enable_if_t<!is_deferred<S>::value>* = nullptr)

Scheduling spawner of a task generated by currently running task.

template<typename S = Scheduler>
inline Status scheduleExternal(IScheduleFunction *fn, SchedulingInfo schedInfo, typename std::enable_if_t<is_deferred<S>::value>* = nullptr)

Deferred scheduling spawner of a task generated by currently running task.

inline void acquire_abi() noexcept override

Increments the object’s reference count.

Objects may have multiple reference counts (e.g. one per interface implemented). As such, it is important that you call omni::core::IObject::release() on the same pointer from which you called omni::core::IObject::acquire().

Do not directly use this method, rather use omni::core::ObjectPtr, which will manage calling omni::core::IObject::acquire() and omni::core::IObject::release() for you.

Thread Safety

This method is thread safe.

inline void release_abi() noexcept override

Decrements the objects reference count.

Most implementations will destroy the object if the reference count reaches 0 (though this is not a requirement).

Objects may have multiple reference counts (e.g. one per interface implemented). As such, it is important that you call omni::core::IObject::release() on the same pointer from which you called omni::core::IObject::acquire().

Do not directly use this method, rather use omni::core::ObjectPtr, which will manage calling omni::core::IObject::acquire() and omni::core::IObject::release() for you.

Thread Safety

This method is thread safe.

inline uint32_t getUseCount_abi() noexcept override

Returns the number of different instances (this included) referencing the current object.

inline void *cast_abi(omni::core::TypeId id) noexcept override

Returns a pointer to the interface defined by the given type id if this object implements the type id’s interface.

Objects can support multiple interfaces, even interfaces that are in different inheritance chains.

The returned object will have omni::core::IObject::acquire() called on it before it is returned, meaning it is up to the caller to call omni::core::IObject::release() on the returned pointer.

The returned pointer can be safely reinterpret_cast<> to the type id’s C++ class. For example, “omni.windowing.IWindow” can be cast to omni::windowing::IWindow.

Do not directly use this method, rather use a wrapper function like omni::core::cast() or omni::core::ObjectPtr::as().

Thread Safety

This method is thread safe.

inline void *castWithoutAcquire_abi(omni::core::TypeId id) noexcept override

Casts this object to the type described the the given id.

Returns nullptr if the cast was not successful.

Unlike omni::core::IObject::cast(), this casting method does not call omni::core::IObject::acquire().

Thread Safety

This method is thread safe.

Protected Attributes

ExecutionPath m_path

Execution path helping discover state associated with current instance of the graph.

ExecutionTask m_task

Task starting the execution.

NodeDataArray m_nodeData

Storage for per node custom data.

Scheduler m_scheduler

An interface for spawning tasks for dispatch by scheduler and waiting for completion.

Status m_schedulerBypass = {Status::eUnknown}

Execution status for tasks bypassing scheduler.

std::atomic<uint32_t> m_refCount = {1}

Reference count.