From: Wolfgang Bangerth Date: Wed, 29 Apr 1998 12:07:55 +0000 (+0000) Subject: Doc update and security check. X-Git-Tag: v8.0.0~23032 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef99176efa16640a8b9fbfbd079d87eb042940f0;p=dealii.git Doc update and security check. git-svn-id: https://svn.dealii.org/trunk@222 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/dofs/dof_accessor.h b/deal.II/deal.II/include/dofs/dof_accessor.h index ea259bf1e4..2b2679072c 100644 --- a/deal.II/deal.II/include/dofs/dof_accessor.h +++ b/deal.II/deal.II/include/dofs/dof_accessor.h @@ -17,6 +17,25 @@ class dVector; /** Define the basis for accessors to the degrees of freedom. + + Note that it is allowed to construct an object of which the + #dof_handler# pointer is a Null pointer. Such an object would + result in a strange kind of behaviour, though every reasonable + operating system should disallow access through that pointer. + The reason we do not check for the null pointer in the + constructor which gets passed the #DoFHandler# pointer is that + if we did we could not make dof iterators member of other classes + (like in the #FEValues# class) if we did not know about the + #DoFHandler# object to be used upon construction of that object. + Through the way this class is implemented here, we allow the + creation of a kind of virgin object which only gets useful if + assigned to from another object before first usage. + + Opposite to construction, it is not possible to copy an object + which has an invalid dof handler pointer. This is to guarantee + that every iterator which is once assigned to is a valid + object. However, this assertion only holds in debug mode, when + the #Assert# macro is switched on. */ template class DoFAccessor { @@ -38,8 +57,17 @@ class DoFAccessor { * Reset the DoF handler pointer. */ void set_dof_handler (DoFHandler *dh) { + Assert (dh != 0, ExcInvalidObject()); dof_handler = dh; }; + + /** + * Copy operator. + */ + DoFAccessor & operator = (const DoFAccessor &da) { + set_dof_handler (da.dof_handler); + return *this; + }; /** * Exception for child classes diff --git a/deal.II/deal.II/source/dofs/dof_accessor.cc b/deal.II/deal.II/source/dofs/dof_accessor.cc index ca220cae1a..d64c873881 100644 --- a/deal.II/deal.II/source/dofs/dof_accessor.cc +++ b/deal.II/deal.II/source/dofs/dof_accessor.cc @@ -268,14 +268,13 @@ DoFQuadAccessor::child (const unsigned int i) const { template void DoFQuadAccessor::copy_from (const DoFQuadAccessor &a) { - Assert (a.dof_handler != 0, ExcInvalidObject()); - BaseClass::copy_from (a); set_dof_handler (a.dof_handler); }; + /*------------------------- Functions: DoFCellAccessor -----------------------*/ template