Boxed objects
Alias types
-
The opaque pointer that points to the boxed object.
-
The reference counter type for boxed objects.
Functions
-
typeinfo_t register_boxed_type()
Registers one type so that it can be used for creating boxed objects.
-
object_t object_alloc(typeinfo_t type)
Allocates one boxed object.
-
ref_count_t object_retain(object_t object_ptr)
Increases the strong refernece counter value by one.
-
ref_count_t object_release(object_t object_ptr)
Decreases the strong refernece counter value by one, and destroys the object if the reference counter drops to 0.
-
ref_count_t object_ref_count(object_t object_ptr)
Fetches the strong refernece counter value of the boxed object.
-
ref_count_t object_retain_weak(object_t object_ptr)
Increases the weak refernece counter value by one.
-
ref_count_t object_release_weak(object_t object_ptr)
Decreases the weak refernece counter value by one.
-
ref_count_t object_weak_ref_count(object_t object_ptr)
Fetches the weak refernece counter value of the boxed object.
-
bool object_expired(object_t object_ptr)
Checks if the boxed object is expired, that is, destructed but its memeory is not freed.
-
bool object_retain_if_not_expired(object_t object_ptr)
Increases the strong refernece counter value by one if the boxed object is not expired.
-
typeinfo_t get_object_type(object_t object_ptr)
Gets the type object of the boxed object.
-
bool object_is_type(object_t object_ptr, typeinfo_t type)
Checks whether the boxed object is the specified type or derived types of the specified type.
-
_Rty * cast_object(object_t object_ptr)
Casts the object to the specified type.