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::PointerVector< TDataType, TPointerType, TContainerType > Class Template Referencefinal

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

#include <pointer_vector.h>

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

Public Member Functions

Life Cycle
 PointerVector ()
 Default constructor. More...
 
template<class TInputIteratorType >
 PointerVector (TInputIteratorType First, TInputIteratorType Last)
 
 PointerVector (const PointerVector &rOther)
 
 PointerVector (const TContainerType &rContainer)
 
 PointerVector (std::size_t NewSize)
 
 ~PointerVector ()
 Destructor. More...
 
Operators
PointerVectoroperator= (const PointerVector &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 PointerVector &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
 
size_type max_size () const
 
void swap (PointerVector &rOther)
 
void push_back (const TPointerType &x)
 
void push_back (TPointerType &&rX)
 
template<class... Args>
void emplace_back (Args &&... args)
 
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 resize (size_type dim)
 
void reserve (size_type 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 TDataType value_type
 
typedef TPointerType pointer
 
typedef const TPointerType const_pointer
 
typedef TDataType & reference
 
typedef const TDataType & const_reference
 
typedef TContainerType ContainerType
 
typedef boost::indirect_iterator< typename TContainerType::iterator > iterator
 
typedef boost::indirect_iterator< typename TContainerType::const_iterator > const_iterator
 
typedef boost::indirect_iterator< typename TContainerType::reverse_iterator > reverse_iterator
 
typedef boost::indirect_iterator< typename TContainerType::const_reverse_iterator > 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
 
typedef TContainerType::difference_type difference_type
 
 KRATOS_CLASS_POINTER_DEFINITION (PointerVector)
 Pointer definition of PointerVector. More...
 

Serialization

class Serializer
 

Detailed Description

template<class TDataType, class TPointerType = typename TDataType::Pointer, class TContainerType = std::vector<TPointerType>>
class Kratos::PointerVector< TDataType, TPointerType, TContainerType >

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

PointerVector 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::Pointer, class TContainerType = std::vector<TPointerType>>
typedef boost::indirect_iterator<typename TContainerType::const_iterator> Kratos::PointerVector< TDataType, TPointerType, TContainerType >::const_iterator

◆ const_pointer

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

◆ const_reference

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

◆ const_reverse_iterator

template<class TDataType , class TPointerType = typename TDataType::Pointer, class TContainerType = std::vector<TPointerType>>
typedef boost::indirect_iterator<typename TContainerType::const_reverse_iterator> Kratos::PointerVector< TDataType, TPointerType, TContainerType >::const_reverse_iterator

◆ ContainerType

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

◆ data_type

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

data type stores in this container.

◆ difference_type

template<class TDataType , class TPointerType = typename TDataType::Pointer, class TContainerType = std::vector<TPointerType>>
typedef TContainerType::difference_type Kratos::PointerVector< TDataType, TPointerType, TContainerType >::difference_type

◆ iterator

template<class TDataType , class TPointerType = typename TDataType::Pointer, class TContainerType = std::vector<TPointerType>>
typedef boost::indirect_iterator<typename TContainerType::iterator> Kratos::PointerVector< TDataType, TPointerType, TContainerType >::iterator

◆ pointer

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

◆ ptr_const_iterator

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

◆ ptr_const_reverse_iterator

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

◆ ptr_iterator

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

◆ ptr_reverse_iterator

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

◆ reference

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

◆ reverse_iterator

template<class TDataType , class TPointerType = typename TDataType::Pointer, class TContainerType = std::vector<TPointerType>>
typedef boost::indirect_iterator<typename TContainerType::reverse_iterator> Kratos::PointerVector< TDataType, TPointerType, TContainerType >::reverse_iterator

◆ size_type

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

◆ value_type

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

Constructor & Destructor Documentation

◆ PointerVector() [1/5]

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

Default constructor.

◆ PointerVector() [2/5]

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

◆ PointerVector() [3/5]

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

◆ PointerVector() [4/5]

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

◆ PointerVector() [5/5]

template<class TDataType , class TPointerType = typename TDataType::Pointer, class TContainerType = std::vector<TPointerType>>
Kratos::PointerVector< TDataType, TPointerType, TContainerType >::PointerVector ( std::size_t  NewSize)
inlineexplicit

◆ ~PointerVector()

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

Destructor.

Member Function Documentation

◆ back() [1/2]

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

◆ back() [2/2]

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

◆ begin() [1/2]

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

◆ begin() [2/2]

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

◆ capacity()

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

◆ clear()

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

◆ emplace_back()

template<class TDataType , class TPointerType = typename TDataType::Pointer, class TContainerType = std::vector<TPointerType>>
template<class... Args>
void Kratos::PointerVector< TDataType, TPointerType, TContainerType >::emplace_back ( Args &&...  args)
inline

◆ empty()

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

◆ end() [1/2]

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

◆ end() [2/2]

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

◆ erase() [1/2]

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

◆ erase() [2/2]

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

◆ front() [1/2]

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

◆ front() [2/2]

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

◆ GetContainer() [1/2]

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

Gives a reference to underly normal container.

◆ GetContainer() [2/2]

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

Gives a constant reference to underly normal container.

◆ Info()

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

Turn back information as a string.

◆ insert() [1/2]

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

◆ insert() [2/2]

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

◆ KRATOS_CLASS_POINTER_DEFINITION()

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

Pointer definition of PointerVector.

◆ max_size()

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

◆ operator()() [1/2]

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

◆ operator()() [2/2]

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

◆ operator=()

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

◆ operator==()

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

◆ operator[]() [1/2]

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

◆ operator[]() [2/2]

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

◆ PrintData()

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

Print object's data.

◆ PrintInfo()

template<class TDataType , class TPointerType = typename TDataType::Pointer, class TContainerType = std::vector<TPointerType>>
void Kratos::PointerVector< 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::Pointer, class TContainerType = std::vector<TPointerType>>
ptr_iterator Kratos::PointerVector< TDataType, TPointerType, TContainerType >::ptr_begin ( )
inline

◆ ptr_begin() [2/2]

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

◆ ptr_end() [1/2]

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

◆ ptr_end() [2/2]

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

◆ ptr_rbegin() [1/2]

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

◆ ptr_rbegin() [2/2]

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

◆ ptr_rend() [1/2]

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

◆ ptr_rend() [2/2]

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

◆ push_back() [1/2]

template<class TDataType , class TPointerType = typename TDataType::Pointer, class TContainerType = std::vector<TPointerType>>
void Kratos::PointerVector< TDataType, TPointerType, TContainerType >::push_back ( const TPointerType &  x)
inline

◆ push_back() [2/2]

template<class TDataType , class TPointerType = typename TDataType::Pointer, class TContainerType = std::vector<TPointerType>>
void Kratos::PointerVector< TDataType, TPointerType, TContainerType >::push_back ( TPointerType &&  rX)
inline

◆ rbegin() [1/2]

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

◆ rbegin() [2/2]

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

◆ rend() [1/2]

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

◆ rend() [2/2]

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

◆ reserve()

template<class TDataType , class TPointerType = typename TDataType::Pointer, class TContainerType = std::vector<TPointerType>>
void Kratos::PointerVector< TDataType, TPointerType, TContainerType >::reserve ( size_type  dim)
inline

◆ resize()

template<class TDataType , class TPointerType = typename TDataType::Pointer, class TContainerType = std::vector<TPointerType>>
void Kratos::PointerVector< TDataType, TPointerType, TContainerType >::resize ( size_type  dim)
inline

◆ size()

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

◆ swap()

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

Friends And Related Function Documentation

◆ Serializer

template<class TDataType , class TPointerType = typename TDataType::Pointer, class TContainerType = std::vector<TPointerType>>
friend class Serializer
friend

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