omni::graph::exec::unstable::IExecutionStateInfo
Defined in omni/graph/exec/unstable/IExecutionStateInfo.h
-
class IExecutionStateInfo : public omni::core::Generated<omni::graph::exec::unstable::IExecutionStateInfo_abi>
State associated with a given execution task.
Execution state is separated from the execution graph to allow concurrent and/or nested execution. See omni::graph::exec::unstable::IExecutionContext for details.
- Thread Safety
Since multiple threads can concurrently traverse a graph, implementors of methods within this class should expect that multiple threads will be accessing this object in parallel.
Public Functions
-
template<typename T>
inline omni::expected<Span<T>, omni::core::Result> getNodeDataAs(omni::core::TypeId desiredType, NodeDataKey key) noexcept Returns a pointer to a value stored in the key/value datastore.
The type
T
must match the type specified indesiredType
. Prefer using OMNI_GRAPH_EXEC_GET_NODE_DATA_AS() instead of this method, which will ensuredesiredType
andT
match.If
desiredType
does not match the type of the stored data, omni::core::kResultInvalidDataType is returned.If no data exists at the given
key
(i.e omni::graph::exec::unstable::IExecutionStateInfo::setNodeData() has not previously been called at the givenkey
), omni::core::kResultNotFound is returned.The returned span may point to
nullptr
if omni::graph::exec::unstable::IExecutionStateInfo::setNodeData() was previously called with anullptr
data pointer.- Thread Safety
See thread safety information in interface description.
-
template<typename SpecifiedT, typename DataT>
inline DataT *setNodeData(omni::core::TypeId itemType, NodeDataKey key, std::unique_ptr<DataT> data) noexcept Stores a value in the key/value datastore.
If a value is already stored at the given
key
it will be replaced.SpecifiedT
,itemType
, andDataT
describe the type of the supplied data and must all be the same type. Prefer using OMNI_GRAPH_EXEC_SET_NODE_DATA() instead of this method, which will populate theitemType
for you.data
may benullptr
.Returns a pointer to
data
.- Thread Safety
See thread safety information in interface description.
-
inline bool needsCompute(const omni::graph::exec::unstable::Stamp &execVersion) noexcept
Query used by some executors to determine if computation of a node is necessary.
-
inline void requestCompute() noexcept
Set to request computation.
-
inline void setComputed() noexcept
Reset request to compute after computation was performed.
-
inline omni::graph::exec::unstable::SyncStamp getExecutionStamp() noexcept
Get current/last exec version set for this node during execution.
-
inline bool setExecutionStamp(const omni::graph::exec::unstable::Stamp &execVersion) noexcept
Set current exec version for this node. Returns true if version wasn’t in sync.
-
inline omni::core::Result getNodeData(omni::graph::exec::unstable::NodeDataKey key, omni::core::TypeId *outTypeId, void **outPtr, uint64_t *outItemSize, uint64_t *outItemCount) noexcept
Returns a value from the key/value datastore.
The
key
is used as a look-up in the node’s key/value datastore.outPtr
will be updated with a pointer to the actual data.outPtr
must not benullptr
.outItemSize
store the size of each item in the returned array.outItemSize
must not benullptr
outItemCount
contains the number of items returned (i.e. the number of itemsoutPtr
points to). For an array, this will be greater than 1.outItemCount
must not benullptr
.If the key is not found, omni::core::kResultNotFound is returned.
The returned
data
may point tonullptr
is omni::graph::exec::unstable::IExecutionContext::setNodeData() was previously called with anullptr
data pointer.See Error Handling to understand the error handling/reporting responsibilities of implementors of this method.
- Thread Safety
Accessing the key/value datastore is not thread safe.
-
inline void setNodeData(omni::graph::exec::unstable::NodeDataKey key, omni::core::TypeId typeId, void *data, uint64_t itemSize, uint64_t itemCount, omni::graph::exec::unstable::NodeDataDeleterFn *deleter) noexcept
Sets a value in the key/value datastore.
The
key
is used as a look-up in the node’s key/value datastore.The type of each data item is set with
typeId
.The type of each data item is set with
typeId
.If data already exists at the given key, it will be replaced.
data
points to an array of data items.data
may benullptr
.itemSize
is the size of each item in the given array.itemCount
contains the number of items pointed to bydata
. For an array, this will be greater than 1.deleter
is a function used to deletedata
when either a new value is set at the key or the context is invalidated. Ifdeleter
isnullptr
, it is up to the calling code to manage the lifetime of thedata
.- Thread Safety
Accessing the key/value datastore is not thread safe.
-
inline void *castWithoutAcquire(omni::core::TypeId id) noexcept
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.
-
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
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 toomni::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 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.
Protected Functions
-
virtual bool needsCompute_abi(Stamp execVersion) noexcept = 0
Query used by some executors to determine if computation of a node is necessary.
-
virtual void requestCompute_abi() noexcept = 0
Set to request computation.
-
virtual void setComputed_abi() noexcept = 0
Reset request to compute after computation was performed.
-
virtual SyncStamp getExecutionStamp_abi() noexcept = 0
Get current/last exec version set for this node during execution.
-
virtual bool setExecutionStamp_abi(Stamp execVersion) noexcept = 0
Set current exec version for this node. Returns true if version wasn’t in sync.
-
virtual omni::core::Result getNodeData_abi(NodeDataKey key, omni::core::TypeId *outTypeId, void **outPtr, uint64_t *outItemSize, uint64_t *outItemCount) noexcept = 0
Returns a value from the key/value datastore.
The
key
is used as a look-up in the node’s key/value datastore.outPtr
will be updated with a pointer to the actual data.outPtr
must not benullptr
.outItemSize
store the size of each item in the returned array.outItemSize
must not benullptr
outItemCount
contains the number of items returned (i.e. the number of itemsoutPtr
points to). For an array, this will be greater than 1.outItemCount
must not benullptr
.If the key is not found, omni::core::kResultNotFound is returned.
The returned
data
may point tonullptr
is omni::graph::exec::unstable::IExecutionContext::setNodeData() was previously called with anullptr
data pointer.See Error Handling to understand the error handling/reporting responsibilities of implementors of this method.
- Thread Safety
Accessing the key/value datastore is not thread safe.
-
virtual void setNodeData_abi(NodeDataKey key, omni::core::TypeId typeId, void *data, uint64_t itemSize, uint64_t itemCount, NodeDataDeleterFn *deleter) noexcept = 0
Sets a value in the key/value datastore.
The
key
is used as a look-up in the node’s key/value datastore.The type of each data item is set with
typeId
.The type of each data item is set with
typeId
.If data already exists at the given key, it will be replaced.
data
points to an array of data items.data
may benullptr
.itemSize
is the size of each item in the given array.itemCount
contains the number of items pointed to bydata
. For an array, this will be greater than 1.deleter
is a function used to deletedata
when either a new value is set at the key or the context is invalidated. Ifdeleter
isnullptr
, it is up to the calling code to manage the lifetime of thedata
.- Thread Safety
Accessing the key/value datastore is not thread safe.
-
virtual void *castWithoutAcquire_abi(omni::core::TypeId id) noexcept = 0
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.
-
virtual uint32_t getUseCount_abi() noexcept = 0
Returns the number of different instances (this included) referencing the current object.
- Thread Safety
This method is thread safe.
-
virtual void *cast_abi(TypeId id) noexcept = 0
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 toomni::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.
-
virtual void acquire_abi() noexcept = 0
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.
-
virtual void release_abi() noexcept = 0
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.