#include <linked_array.h>
template<typename T, typename Deleter = smart_array_deleter<T>>
class eastl::linked_array< T, Deleter >
class linked_array
This class implements a linked_array template, which is an array version of linked_ptr. See linked_ptr for detailed documentation.
◆ bool_
template<typename T , typename Deleter = smart_array_deleter<T>>
Implicit operator bool Allows for using a linked_array as a boolean. Note that below we do not use operator bool(). The reason for this is that booleans automatically convert up to short, int, float, etc. The result is that this: if(linkedArray == 1) would yield true (bad).
◆ element_type
template<typename T , typename Deleter = smart_array_deleter<T>>
element_type Synonym for type T, useful for external code to reference the type in a generic way.
◆ this_type
template<typename T , typename Deleter = smart_array_deleter<T>>
this_type This is an alias for linked_array<T>, this class.
◆ linked_array() [1/2]
template<typename T , typename Deleter = smart_array_deleter<T>>
linked_array Takes ownership of the pointer. It is OK if the input pointer is null.
◆ linked_array() [2/2]
template<typename T , typename Deleter = smart_array_deleter<T>>
◆ ~linked_array()
template<typename T , typename Deleter = smart_array_deleter<T>>
~linked_array Removes this object from the of objects using the shared pointer. If this object is the last owner of the shared pointer, the shared pointer is deleted.
◆ force_delete()
template<typename T , typename Deleter = smart_array_deleter<T>>
force_delete Forces deletion of the shared pointer. Fixes all references to the pointer by any other owners to be NULL.
◆ get()
template<typename T , typename Deleter = smart_array_deleter<T>>
get Returns the owned pointer. Note that this class does not provide an operator T() function. This is because such a thing (automatic conversion) is deemed unsafe.
◆ operator!()
template<typename T , typename Deleter = smart_array_deleter<T>>
operator! This returns the opposite of operator bool; it returns true if the owned pointer is null. Some compilers require this and some don't.
◆ operator*()
template<typename T , typename Deleter = smart_array_deleter<T>>
operator* Returns the owner pointer dereferenced.
◆ operator->()
template<typename T , typename Deleter = smart_array_deleter<T>>
operator-> Allows access to the owned pointer via operator->()
◆ operator=() [1/2]
template<typename T , typename Deleter = smart_array_deleter<T>>
operator= Copies another linked_array to this object. Note that this object may already own a shared pointer with another different pointer (but still of the same type) before this call. In that case, this function removes ownership of the old pointer and takes shared ownership of the new pointer and increments its reference count.
◆ operator=() [2/2]
template<typename T , typename Deleter = smart_array_deleter<T>>
operator= Assigns a new pointer. If the new pointer is equivalent to the current pointer, nothing is done. Otherwise the current pointer is unlinked and possibly destroyed. The new pointer can be NULL.
◆ operator[]()
template<typename T , typename Deleter = smart_array_deleter<T>>
swap Exchanges the owned pointer beween two linkedArray objects.
This function is disabled as it is currently deemed unsafe. The problem is that the only way to implement this function is to transfer pointers between the objects; you cannot transfer the linked list membership between the objects. Thus unless both linked_array objects were 'unique()', the shared pointers would be duplicated amongst containers, resulting in a crash. operator[] Returns a reference to the specified item in the owned pointer array.
◆ reset()
template<typename T , typename Deleter = smart_array_deleter<T>>
reset Releases the owned pointer and takes ownership of the passed in pointer. If the passed in pointer is the same as the owned pointer, nothing is done. The passed in pointer can be null, in which case the use count is set to 1.
◆ unique()
template<typename T , typename Deleter = smart_array_deleter<T>>
unique Returns true if the use count of the owned pointer is one. The return value is true if the owned pointer is null.
◆ use_count()
template<typename T , typename Deleter = smart_array_deleter<T>>
use_count Returns the use count of the shared pointer. The return value is one if the owned pointer is null. This function is provided for compatibility with the proposed C++ standard and for debugging purposes. It is not intended for runtime use given that its execution time is not constant.
The documentation for this class was generated from the following file: