CsPointer  1.0.1
CsPointer::CsSharedArrayPointer< T > Class Template Reference

Stores a shared pointer to a dynamically allocated array of objects. More...

Inheritance diagram for CsPointer::CsSharedArrayPointer< T >:
CsPointer::CsSharedPointer< cs_add_missing_extent_t< T > >

Public Typedefs

using element_type = typename std::shared_ptr< cs_add_missing_extent_t< T > >::element_type
 
using weak_type = CsWeakPointer< cs_add_missing_extent_t< T > >
 
using pointer = element_type *
 
using ElementType = element_type
 
using WeakType = weak_type
 
using Pointer = pointer
 
- Public Typedefs inherited from CsPointer::CsSharedPointer< cs_add_missing_extent_t< T > >
using ElementType = element_type
 
using Pointer = pointer
 
using WeakType = weak_type
 
using element_type = typename std::shared_ptr< cs_add_missing_extent_t< T > >::element_type
 
using pointer = element_type *
 
using weak_type = CsWeakPointer< cs_add_missing_extent_t< T > >
 

Public Member Functions

 CsSharedArrayPointer (const CsSharedArrayPointer< element_type > &other)
 
 CsSharedArrayPointer (const CsSharedArrayPointer< element_type[]> &other)
 
CsSharedArrayPointer & operator= (const CsSharedArrayPointer< element_type > &other)
 
CsSharedArrayPointer & operator= (const CsSharedArrayPointer< element_type[]> &other)
 
 CsSharedArrayPointer (CsSharedArrayPointer< element_type > &&other)
 
 CsSharedArrayPointer (CsSharedArrayPointer< element_type[]> &&other)
 
CsSharedArrayPointer & operator= (CsSharedArrayPointer< element_type > &&other)
 
CsSharedArrayPointer & operator= (CsSharedArrayPointer< element_type[]> &&other)
 
element_typeoperator* () const noexcept
 
element_typeoperator[] (std::size_t index) const noexcept
 
- Public Member Functions inherited from CsPointer::CsSharedPointer< cs_add_missing_extent_t< T > >
constexpr CsSharedPointer () noexcept
 
constexpr CsSharedPointer (std::nullptr_t) noexcept
 
 CsSharedPointer (U *p)
 
 CsSharedPointer (U *p, Deleter d)
 
 CsSharedPointer (std::nullptr_t, Deleter d)
 
 CsSharedPointer (U *p, Deleter d, Alloc a)
 
 CsSharedPointer (std::nullptr_t, Deleter d, Alloc a)
 
 CsSharedPointer (CsUniquePointer< U, Deleter > &&p)
 
 CsSharedPointer (const std::shared_ptr< U > &p) noexcept
 
 CsSharedPointer (std::shared_ptr< U > &&p) noexcept
 
 CsSharedPointer (const CsSharedPointer< U > &p1, element_type *p2) noexcept
 
 CsSharedPointer (CsSharedPointer< U > &&p1, element_type *p2) noexcept
 
 CsSharedPointer (const CsSharedPointer &other) = default
 
 CsSharedPointer (CsSharedPointer &&other) = default
 
 CsSharedPointer (const CsSharedPointer< U > &p) noexcept
 
 CsSharedPointer (CsSharedPointer< U > &&p) noexcept
 
 CsSharedPointer (const CsWeakPointer< U > &p)
 
void clear () noexcept
 
pointer data () const noexcept
 
pointer get () const noexcept
 
bool is_null () const noexcept
 
 operator bool () const noexcept
 
 operator std::shared_ptr< U > () const &noexcept
 
 operator std::shared_ptr< U > () &&noexcept
 
bool operator! () const noexcept
 
element_typeoperator* () const noexcept
 
pointer operator-> () const noexcept
 
CsSharedPointeroperator= (const CsSharedPointer &other) = default
 
CsSharedPointeroperator= (CsSharedPointer &&other) = default
 
