Type Alias CapeArrayRealOut

Source
pub type CapeArrayRealOut<'a> = CapeArrayOut<'a, CapeReal, ICapeArrayReal>;
Expand description

CapeArrayRealOut wraps an ICapeArrayReal interface pointer.

Given an ICapeArrayReal interface pointer, this allows setting and getting the elements.

This interface is typically used as arguments to rust methods on traits that are generated from CAPE-OPEN interfaces that have ICapeArrayReal output arguments.

§Examples

use cobia::*;

fn set_content(a: &mut CapeArrayRealOut) {
    a.put_array(&[4.5,6.5]).unwrap();
}
 
let mut arr = cobia::CapeArrayRealVec::new();
set_content(&mut CapeArrayRealOutFromProvider::from(&mut arr).as_cape_array_real_out());
assert_eq!(arr.as_vec(), &vec![4.5,6.5]);

Aliased Type§

pub struct CapeArrayRealOut<'a> {
    pub(crate) interface: &'a mut *mut ICapeArrayReal,
    data: *mut f64,
    size: u32,
}

Fields§

§interface: &'a mut *mut ICapeArrayReal§data: *mut f64§size: u32

Implementations§

Source§

impl<'a> CapeArrayRealOut<'a>

Source

pub fn set<T: CapeArrayRealProviderIn>( &mut self, array: &T, ) -> Result<(), COBIAError>

Set the content of the real array from any object that implements CapeArrayRealProviderIn.

§Arguments
  • array - An object that implements CapeArrayRealProviderIn
§Examples
use cobia::*;
let mut arr = cobia::CapeArrayRealVec::new();
let mut arr1 = cobia::CapeArrayRealVec::from_slice(&vec![125.1,-19.4,3.14]);
CapeArrayRealOutFromProvider::from(&mut arr).as_cape_array_real_out().set(&arr1);
assert_eq!(arr.as_vec(), &[125.1,-19.4,3.14]);

Trait Implementations§