wxrust_base/generated/
methods_r.rs

1use super::*;
2
3// wxRefCounter
4/// This trait represents [C++ `wxRefCounter` class](https://docs.wxwidgets.org/3.2/classwx_ref_counter.html)'s methods and inheritance.
5///
6/// See [`RefCounterIsOwned`] documentation for the class usage.
7pub trait RefCounterMethods: WxRustMethods {
8    /// Decrements the reference count associated with this shared data and, if it reaches zero, destroys this instance of wxRefCounter releasing its memory.
9    ///
10    /// See [C++ `wxRefCounter::DecRef()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_ref_counter.html#a803eb5be907b1a342082ceb59c01d8c5).
11    fn dec_ref(&self) {
12        unsafe { ffi::wxRefCounter_DecRef(self.as_ptr()) }
13    }
14    /// Returns the reference count associated with this shared data.
15    ///
16    /// See [C++ `wxRefCounter::GetRefCount()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_ref_counter.html#a98ca5fc3fa6219d993dd3654925c46aa).
17    fn get_ref_count(&self) -> c_int {
18        unsafe { ffi::wxRefCounter_GetRefCount(self.as_ptr()) }
19    }
20    /// Increments the reference count associated with this shared data.
21    ///
22    /// See [C++ `wxRefCounter::IncRef()`'s documentation](https://docs.wxwidgets.org/3.2/classwx_ref_counter.html#a9fec1fb6f778d9df7a8c046ad6a2d887).
23    fn inc_ref(&self) {
24        unsafe { ffi::wxRefCounter_IncRef(self.as_ptr()) }
25    }
26}