CsSharedPointeroperator= (const CsSharedPointer< U > &p) noexcept
 
CsSharedPointeroperator= (CsSharedPointer< U > &&p) noexcept
 
CsSharedPointeroperator= (const CsWeakPointer< U > &p)
 
bool owner_before (const CsSharedPointer< U > &p) const noexcept
 
bool owner_before (const CsWeakPointer< U > &p) const noexcept
 
void reset () noexcept
 
void reset (U *p)
 
void reset (U *p, Deleter d)
 
void reset (U *p, Deleter d, Alloc a)
 
void swap (CsSharedPointer &other) noexcept
 
CsWeakPointer< cs_add_missing_extent_t< T > > toWeakRef () const
 
bool unique () const noexcept
 
long use_count () const noexcept
 
 ~CsSharedPointer () = default
 

Additional Inherited Members

- Static Public Member Functions inherited from CsPointer::CsSharedPointer< cs_add_missing_extent_t< T > >
static CsSharedPointer< cs_add_missing_extent_t< T > > create (Args &&...args)
 

Detailed Description

template<typename T>
class CsPointer::CsSharedArrayPointer< T >

The CsSharedArrayPointer class stores a shared pointer to a dynamically allocated array of objects. The array will be deleted when the last CsSharedArrayPointer pointing to the array is destroyed or reset.

Member Typedef Documentation

template<typename T >
CsSharedArrayPointer::element_type

Typedef for std::shared_ptr<cs_add_missing_extent_t<T>>::element_type.

template<typename T >
CsSharedArrayPointer::ElementType

Typedef for element_type.

template<typename T >
CsSharedArrayPointer::pointer

Typedef for element_type *.

template<typename T >
CsSharedArrayPointer::Pointer

Typedef for pointer.

template<typename T >
CsSharedArrayPointer::WeakType

Typedef for weak_type.

Constructor & Destructor Documentation

template<typename T >
CsSharedArrayPointer::CsSharedArrayPointer ( const CsSharedArrayPointer< element_type > &  other)
inline

Copy constructs a new CsSharedArrayPointer from other and returns a reference to this object.

template<typename T >
CsSharedArrayPointer::CsSharedArrayPointer ( const CsSharedArrayPointer< element_type[]> &  other)
inline

Copy constructs a new CsSharedArrayPointer from other and returns a reference to this object.

template<typename T >
CsSharedArrayPointer::CsSharedArrayPointer ( CsSharedArrayPointer< element_type > &&  other)
inline

Move constructs a new CsSharedArrayPointer from other and returns a reference to this object.

template<typename T >
CsSharedArrayPointer::CsSharedArrayPointer ( CsSharedArrayPointer< element_type[]> &&  other)
inline

Move constructs a new CsSharedArrayPointer from other and returns a reference to this object.

Member Function Documentation

template<typename T >
element_type & CsSharedArrayPointer::operator* ( ) const
inlinenoexcept

Returns a reference to the first element in the array.

template<typename T >
CsSharedArrayPointer & CsSharedArrayPointer::operator= ( const CsSharedArrayPointer< element_type > &  other)
inline

Copy assigns from other and returns a reference to this object.

template<typename T >
CsSharedArrayPointer & CsSharedArrayPointer::operator= ( const CsSharedArrayPointer< element_type[]> &  other)
inline

Copy assigns from other and returns a reference to this object.

template<typename T >
CsSharedArrayPointer & CsSharedArrayPointer::operator= ( CsSharedArrayPointer< element_type > &&  other)
inline

Move assigns from other and returns a reference to this object.

template<typename T >
CsSharedArrayPointer & CsSharedArrayPointer::operator= ( CsSharedArrayPointer< element_type[]> &&  other)
inline

Move assigns from other and returns a reference to this object.

template<typename T >
element_type & CsSharedArrayPointer::operator[] ( std::size_t  index) const
inlinenoexcept

Returns a reference to the element with the given index.