extern "C" {
#[doc(hidden)] fn cv_new_VectorOfPtrOfBackendWrapper() -> *mut c_void;
#[doc(hidden)] fn cv_delete_VectorOfPtrOfBackendWrapper(ptr: *mut c_void);
#[doc(hidden)] fn cv_push_VectorOfPtrOfBackendWrapper(ptr: *mut c_void, ptr2: *const c_void);
#[doc(hidden)] fn cv_VectorOfPtrOfBackendWrapper_len(ptr: *mut c_void) -> i32;
#[doc(hidden)] fn cv_VectorOfPtrOfBackendWrapper_get(ptr: *mut c_void, index: i32) -> *mut c_void;
}
#[allow(dead_code)]
pub struct VectorOfPtrOfBackendWrapper {
pub(crate) ptr: *mut c_void
}
impl VectorOfPtrOfBackendWrapper {
pub fn new() -> Self {
unsafe { Self { ptr: cv_new_VectorOfPtrOfBackendWrapper() } }
}
pub fn len(&self) -> i32 {
unsafe { cv_VectorOfPtrOfBackendWrapper_len(self.ptr) }
}
#[doc(hidden)]
pub fn as_raw_VectorOfPtrOfBackendWrapper(&self) -> *mut c_void {
self.ptr
}
}
impl Drop for VectorOfPtrOfBackendWrapper {
fn drop(&mut self) {
unsafe { cv_delete_VectorOfPtrOfBackendWrapper(self.ptr) };
}
}
impl VectorOfPtrOfBackendWrapper {
pub fn push(&mut self, val: types::PtrOfBackendWrapper) {
unsafe { cv_push_VectorOfPtrOfBackendWrapper(self.ptr, val.ptr) }
}
pub fn get(&self, index: i32) -> types::PtrOfBackendWrapper {
types::PtrOfBackendWrapper { ptr: unsafe { cv_VectorOfPtrOfBackendWrapper_get(self.ptr, index) } }
}
pub fn to_vec(&self) -> Vec<types::PtrOfBackendWrapper> {
(0..self.len()).map(|x| self.get(x)).collect()
}
}