Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
bitpit::ProxyVectorStorage< value_t, container_t, thread_safe > Class Template Reference

Metafunction for generating ProxyVector storages. More...

#include <proxyVector.hpp>

Inheritance diagram for bitpit::ProxyVectorStorage< value_t, container_t, thread_safe >:
Inheritance graph
[legend]
Collaboration diagram for bitpit::ProxyVectorStorage< value_t, container_t, thread_safe >:
Collaboration graph
[legend]

Public Types

typedef container_t::const_pointer const_pointer
 
typedef container_t container_type
 
typedef container_t::pointer pointer
 

Public Member Functions

 ~ProxyVectorStorage () override
 
container_t * container (bool forceCreation)
 
const container_t * container (bool forceCreation) const
 
const_pointer data () const override
 
pointer data () override
 
bool empty () const override
 
void resize (std::size_t size) override
 
std::size_t size () const override
 
void swap (ProxyVectorStorage &other) noexcept
 

Protected Member Functions

 ProxyVectorStorage (const ProxyVectorStorage &other)
 
 ProxyVectorStorage (ProxyVectorStorage &&other)=default
 
 ProxyVectorStorage (std::size_t size=0)
 
ProxyVectorStorageoperator= (const ProxyVectorStorage &other)
 
ProxyVectorStorageoperator= (ProxyVectorStorage &&other)=default
 

Friends

template<typename PXV_value_t , bool PXV_thread_safe>
class ProxyVector
 

Detailed Description

template<typename value_t, typename container_t, bool thread_safe>
class bitpit::ProxyVectorStorage< value_t, container_t, thread_safe >

Metafunction for generating ProxyVector storages.

Template Parameters
value_tis the type of the objects handled by the storage
container_tdefines the type of container where the data is stored
thread_safecontrols if it is safe to use the container in a multi-threaded code

Definition at line 225 of file proxyVector.hpp.

Member Typedef Documentation

◆ const_pointer

template<typename value_t , typename container_t , bool thread_safe>
typedef container_t::const_pointer bitpit::ProxyVectorStorage< value_t, container_t, thread_safe >::const_pointer

Definition at line 235 of file proxyVector.hpp.

◆ container_type

template<typename value_t , typename container_t , bool thread_safe>
typedef container_t bitpit::ProxyVectorStorage< value_t, container_t, thread_safe >::container_type

Definition at line 232 of file proxyVector.hpp.

◆ pointer

template<typename value_t , typename container_t , bool thread_safe>
typedef container_t::pointer bitpit::ProxyVectorStorage< value_t, container_t, thread_safe >::pointer

Definition at line 234 of file proxyVector.hpp.

Constructor & Destructor Documentation

◆ ~ProxyVectorStorage()

template<typename value_t , typename container_t , bool thread_safe>
bitpit::ProxyVectorStorage< value_t, container_t, thread_safe >::~ProxyVectorStorage ( )
override

Destructor.

Definition at line 398 of file proxyVector.tpp.

◆ ProxyVectorStorage() [1/2]

template<typename value_t , typename container_t , bool thread_safe>
bitpit::ProxyVectorStorage< value_t, container_t, thread_safe >::ProxyVectorStorage ( std::size_t size = 0)
protected

Constructor.

Parameters
sizeis the size of the storage expressed in number of elements.

Definition at line 362 of file proxyVector.tpp.

◆ ProxyVectorStorage() [2/2]

template<typename value_t , typename container_t , bool thread_safe>
bitpit::ProxyVectorStorage< value_t, container_t, thread_safe >::ProxyVectorStorage ( const ProxyVectorStorage< value_t, container_t, thread_safe > & other)
protected

Copy constructor.

Parameters
otheris another storage of the same type (i.e., instantiated with the same template parameters) whose content is copied in this container.

Definition at line 374 of file proxyVector.tpp.

Member Function Documentation

◆ container() [1/2]

template<typename value_t , typename container_t , bool thread_safe>
container_t * bitpit::ProxyVectorStorage< value_t, container_t, thread_safe >::container ( bool forceCreation)

Get a reference to the data container associated with the storage.

