Trait physx::base::RefCounted

source ·
pub trait RefCounted: Class<PxRefCounted> + Sized {
    // Provided methods
    fn release(&mut self) { ... }
    fn get_reference_count(&self) -> u32 { ... }
    fn acquire_reference(&mut self) { ... }
}

Provided Methods§

source

fn release(&mut self)

Decrements the reference count of the object and releases it if the new reference count is zero.

source

fn get_reference_count(&self) -> u32

Returns the reference count of the object.

At creation, the reference count of the object is 1. Every other object referencing this object increments the count by 1. When the reference count reaches 0, and only then, the object gets destroyed automatically.

source

fn acquire_reference(&mut self)

Acquires a counted reference to this object.

This method increases the reference count of the object by 1. Decrement the reference count by calling Self::release

Implementors§

source§

impl<T> RefCounted for Twhere T: Class<PxRefCounted> + Sized,