#[repr(C)]pub struct hkReferencedObject {
pub __base: hkBaseObject,
pub memSizeAndFlags: u16,
pub referenceCount: AtomicI16,
pub pad0C: u32,
}
Expand description
Represents a reference-counted object in the Havok system.
Inherits from hkBaseObject
and adds reference counting functionality.
Fields§
§__base: hkBaseObject
Base class hkBaseObject
.
memSizeAndFlags: u16
Combined memory size and flags.
- Offset: 0x08
referenceCount: AtomicI16
Volatile mutable reference count.
- Offset: 0x0A
pad0C: u32
Padding to maintain memory alignment.
- Offset: 0x0C
Implementations§
Source§impl hkReferencedObject
impl hkReferencedObject
Sourcepub fn add_reference(&self)
pub fn add_reference(&self)
Adds a reference to this object by incrementing the reference count atomically.
Sourcepub fn remove_reference(&self)
pub fn remove_reference(&self)
Removes a reference from this object by decrementing the reference count atomically.
Sourcepub fn get_reference_count(&self) -> i16
pub fn get_reference_count(&self) -> i16
Gets the current reference count.
Sourcepub const fn get_allocated_size(&self) -> i32
pub const fn get_allocated_size(&self) -> i32
Gets the allocated size (based on memSizeAndFlags).
Trait Implementations§
Source§impl Debug for hkReferencedObject
impl Debug for hkReferencedObject
Source§impl Default for hkReferencedObject
impl Default for hkReferencedObject
Source§impl hkRefPtrCounted for hkReferencedObject
impl hkRefPtrCounted for hkReferencedObject
fn AddReference(&self)
fn RemoveReference(&self)
Auto Trait Implementations§
impl !Freeze for hkReferencedObject
impl RefUnwindSafe for hkReferencedObject
impl !Send for hkReferencedObject
impl !Sync for hkReferencedObject
impl Unpin for hkReferencedObject
impl UnwindSafe for hkReferencedObject
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more