Parameters
forceCreationif set to true and the storage is not associated with a container, an empty container will be created
Returns
A reference to the data container associated with the storage.

Definition at line 411 of file proxyVector.tpp.

◆ container() [2/2]

template<typename value_t , typename container_t , bool thread_safe>
const container_t * bitpit::ProxyVectorStorage< value_t, container_t, thread_safe >::container ( bool forceCreation) const

Get a reference to the data container associated with the storage.

Parameters
forceCreationif set to true and the storage is not associated with a container, an empty container will be created
Returns
A reference to the data container associated with the storage.

Definition at line 428 of file proxyVector.tpp.

◆ data() [1/2]

template<typename value_t , typename container_t , bool thread_safe>
ProxyVectorStorage< value_t, container_t, thread_safe >::const_pointer bitpit::ProxyVectorStorage< value_t, container_t, thread_safe >::data ( ) const
overridevirtual

Return a constant pointer to the data.

Returns
A constant pointer to the data.

Implements bitpit::ProxyVectorStorageInterface< container_t::pointer, container_t::const_pointer >.

Definition at line 469 of file proxyVector.tpp.

◆ data() [2/2]

template<typename value_t , typename container_t , bool thread_safe>
ProxyVectorStorage< value_t, container_t, thread_safe >::pointer bitpit::ProxyVectorStorage< value_t, container_t, thread_safe >::data ( )
overridevirtual

Return a pointer to the data.

Returns
A pointer to the data.

Implements bitpit::ProxyVectorStorageInterface< container_t::pointer, container_t::const_pointer >.

Definition at line 454 of file proxyVector.tpp.

◆ empty()

template<typename value_t , typename container_t , bool thread_safe>
bool bitpit::ProxyVectorStorage< value_t, container_t, thread_safe >::empty ( ) const
overridevirtual

Check if the storage is empty.

Returns
Returns true if the storage is empty, false otherwise.

Implements bitpit::ProxyVectorStorageInterface< container_t::pointer, container_t::const_pointer >.

Definition at line 484 of file proxyVector.tpp.

◆ operator=()

template<typename value_t , typename container_t , bool thread_safe>
ProxyVectorStorage< value_t, container_t, thread_safe > & bitpit::ProxyVectorStorage< value_t, container_t, thread_safe >::operator= ( const ProxyVectorStorage< value_t, container_t, thread_safe > & other)
protected

Copy assigment operator.

Parameters
otheris another storage of the same type (i.e., instantiated with the same template parameters) whose content is copied in this container.

Definition at line 386 of file proxyVector.tpp.

◆ resize()

template<typename value_t , typename container_t , bool thread_safe>
void bitpit::ProxyVectorStorage< value_t, container_t, thread_safe >::resize ( std::size_t size)
overridevirtual

Resize the storage.

Returns
The size of the storage expressed in number of elements.

Implements bitpit::ProxyVectorStorageInterface< container_t::pointer, container_t::const_pointer >.

Definition at line 514 of file proxyVector.tpp.

◆ size()

template<typename value_t , typename container_t , bool thread_safe>
std::size_t bitpit::ProxyVectorStorage< value_t, container_t, thread_safe >::size ( ) const
overridevirtual

Get the size of the storage expressed in number of elements.

Returns
The size of the storage, expressed in number of elements.

Implements bitpit::ProxyVectorStorageInterface< container_t::pointer, container_t::const_pointer >.

Definition at line 499 of file proxyVector.tpp.

◆ swap()

template<typename value_t , typename container_t , bool thread_safe>
void bitpit::ProxyVectorStorage< value_t, container_t, thread_safe >::swap ( ProxyVectorStorage< value_t, container_t, thread_safe > & other)
noexcept

Swaps the contents.

Parameters
otheris another storage of the same type

Definition at line 443 of file proxyVector.tpp.

Friends And Related Symbol Documentation

◆ ProxyVector

template<typename value_t , typename container_t , bool thread_safe>
template<typename PXV_value_t , bool PXV_thread_safe>
friend class ProxyVector
friend

Definition at line 229 of file proxyVector.hpp.


The documentation for this class was generated from the following files:
--- layout: doxygen_footer ---