* Declaration of the general template of a structure which is used to
* determine some types based on the template arguments of other classes.
*/
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
struct Types
{
};
*
* @author Wolfgang Bangerth, 2001
*/
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
class Iterator :
public std::iterator<std::random_access_iterator_tag,
- typename Types<BlockVectorType,constness>::value_type>
+ typename Types<BlockVectorType,Constness>::value_type>
{
private:
/**
* number.
*/
typedef
- typename Types<BlockVectorType,constness>::value_type
+ typename Types<BlockVectorType,Constness>::value_type
value_type;
/**
typedef value_type *pointer;
typedef
- typename Types<BlockVectorType,constness>::dereference_type
+ typename Types<BlockVectorType,Constness>::dereference_type
dereference_type;
/**
* depending on the second template parameter).
*/
typedef
- typename Types<BlockVectorType,constness>::BlockVector
+ typename Types<BlockVectorType,Constness>::BlockVector
BlockVector;
/**
* Construct an iterator from a vector to which we point and the global
* index of the element pointed to.
*
- * Depending on the value of the <tt>constness</tt> template argument of
+ * Depending on the value of the <tt>Constness</tt> template argument of
* this class, the first argument of this constructor is either is a
* const or non-const reference.
*/
/**
* Copy constructor.
*/
- Iterator (const Iterator<BlockVectorType,constness> &c);
+ Iterator (const Iterator<BlockVectorType,Constness> &c);
/**
* Copy constructor for conversion between iterators with different
Iterator &operator = (const Iterator &c);
/**
- * Dereferencing operator. If the template argument <tt>constness</tt>
+ * Dereferencing operator. If the template argument <tt>Constness</tt>
* is <tt>true</tt>, then no writing to the result is possible, making
* this a const_iterator.
*/
private:
/**
* Pointer to the block vector object to which this iterator points.
- * Depending on the value of the <tt>constness</tt> template argument of
+ * Depending on the value of the <tt>Constness</tt> template argument of
* this class, this is a <tt>const</tt> or non-<tt>const</tt> pointer.
*/
BlockVector *parent;
namespace BlockVectorIterators
{
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
- Iterator<BlockVectorType,constness>::
- Iterator (const Iterator<BlockVectorType,constness> &c)
+ Iterator<BlockVectorType,Constness>::
+ Iterator (const Iterator<BlockVectorType,Constness> &c)
:
parent (c.parent),
global_index (c.global_index),
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
- Iterator<BlockVectorType,constness>::
+ Iterator<BlockVectorType,Constness>::
Iterator (const InverseConstnessIterator &c)
:
parent (const_cast<BlockVectorType *>(c.parent)),
next_break_forward (c.next_break_forward),
next_break_backward (c.next_break_backward)
{
- // if constness==false, then the
// constness of the iterator we
+ // if Constness==false, then the
// got is true and we are trying
// to cast away the
// constness. disallow this
- Assert (constness==true, ExcCastingAwayConstness());
+ Assert (Constness==true, ExcCastingAwayConstness());
}
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
- Iterator<BlockVectorType,constness>::
+ Iterator<BlockVectorType,Constness>::
Iterator (BlockVector &parent,
const size_type global_index,
const size_type current_block,
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
- Iterator<BlockVectorType,constness> &
- Iterator<BlockVectorType,constness>::
+ Iterator<BlockVectorType,Constness> &
+ Iterator<BlockVectorType,Constness>::
operator = (const Iterator &c)
{
parent = c.parent;
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
- typename Iterator<BlockVectorType,constness>::dereference_type
- Iterator<BlockVectorType,constness>::operator * () const
+ typename Iterator<BlockVectorType,Constness>::dereference_type
+ Iterator<BlockVectorType,Constness>::operator * () const
{
return parent->block(current_block)(index_within_block);
}
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
- typename Iterator<BlockVectorType,constness>::dereference_type
- Iterator<BlockVectorType,constness>::operator [] (const difference_type d) const
+ typename Iterator<BlockVectorType,Constness>::dereference_type
+ Iterator<BlockVectorType,Constness>::operator [] (const difference_type d) const
{
// if the index pointed to is
// still within the block we
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
- Iterator<BlockVectorType,constness> &
- Iterator<BlockVectorType,constness>::operator ++ ()
+ Iterator<BlockVectorType,Constness> &
+ Iterator<BlockVectorType,Constness>::operator ++ ()
{
move_forward ();
return *this;
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
- Iterator<BlockVectorType,constness>
- Iterator<BlockVectorType,constness>::operator ++ (int)
+ Iterator<BlockVectorType,Constness>
+ Iterator<BlockVectorType,Constness>::operator ++ (int)
{
const Iterator old_value = *this;
move_forward ();
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
- Iterator<BlockVectorType,constness> &
- Iterator<BlockVectorType,constness>::operator -- ()
+ Iterator<BlockVectorType,Constness> &
+ Iterator<BlockVectorType,Constness>::operator -- ()
{
move_backward ();
return *this;
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
- Iterator<BlockVectorType,constness>
- Iterator<BlockVectorType,constness>::operator -- (int)
+ Iterator<BlockVectorType,Constness>
+ Iterator<BlockVectorType,Constness>::operator -- (int)
{
const Iterator old_value = *this;
move_backward ();
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
bool
- Iterator<BlockVectorType,constness>::
+ Iterator<BlockVectorType,Constness>::
operator == (const Iterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
bool
- Iterator<BlockVectorType,constness>::
+ Iterator<BlockVectorType,Constness>::
operator == (const InverseConstnessIterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
bool
- Iterator<BlockVectorType,constness>::
+ Iterator<BlockVectorType,Constness>::
operator != (const Iterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
bool
- Iterator<BlockVectorType,constness>::
+ Iterator<BlockVectorType,Constness>::
operator != (const InverseConstnessIterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
bool
- Iterator<BlockVectorType,constness>::
+ Iterator<BlockVectorType,Constness>::
operator < (const Iterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
bool
- Iterator<BlockVectorType,constness>::
+ Iterator<BlockVectorType,Constness>::
operator < (const InverseConstnessIterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
bool
- Iterator<BlockVectorType,constness>::
+ Iterator<BlockVectorType,Constness>::
operator <= (const Iterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
bool
- Iterator<BlockVectorType,constness>::
+ Iterator<BlockVectorType,Constness>::
operator <= (const InverseConstnessIterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
bool
- Iterator<BlockVectorType,constness>::
+ Iterator<BlockVectorType,Constness>::
operator > (const Iterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
bool
- Iterator<BlockVectorType,constness>::
+ Iterator<BlockVectorType,Constness>::
operator > (const InverseConstnessIterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
bool
- Iterator<BlockVectorType,constness>::
+ Iterator<BlockVectorType,Constness>::
operator >= (const Iterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
bool
- Iterator<BlockVectorType,constness>::
+ Iterator<BlockVectorType,Constness>::
operator >= (const InverseConstnessIterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
- typename Iterator<BlockVectorType,constness>::difference_type
- Iterator<BlockVectorType,constness>::
+ typename Iterator<BlockVectorType,Constness>::difference_type
+ Iterator<BlockVectorType,Constness>::
operator - (const Iterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
- typename Iterator<BlockVectorType,constness>::difference_type
- Iterator<BlockVectorType,constness>::
+ typename Iterator<BlockVectorType,Constness>::difference_type
+ Iterator<BlockVectorType,Constness>::
operator - (const InverseConstnessIterator &i) const
{
Assert (parent == i.parent, ExcPointerToDifferentVectors());
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
- Iterator<BlockVectorType,constness>
- Iterator<BlockVectorType,constness>::
+ Iterator<BlockVectorType,Constness>
+ Iterator<BlockVectorType,Constness>::
operator + (const difference_type &d) const
{
// if the index pointed to is
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
- Iterator<BlockVectorType,constness>
- Iterator<BlockVectorType,constness>::
+ Iterator<BlockVectorType,Constness>
+ Iterator<BlockVectorType,Constness>::
operator - (const difference_type &d) const
{
// if the index pointed to is
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
- Iterator<BlockVectorType,constness> &
- Iterator<BlockVectorType,constness>::
+ Iterator<BlockVectorType,Constness> &
+ Iterator<BlockVectorType,Constness>::
operator += (const difference_type &d)
{
// if the index pointed to is
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
inline
- Iterator<BlockVectorType,constness> &
- Iterator<BlockVectorType,constness>::
+ Iterator<BlockVectorType,Constness> &
+ Iterator<BlockVectorType,Constness>::
operator -= (const difference_type &d)
{
// if the index pointed to is
}
- template <class BlockVectorType, bool constness>
- Iterator<BlockVectorType,constness>::
+ template <class BlockVectorType, bool Constness>
+ Iterator<BlockVectorType,Constness>::
Iterator (BlockVector &parent,
const size_type global_index)
:
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
void
- Iterator<BlockVectorType,constness>::move_forward ()
+ Iterator<BlockVectorType,Constness>::move_forward ()
{
if (global_index != next_break_forward)
++index_within_block;
- template <class BlockVectorType, bool constness>
+ template <class BlockVectorType, bool Constness>
void
- Iterator<BlockVectorType,constness>::move_backward ()
+ Iterator<BlockVectorType,Constness>::move_backward ()
{
if (global_index != next_break_backward)
--index_within_block;