omni::core::Generated< omni::experimental::job::IAffinityMask_abi >

Defined in omni/experimental/job/IJob.gen.h

template<>
class Generated<omni::experimental::job::IAffinityMask_abi> : public omni::experimental::job::IAffinityMask_abi

Interface for providing a CPU affinity mask to the plugin.

Instances of this interface can be thought of as an array of MaskType values, which allows for setting affinities on machines with more than 64 processors. Each affinity mask this object contains is a bitmask that represents the associated CPUs.

On Linux, this object is treated as one large bitset analogous to cpu_set_t. So get_affinity_mask(0) represents CPUs 0-63, get_affinity_mask(1) represents CPUs 64-127, etc.

On Windows, each affinity mask in this object applies to its own Processor Group, so get_affinity_mask(0) is for Processor Group 0, get_affinity_mask(1) for Processor Group 1, etc.

Public Functions

inline omni::experimental::job::MaskType get_affinity_mask(size_t index) noexcept

Gets the affinity mask at index.

Note

index must be less than get_mask_count_abi()

Parameters

index – Index to get affinity mask for.

Returns

The affinity mask at the provided index.

inline void set_affinity_mask(size_t index, omni::experimental::job::MaskType mask) noexcept

Gets the affinity mask at index.

Note

index must be less than get_mask_count_abi()

Parameters
  • index – Index to set affinity mask for.

  • mask – Mask to set.

inline size_t get_mask_count() noexcept

Gets the current number of affinity masks stored by this object.

Returns

The current number of affinity masks stored by this object.

inline size_t get_default_mask_count() noexcept

Gets the default number of affinity masks stored by this object.

Returns

The default number of affinity masks stored by this object.

inline void set_mask_count(size_t count) noexcept

Sets the number of affinity masks stored by this object to count.

If count is greater than the current size, the appended affinity masks will bet set to 0. If count is less than the current size, then this object will only contain the first count elements after this call.

Parameters

count – Number of affinity masks to set the size to.

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 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 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 MaskType get_affinity_mask_abi(size_t index) noexcept = 0

Gets the affinity mask at index.

Note

index must be less than get_mask_count_abi()

Parameters

index – Index to get affinity mask for.

Returns

The affinity mask at the provided index.

virtual void set_affinity_mask_abi(size_t index, MaskType mask) noexcept = 0

Gets the affinity mask at index.

Note

index must be less than get_mask_count_abi()

Parameters
  • index – Index to set affinity mask for.

  • mask – Mask to set.

virtual size_t get_mask_count_abi() noexcept = 0

Gets the current number of affinity masks stored by this object.

Returns

The current number of affinity masks stored by this object.

virtual size_t get_default_mask_count_abi() noexcept = 0

Gets the default number of affinity masks stored by this object.

Returns

The default number of affinity masks stored by this object.

virtual void set_mask_count_abi(size_t count) noexcept = 0

Sets the number of affinity masks stored by this object to count.

If count is greater than the current size, the appended affinity masks will bet set to 0. If count is less than the current size, then this object will only contain the first count elements after this call.

Parameters

count – Number of affinity masks to set the size to.

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 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.

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.