KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
List of all members
Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType > Class Template Referencefinal

WeakPointerVector is a container like stl vector but using a vector to store pointers to its data. More...

#include <weak_pointer_vector.h>

Collaboration diagram for Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >:

Public Member Functions

Life Cycle
 WeakPointerVector ()
 Default constructor. More...
 
template<class TInputIteratorType >
 WeakPointerVector (TInputIteratorType First, TInputIteratorType Last)
 
 WeakPointerVector (const WeakPointerVector &rOther)
 
 WeakPointerVector (const TContainerType &rContainer)
 
 ~WeakPointerVector ()
 Destructor. More...
 
Operators
WeakPointerVectoroperator= (const WeakPointerVector &rOther)
 
TDataType & operator[] (const size_type &i)
 
TDataType const & operator[] (const size_type &i) const
 
pointeroperator() (const size_type &i)
 
const_pointeroperator() (const size_type &i) const
 
bool operator== (const WeakPointerVector &r) const
 
Operations
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
ptr_iterator ptr_begin ()
 
ptr_const_iterator ptr_begin () const
 
ptr_iterator ptr_end ()
 
ptr_const_iterator ptr_end () const
 
ptr_reverse_iterator ptr_rbegin ()
 
ptr_const_reverse_iterator ptr_rbegin () const
 
ptr_reverse_iterator ptr_rend ()
 
ptr_const_reverse_iterator ptr_rend () const
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
size_type size () const
 
void resize (size_type new_dim) const
 
void resize (size_type new_dim)
 
size_type max_size () const
 
void swap (WeakPointerVector &rOther)
 
void push_back (TPointerType x)
 
void push_back (const_reference x)
 
iterator insert (iterator Position, const TDataType &rData)
 
iterator insert (iterator Position, const TPointerType pData)
 
template<class InputIterator >
void insert (InputIterator First, InputIterator Last)
 
iterator erase (iterator pos)
 
iterator erase (iterator first, iterator last)
 
void clear ()
 
void reserve (int dim)
 
int capacity ()
 
Access
TContainerType & GetContainer ()
 
const TContainerType & GetContainer () const
 
Inquiry
bool empty () const
 
Input and output
std::string Info () const
 Turn back information as a string. More...
 
void PrintInfo (std::ostream &rOStream) const
 Print information about this object. More...
 
void PrintData (std::ostream &rOStream) const
 Print object's data. More...
 

Type Definitions

typedef TDataType data_type
 data type stores in this container. More...
 
typedef TPointerType value_type
 
typedef TPointerType pointer
 
typedef const TPointerType const_pointer
 
typedef TDataType & reference
 
typedef const TDataType & const_reference
 
typedef TContainerType ContainerType
 
typedef WeakPointerVectorIterator< typename TContainerType::iterator, TDataType > iterator
 
typedef WeakPointerVectorIterator< typename TContainerType::const_iterator, TDataType > const_iterator
 
typedef WeakPointerVectorIterator< typename TContainerType::reverse_iterator, TDataType > reverse_iterator
 
typedef WeakPointerVectorIterator< typename TContainerType::const_reverse_iterator, TDataType > const_reverse_iterator
 
typedef TContainerType::size_type size_type
 
typedef TContainerType::iterator ptr_iterator
 
typedef TContainerType::const_iterator ptr_const_iterator
 
typedef TContainerType::reverse_iterator ptr_reverse_iterator
 
typedef TContainerType::const_reverse_iterator ptr_const_reverse_iterator
 
 KRATOS_CLASS_POINTER_DEFINITION (WeakPointerVector)
 Pointer definition of WeakPointerVector. More...
 

Detailed Description

template<class TDataType, class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
class Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >

WeakPointerVector is a container like stl vector but using a vector to store pointers to its data.

WeakPointerVector is a container like stl vector but using a vector to store pointers its data. Many methods are copied from boost ptr_container library. There is modification to make it capable to work with shared pointers.

This Container unlike the boost one does not free the memory by itself and relies on using of counted pointers or manual deleting.

Member Typedef Documentation

◆ const_iterator

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
typedef WeakPointerVectorIterator<typename TContainerType::const_iterator, TDataType> Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::const_iterator

◆ const_pointer

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
typedef const TPointerType Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::const_pointer

◆ const_reference

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
typedef const TDataType& Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::const_reference

◆ const_reverse_iterator

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
typedef WeakPointerVectorIterator<typename TContainerType::const_reverse_iterator, TDataType> Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::const_reverse_iterator

◆ ContainerType

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
typedef TContainerType Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::ContainerType

◆ data_type

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
typedef TDataType Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::data_type

data type stores in this container.

◆ iterator

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
typedef WeakPointerVectorIterator<typename TContainerType::iterator, TDataType> Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::iterator

◆ pointer

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
typedef TPointerType Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::pointer

◆ ptr_const_iterator

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
typedef TContainerType::const_iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::ptr_const_iterator

◆ ptr_const_reverse_iterator

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
typedef TContainerType::const_reverse_iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::ptr_const_reverse_iterator

◆ ptr_iterator

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
typedef TContainerType::iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::ptr_iterator

◆ ptr_reverse_iterator

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
typedef TContainerType::reverse_iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::ptr_reverse_iterator

◆ reference

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
typedef TDataType& Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::reference

◆ reverse_iterator

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
typedef WeakPointerVectorIterator<typename TContainerType::reverse_iterator, TDataType> Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::reverse_iterator

