extern "C" {
#[doc(hidden)] fn cv_new_VectorOfbool() -> *mut c_void;
#[doc(hidden)] fn cv_delete_VectorOfbool(ptr: *mut c_void);
#[doc(hidden)] fn cv_push_VectorOfbool(ptr: *mut c_void, ptr2: *const c_void);
#[doc(hidden)] fn cv_VectorOfbool_len(ptr: *mut c_void) -> i32;
#[doc(hidden)] fn cv_VectorOfbool_get(ptr: *mut c_void, index: i32) -> *mut c_void;
}
#[allow(dead_code)]
pub struct VectorOfbool {
pub(crate) ptr: *mut c_void
}
impl VectorOfbool {
pub fn new() -> Self {
unsafe { Self { ptr: cv_new_VectorOfbool() } }
}
pub fn len(&self) -> i32 {
unsafe { cv_VectorOfbool_len(self.ptr) }
}
#[doc(hidden)]
pub fn as_raw_VectorOfbool(&self) -> *mut c_void {
self.ptr
}
}
impl Drop for VectorOfbool {
fn drop(&mut self) {
unsafe { cv_delete_VectorOfbool(self.ptr) };
}
}
impl VectorOfbool {
pub fn push(&mut self, val: bool) {
unsafe { cv_push_VectorOfbool(self.ptr, &val as *const _ as _) }
}
pub fn get(&self, index: i32) -> &mut bool {
unsafe { (cv_VectorOfbool_get(self.ptr, index) as *mut bool).as_mut().unwrap() }
}
}