Dune Core Modules (2.5.2)

Dune::base_array< B, A > Class Template Reference

This container extends base_array_unmanaged by memory management with the usual copy semantics providing the full range of copy constructor, destructor and assignment operators. More...

#include <dune/istl/basearray.hh>

Public Types

typedef B member_type
 export the type representing the components
 
typedef A allocator_type
 export the allocator type
 
typedef base_array_unmanaged< B, A >::iterator iterator
 make iterators available as types
 
typedef base_array_unmanaged< B, A >::const_iterator const_iterator
 make iterators available as types
 
typedef base_array_unmanaged< B, A >::size_type size_type
 The type used for the index access.
 
typedef A::difference_type difference_type
 The type used for the difference between two iterator positions.
 

Public Member Functions

 base_array ()
 makes empty array
 
 base_array (size_type _n)
 make array with _n components
 
 base_array (const base_array &a)
 copy constructor
 
 ~base_array ()
 free dynamic memory
 
void resize (size_type _n)
 reallocate array to given size, any data is lost
 
base_arrayoperator= (const base_array &a)
 assignment
 
B & operator[] (size_type i)
 random access to blocks
 
const B & operator[] (size_type i) const
 same for read only access
 
iterator begin ()
 begin iterator
 
const_iterator begin () const
 begin const_iterator
 
iterator end ()
 end iterator
 
const_iterator end () const
 end const_iterator
 
iterator beforeEnd ()
 
const_iterator beforeEnd () const
 
iterator beforeBegin ()
 
const_iterator beforeBegin () const
 
iterator find (size_type i)
 random access returning iterator (end if not contained)
 
const_iterator find (size_type i) const
 random access returning iterator (end if not contained)
 
size_type size () const
 number of blocks in the array (are of size 1 here)
 

Detailed Description

template<class B, class A = std::allocator<B>>
class Dune::base_array< B, A >

This container extends base_array_unmanaged by memory management with the usual copy semantics providing the full range of copy constructor, destructor and assignment operators.

You can make
  • empty array
  • array with n components dynamically allocated
  • resize an array with complete loss of data
  • assign/construct from a base_array_window to make a copy of the data

    Error checking: no error checking is provided normally. Setting the compile time switch DUNE_ISTL_WITH_CHECKING enables error checking.

This class is an implementation detail, and should not be used outside of dune-istl.

Member Function Documentation

◆ beforeBegin() [1/2]

iterator Dune::base_array_unmanaged< B, std::allocator< B > >::beforeBegin ( )
inlineinherited
Returns
an iterator that is positioned before the first entry of the vector.

◆ beforeBegin() [2/2]

const_iterator Dune::base_array_unmanaged< B, std::allocator< B > >::beforeBegin ( ) const
inlineinherited
Returns
an iterator that is positioned before the first entry of the vector.

◆ beforeEnd() [1/2]

iterator Dune::base_array_unmanaged< B, std::allocator< B > >::beforeEnd ( )
inlineinherited
Returns
an iterator that is positioned before the end iterator of the vector, i.e. at the last entry.

◆ beforeEnd() [2/2]

const_iterator Dune::base_array_unmanaged< B, std::allocator< B > >::beforeEnd ( ) const
inlineinherited
Returns
an iterator that is positioned before the end iterator of the vector. i.e. at the last element.

The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (May 2, 22:35, 2024)