◆ size_type

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
typedef TContainerType::size_type Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::size_type

◆ value_type

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
typedef TPointerType Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::value_type

Constructor & Destructor Documentation

◆ WeakPointerVector() [1/4]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::WeakPointerVector ( )
inline

Default constructor.

◆ WeakPointerVector() [2/4]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
template<class TInputIteratorType >
Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::WeakPointerVector ( TInputIteratorType  First,
TInputIteratorType  Last 
)
inline

◆ WeakPointerVector() [3/4]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::WeakPointerVector ( const WeakPointerVector< TDataType, TPointerType, TContainerType > &  rOther)
inline

◆ WeakPointerVector() [4/4]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::WeakPointerVector ( const TContainerType &  rContainer)
inlineexplicit

◆ ~WeakPointerVector()

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::~WeakPointerVector ( )
inline

Destructor.

Member Function Documentation

◆ back() [1/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
reference Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::back ( )
inline

◆ back() [2/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
const_reference Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::back ( ) const
inline

◆ begin() [1/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::begin ( )
inline

◆ begin() [2/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
const_iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::begin ( ) const
inline

◆ capacity()

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
int Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::capacity ( )
inline

◆ clear()

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
void Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::clear ( )
inline

◆ empty()

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
bool Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::empty ( ) const
inline

◆ end() [1/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::end ( )
inline

◆ end() [2/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
const_iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::end ( ) const
inline

◆ erase() [1/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::erase ( iterator  first,
iterator  last 
)
inline

◆ erase() [2/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::erase ( iterator  pos)
inline

◆ front() [1/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
reference Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::front ( )
inline

◆ front() [2/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
const_reference Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::front ( ) const
inline

◆ GetContainer() [1/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
TContainerType& Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::GetContainer ( )
inline

Gives a reference to underly normal container.

◆ GetContainer() [2/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
const TContainerType& Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::GetContainer ( ) const
inline

Gives a constant reference to underly normal container.

◆ Info()

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
std::string Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::Info ( ) const
inline

Turn back information as a string.

◆ insert() [1/3]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
template<class InputIterator >
void Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::insert ( InputIterator  First,
InputIterator  Last 
)
inline

◆ insert() [2/3]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::insert ( iterator  Position,
const TDataType &  rData 
)
inline

◆ insert() [3/3]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::insert ( iterator  Position,
const TPointerType  pData 
)
inline

◆ KRATOS_CLASS_POINTER_DEFINITION()

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::KRATOS_CLASS_POINTER_DEFINITION ( WeakPointerVector< TDataType, TPointerType, TContainerType >  )

Pointer definition of WeakPointerVector.

◆ max_size()

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
size_type Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::max_size ( ) const
inline

◆ operator()() [1/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
pointer& Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::operator() ( const size_type i)
inline

◆ operator()() [2/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
const_pointer& Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::operator() ( const size_type i) const
inline

◆ operator=()

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
WeakPointerVector& Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::operator= ( const WeakPointerVector< TDataType, TPointerType, TContainerType > &  rOther)
inline

◆ operator==()

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
bool Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::operator== ( const WeakPointerVector< TDataType, TPointerType, TContainerType > &  r) const
inline

◆ operator[]() [1/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
TDataType& Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::operator[] ( const size_type i)
inline

◆ operator[]() [2/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
TDataType const& Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::operator[] ( const size_type i) const
inline

◆ PrintData()

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
void Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::PrintData ( std::ostream &  rOStream) const
inline

Print object's data.

◆ PrintInfo()

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
void Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::PrintInfo ( std::ostream &  rOStream) const
inline

Print information about this object.

◆ ptr_begin() [1/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
ptr_iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::ptr_begin ( )
inline

◆ ptr_begin() [2/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
ptr_const_iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::ptr_begin ( ) const
inline

◆ ptr_end() [1/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
ptr_iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::ptr_end ( )
inline

◆ ptr_end() [2/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
ptr_const_iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::ptr_end ( ) const
inline

◆ ptr_rbegin() [1/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
ptr_reverse_iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::ptr_rbegin ( )
inline

◆ ptr_rbegin() [2/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
ptr_const_reverse_iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::ptr_rbegin ( ) const
inline

◆ ptr_rend() [1/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
ptr_reverse_iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::ptr_rend ( )
inline

◆ ptr_rend() [2/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
ptr_const_reverse_iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::ptr_rend ( ) const
inline

◆ push_back() [1/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
void Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::push_back ( const_reference  x)
inline

◆ push_back() [2/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
void Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::push_back ( TPointerType  x)
inline

◆ rbegin() [1/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
reverse_iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::rbegin ( )
inline

◆ rbegin() [2/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
const_reverse_iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::rbegin ( ) const
inline

◆ rend() [1/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
reverse_iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::rend ( )
inline

◆ rend() [2/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
const_reverse_iterator Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::rend ( ) const
inline

◆ reserve()

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
void Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::reserve ( int  dim)
inline

◆ resize() [1/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
void Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::resize ( size_type  new_dim)
inline

◆ resize() [2/2]

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
void Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::resize ( size_type  new_dim) const
inline

◆ size()

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
size_type Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::size ( ) const
inline

◆ swap()

template<class TDataType , class TPointerType = typename TDataType::WeakPointer, class TContainerType = std::vector<TPointerType>>
void Kratos::WeakPointerVector< TDataType, TPointerType, TContainerType >::swap ( WeakPointerVector< TDataType, TPointerType, TContainerType > &  rOther)
inline

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