Type Alias CapeArrayBooleanSlice

Source
pub type CapeArrayBooleanSlice<'a> = CapeArraySlice<'a, CapeBoolean>;
Expand description

Slice based CapeArrayBooleanIn implementation

ICapeArrayBoolean is passed as data container between CAPE-OPEN functions. It is up to the caller to provide the interface, and its implementation. This class provides a default impementation using a &[CapeBoolean].

§Examples

use cobia::*;

fn test_content(a: &CapeArrayBooleanIn) {
	assert_eq!(a.as_bool_vec(), vec![true,false]);
}
 
let arr = cobia::CapeArrayBooleanSlice::new(&[1,0]);
test_content(&CapeArrayBooleanInFromProvider::from(&arr).as_cape_array_boolean_in());

Aliased Type§

pub struct CapeArrayBooleanSlice<'a> {
    slice: &'a [u32],
}

Fields§

§slice: &'a [u32]

Implementations§

Source§

impl<'a> CapeArrayBooleanSlice<'a>

Source

const VTABLE: ICapeArrayBoolean_VTable

Interface v-table

Source

extern "C" fn get( me: *mut c_void, data: *mut *mut CapeBoolean, size: *mut CapeSize, )

Interface member function

Source

extern "C" fn setsize( _: *mut c_void, _: CapeSize, _: *mut *mut CapeBoolean, ) -> CapeResult

Interface member function

Trait Implementations§

Source§

impl<'a> CapeArrayBooleanProviderIn for CapeArrayBooleanSlice<'a>

Source§

fn as_cape_array_boolean_in(&self) -> ICapeArrayBoolean

Convert to ICapeArrayBoolean

Returns a reference to the ICapeArrayBoolean interface.

§Examples
use cobia::*;
use cobia::prelude::*;
let arr = cobia::CapeArrayBooleanSlice::new(&[0,1,0]);
let i_cape_array_boolean=arr.as_cape_array_boolean_in();
let mut i_cape_array_boolean_ptr=(&i_cape_array_boolean as *const C::ICapeArrayBoolean).cast_mut(); //normally a pointer to the interface is received
let a = cobia::CapeArrayBooleanIn::new(&mut i_cape_array_boolean_ptr); //CapeArrayBooleanIn from *mut C::ICapeArrayBoolean
assert_eq!(a.as_bool_vec(), vec![false,true,false]);