PrSDKOpaqueEffectDataSuite

Struct PrSDKOpaqueEffectDataSuite 

Source
#[repr(C)]
pub struct PrSDKOpaqueEffectDataSuite { pub AcquireOpaqueEffectData: Option<unsafe extern "C" fn(instanceID: csSDK_int32, outOpaqueEffectDataPP: *mut *mut OpaqueEffectDataType) -> PF_Err>, pub RegisterOpaqueEffectData: Option<unsafe extern "C" fn(instanceID: csSDK_int32, ioOpaqueEffectDataPP: *mut *mut OpaqueEffectDataType) -> PF_Err>, pub ReleaseOpaqueEffectData: Option<unsafe extern "C" fn(instanceID: csSDK_int32, outDisposeOpaqueEffectDataPP: *mut *mut OpaqueEffectDataType) -> PF_Err>, }
Expand description

This suite provides effects a means to share unflattened sequence data between its instances. The data is opaque to the host and effects are responsible for maintaining thread safety of the shared data. The host provides ref counting that the effect can use to manage the lifetime of the shared data.

Fields§

§AcquireOpaqueEffectData: Option<unsafe extern "C" fn(instanceID: csSDK_int32, outOpaqueEffectDataPP: *mut *mut OpaqueEffectDataType) -> PF_Err>

Acquire pointer to opaque effect data. This is reference counted meaning that AcquireOpaqueEffectData and ReleaseOpaqueEffectData should always be called in pairs. If no opaque effect was registered for the given effect_ref AcquireOpaqueEffectData will return 0 and the reference count remains 0.

§RegisterOpaqueEffectData: Option<unsafe extern "C" fn(instanceID: csSDK_int32, ioOpaqueEffectDataPP: *mut *mut OpaqueEffectDataType) -> PF_Err>

Register opaque effect data. If multiple threads invoke RegisterOpaqueEffectData only one will be successful. The ioOpaqueEffectDataPP of the successful thread will be returned to all callers. Calling threads are always responsible for managing the data they register. This is the case whether or not threads are successful registering their data. Similarly, RegisterOpaqueEffectData always increments the internal reference count.

// // Sample code showing how to use RegisterOpaqueEffectData. // Note: code is simplified (not exception-safe, etc.) //

// // Try to acquire first, in case another thread registered the opaque effect data earlier // OpaqueEffectDataType * pData = 0; PF_Err err = opaqueEffectDataSuite->AcquireOpaqueEffectData(instanceID, &pData); assert(err == PF_Err_NONE);

// // If acquire did not return a valid pointer, create a new object and register it // otherwise we are done // if (pData == 0) { OpaqueEffectDataType * pNewData(new OpaqueEffectDataType()); pData = pNewData; err = opaqueEffectDataSuite->RegisterOpaqueEffectData(instanceID, &pData); assert(err == PF_Err_NONE);

// now we check if this thread actually succeeded registering // if the returned pData is unchanged it means that it was successful if (pData != pNewData) { delete pNewData; } }

// pData now points to the right OpaqueEffectDataType object and we can start using it …

§ReleaseOpaqueEffectData: Option<unsafe extern "C" fn(instanceID: csSDK_int32, outDisposeOpaqueEffectDataPP: *mut *mut OpaqueEffectDataType) -> PF_Err>

Release opaque effect data. This decrements the internal reference count. If the internal reference count goes to 0 outDisposeOpaqueEffectDataPP is set to the managed data that should be deleted, otherwise it is set to NULL. If the internal reference count goes to 0 any calls made to AcquireOpaqueEffectData will return 0 until new opaque effect data is registered via RegisterOpaqueEffectData.

Trait Implementations§

Source§

impl Clone for PrSDKOpaqueEffectDataSuite

Source§

fn clone(&self) -> PrSDKOpaqueEffectDataSuite

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PrSDKOpaqueEffectDataSuite

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for PrSDKOpaqueEffectDataSuite

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.