Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::TUniquePtrVector< BaseType > Class Template Referencefinal

#include <TUniquePtrVector.h>

Inheritance diagram for ph::TUniquePtrVector< BaseType >:
ph::IMoveOnly

Public Member Functions

template<typename T >
T * add (std::unique_ptr< T > uniquePtr)
 
template<typename T >
void addAll (TUniquePtrVector< T > &uniquePtrs)
 
std::unique_ptr< BaseType > remove (std::size_t index)
 
std::unique_ptr< BaseType > remove (const BaseType *ptr)
 
std::unique_ptr< BaseType > removeLast ()
 
std::unique_ptr< BaseType > removeBySwapPop (const BaseType *ptr)
 Remove a unique_ptr. Does not preserve the order of remaining unique_ptrs. Complexity: O(N) where N is size of the vector. Needs to find ptr linearly, but saves the cost of moving every following element forward.
 
void removeAll ()
 
void clear (std::size_t index)
 
void clearRange (std::size_t beginIndex, std::size_t endIndex)
 Set unique_ptrs in the range [beginIndex, endIndex) to nullptr.
 
BaseType * get (std::size_t index) const
 
BaseType * first () const
 
BaseType * last () const
 
std::unique_ptr< BaseType > & getUniquePtr (std::size_t index)
 
const std::unique_ptr< BaseType > & getUniquePtr (std::size_t index) const
 
std::size_t size () const
 
std::optional< std::size_t > indexOf (const BaseType *ptr) const
 
bool isEmpty () const
 
BaseType * operator[] (std::size_t index) const
 
Iterators

Iterators for stored objects.

std::vector< std::unique_ptr< BaseType > >::iterator begin () noexcept
 
std::vector< std::unique_ptr< BaseType > >::const_iterator begin () const noexcept
 
std::vector< std::unique_ptr< BaseType > >::iterator end () noexcept
 
std::vector< std::unique_ptr< BaseType > >::const_iterator end () const noexcept
 

Member Function Documentation

◆ add()

template<typename BaseType >
template<typename T >
T * ph::TUniquePtrVector< BaseType >::add ( std::unique_ptr< T > uniquePtr)
inline

◆ addAll()

template<typename BaseType >
template<typename T >
void ph::TUniquePtrVector< BaseType >::addAll ( TUniquePtrVector< T > & uniquePtrs)
inline

◆ begin() [1/2]

template<typename BaseType >
std::vector< std::unique_ptr< BaseType > >::const_iterator ph::TUniquePtrVector< BaseType >::begin ( ) const
inlinenoexcept

◆ begin() [2/2]

template<typename BaseType >
std::vector< std::unique_ptr< BaseType > >::iterator ph::TUniquePtrVector< BaseType >::begin ( )
inlinenoexcept

◆ clear()

template<typename BaseType >
void ph::TUniquePtrVector< BaseType >::clear ( std::size_t index)
inline

◆ clearRange()

template<typename BaseType >
void ph::TUniquePtrVector< BaseType >::clearRange ( std::size_t beginIndex,
std::size_t endIndex )
inline

Set unique_ptrs in the range [beginIndex, endIndex) to nullptr.

◆ end() [1/2]

template<typename BaseType >
std::vector< std::unique_ptr< BaseType > >::const_iterator ph::TUniquePtrVector< BaseType >::end ( ) const
inlinenoexcept

◆ end() [2/2]

template<typename BaseType >
std::vector< std::unique_ptr< BaseType > >::iterator ph::TUniquePtrVector< BaseType >::end ( )
inlinenoexcept

◆ first()

template<typename BaseType >
BaseType * ph::TUniquePtrVector< BaseType >::first ( ) const
inline

◆ get()

template<typename BaseType >
BaseType * ph::TUniquePtrVector< BaseType >::get ( std::size_t index) const
inline

◆ getUniquePtr() [1/2]

template<typename BaseType >
std::unique_ptr< BaseType > & ph::TUniquePtrVector< BaseType >::getUniquePtr ( std::size_t index)
inline

◆ getUniquePtr() [2/2]

template<typename BaseType >
const std::unique_ptr< BaseType > & ph::TUniquePtrVector< BaseType >::getUniquePtr ( std::size_t index) const
inline

◆ indexOf()

template<typename BaseType >
std::optional< std::size_t > ph::TUniquePtrVector< BaseType >::indexOf ( const BaseType * ptr) const
inline

◆ isEmpty()

template<typename BaseType >
bool ph::TUniquePtrVector< BaseType >::isEmpty ( ) const
inline

◆ last()

template<typename BaseType >
BaseType * ph::TUniquePtrVector< BaseType >::last ( ) const
inline

◆ operator[]()

template<typename BaseType >
BaseType * ph::TUniquePtrVector< BaseType >::operator[] ( std::size_t index) const
inline

◆ remove() [1/2]

template<typename BaseType >
std::unique_ptr< BaseType > ph::TUniquePtrVector< BaseType >::remove ( const BaseType * ptr)
inline

◆ remove() [2/2]

template<typename BaseType >
std::unique_ptr< BaseType > ph::TUniquePtrVector< BaseType >::remove ( std::size_t index)
inline

◆ removeAll()

template<typename BaseType >
void ph::TUniquePtrVector< BaseType >::removeAll ( )
inline

◆ removeBySwapPop()

template<typename BaseType >
std::unique_ptr< BaseType > ph::TUniquePtrVector< BaseType >::removeBySwapPop ( const BaseType * ptr)
inline

Remove a unique_ptr. Does not preserve the order of remaining unique_ptrs. Complexity: O(N) where N is size of the vector. Needs to find ptr linearly, but saves the cost of moving every following element forward.

◆ removeLast()

template<typename BaseType >
std::unique_ptr< BaseType > ph::TUniquePtrVector< BaseType >::removeLast ( )
inline

◆ size()

template<typename BaseType >
std::size_t ph::TUniquePtrVector< BaseType >::size ( ) const
inline

The documentation for this class was generated from the following file: