include/Cnx/shared_ptr/SharedPtrDef.h file

This module provides the macro definitions for a struct template for representing a sharedly owned pointer.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Defines

#define CnxSharedPtr(T)
macro alias for a CnxSharedPtr(T) maintaining ownership of an allocated T
#define CnxSharedPtrIdentifier(T, Identifier)
macro alias for an identifier (type, function, etc) associated with a CnxSharedPtr(T) instantiation
#define cnx_shared_ptr_new(T)
Creates a new sharedly, owned zero-initialized T
#define cnx_shared_ptr_new_with_allocator(T, allocator)
Creates a new sharedly owned, zero-initialized T, allocated with the given allocator.
#define cnx_shared_ptr_new_with_capacity(T, capacity)
Creates a new sharedly owned, zero-initialized, dynamically allocated array.
#define cnx_shared_ptr_new_with_capacity_and_allocator(T, capacity, allocator)
Creates a new sharedly owned, zero-initialized, dynamically allocated array, allocated with the given allocator.
#define cnx_shared_ptr_from(T, ptr)
Creates a new CnxSharedPtr(T) managing the given pointer.
#define cnx_shared_ptr_from_with_allocator(T, ptr, allocator)
Creates a new CnxSharedPtr(T) managing the given pointer, associated with the given allocator.
#define cnx_shared_ptr_free(T, self)
Frees the given CnxSharedPtr(T), calling the associated deleter on the managed object.
#define cnx_shared_ptr_release(self)
Releases the pointer managed by self from ownership.
#define cnx_shared_ptr_reset(self, new_ptr)
Frees the object currently managed by self, and replaces it with the one pointed to by new_ptr
#define cnx_shared_ptr_clone(self)
Clones the given CnxSharedPtr(T)
#define cnx_shared_ptr_swap(self, other_ptr)
Swaps the managed objects of self and the CnxSharedPtr(T) pointed to by other_ptr
#define cnx_shared_ptr_get_deleter(self)
Returns the CnxDeleter(T) function pointer associated with the CnxSharedPtr(T) instantiation self is an instance of.
#define cnx_shared_ptr_as_bool(self)
Returns whether the given CnxSharedPtr(T) currently manages an object.
#define cnx_shared_ptr_get(self)
Returns a pointer to the object managed by self
#define __cnx_shared_ptr_get(self)
implementation of cnx_shared_ptr_get
#define cnx_shared_ptr_get_const(self)
Returns a pointer-to-const to the object managed by self
#define cnx_shared_ptr_get_mut(self)
Returns a pointer-to-non-const to the object managed by self
#define cnx_shared_ptr_at(self, index)
Returns a reference to the element at index in the array managed by self
#define __cnx_shared_ptr_at(self, index)
implementation of cnx_shared_ptr_at
#define cnx_shared_ptr_at_const(self, index)
Returns a reference-to-const to the element at index in the array managed by self
#define __cnx_shared_ptr_at_const(self, index)
implementation of cnx_shared_ptr_at_const
#define cnx_shared_ptr_at_mut(self, index)
Returns a reference-to-non-const to the element at index in the array managed by self
#define __cnx_shared_ptr_at_mut(self, index)
implementation of cnx_shared_ptr_at_mut
#define cnx_make_shared(T, ...)
Creates a CnxSharedPtr(T) managing a T initialized with the given list of (potentially designated) initializers.
#define cnx_make_shared_with_allocator(T, allocator, ...)
Creates a CnxSharedPtr(T) managing a T initialized with the given list of (potentially designated) initializers, allocated with the given allocator.
#define cnx_make_shared_array(T, capacity)
Creates a CnxSharedPtr(T) managing the array type T with the given initial capacity.
#define cnx_make_shared_array_with_allocator(T, capacity, allocator)
Creates a CnxSharedPtr(T) managing the array type T with the given initial capacity, allocated with the given allocator.
#define SharedPtr(T)
Declare a CnxSharedPtr(T) with this declaration attribute/type to ensure it (and its managed object) is automatically freed when the CnxSharedPtr(T) goes out of scope.
#define __SHARED_PTR_CHECK_INSTANCE_IS_ARRAY(self)
wrapper for __SMART_PTR_CHECK_INSTANCE_IS_ARRAY
#define __SHARED_PTR_IS_ARRAY
wrapper for __SMART_PTR_IS_ARRAY
#define __SHARED_PTR_IS_ARRAY_GENERIC(T)
wrapper for __SMART_PTR_IS_ARRAY
#define __SHARED_PTR_ELEMENT_PTR_BASE
wrapper for __SMART_PTR_ELEMENT_PTR_BASE
#define __SHARED_PTR_CONST_ELEMENT_PTR_BASE
wrapper for __SMART_PTR_CONST_ELEMENT_PTR_BASE
#define __SHARED_PTR_ELEMENT_PTR
wrapper for __SMART_PTR_ELEMENT_PTR
#define __SHARED_PTR_CONST_ELEMENT_PTR
wrapper for __SMART_PTR_CONST_ELEMENT_PTR
#define __SHARED_PTR_ELEMENT
wrapper for __SMART_PTR_ELEMENT