template <int dim> class DoFObjectAccessor<2, dim>;
template <int dim> class DoFObjectAccessor<3, dim>;
+template <int dim, typename Accessor> class TriaRawIterator;
* @ingroup Exceptions
*/
DeclException0 (ExcNotActive);
+ /**
+ * Exception
+ *
+ * @ingroup Exceptions
+ */
+ DeclException0 (ExcCantCompareIterators);
+
+ protected:
+ /**
+ * Compare for equality.
+ */
+ bool operator == (const DoFAccessor &) const;
+
+ /**
+ * Compare for inequality.
+ */
+ bool operator != (const DoFAccessor &) const;
protected:
/**
* Store the address of the DoFHandler object
* to be accessed.
*/
- DoFHandler<dim> *dof_handler;
+ DoFHandler<dim> *dof_handler;
};
* for the iterator classes.
*/
void copy_from (const DoFObjectAccessor<celldim, dim> &a);
+
+ protected:
+ /**
+ * Compare for equality.
+ */
+ bool operator == (const DoFObjectAccessor &) const;
+
+ /**
+ * Compare for inequality.
+ */
+ bool operator != (const DoFObjectAccessor &) const;
+
+
+ /**
+ * Iterator classes need to be friends
+ * because they need to access operator==
+ * and operator!=.
+ */
+ template <int, typename> friend class TriaRawIterator;
};
* for the iterator classes.
*/
void copy_from (const DoFObjectAccessor<1,dim> &a);
+
+ protected:
+ /**
+ * Compare for equality.
+ */
+ bool operator == (const DoFObjectAccessor<1,dim> &) const;
+
+ /**
+ * Compare for inequality.
+ */
+ bool operator != (const DoFObjectAccessor<1,dim> &) const;
+
+
+ /**
+ * Iterator classes need to be friends
+ * because they need to access operator==
+ * and operator!=.
+ */
+ template <int, typename> friend class TriaRawIterator;
};
* for the iterator classes.
*/
void copy_from (const DoFObjectAccessor<2, dim> &a);
+
+ protected:
+ /**
+ * Compare for equality.
+ */
+ bool operator == (const DoFObjectAccessor<2,dim> &) const;
+
+ /**
+ * Compare for inequality.
+ */
+ bool operator != (const DoFObjectAccessor<2,dim> &) const;
+
+
+ /**
+ * Iterator classes need to be friends
+ * because they need to access operator==
+ * and operator!=.
+ */
+ template <int, typename> friend class TriaRawIterator;
};
* for the iterator classes.
*/
void copy_from (const DoFObjectAccessor<3, dim> &a);
+
+ protected:
+ /**
+ * Compare for equality.
+ */
+ bool operator == (const DoFObjectAccessor<3,dim> &) const;
+
+ /**
+ * Compare for inequality.
+ */
+ bool operator != (const DoFObjectAccessor<3,dim> &) const;
+
+
+ /**
+ * Iterator classes need to be friends
+ * because they need to access operator==
+ * and operator!=.
+ */
+ template <int, typename> friend class TriaRawIterator;
};
+template <int dim>
+inline
+bool
+DoFAccessor<dim>::operator == (const DoFAccessor<dim> &a) const
+{
+ Assert (dof_handler == a.dof_handler, ExcCantCompareIterators());
+
+ // there is no real data to compare, except
+ // to make sure that the dof_handler
+ // objects in use are the same
+ return true;
+}
+
+
+
+template <int dim>
+inline
+bool
+DoFAccessor<dim>::operator != (const DoFAccessor<dim> &a) const
+{
+ Assert (dof_handler == a.dof_handler, ExcCantCompareIterators());
+
+ // there is no real data to compare, except
+ // to make sure that the dof_handler
+ // objects in use are the same. this is
+ // checked above, and apart from this there
+ // is no reason for us to believe that the
+ // two accessors are different
+ return false;
+}
+
+
+
/*------------------------- Functions: DoFObjectAccessor<1,dim> -----------------------*/
}
+
+template <int dim>
+inline
+bool
+DoFObjectAccessor<1,dim>::operator == (const DoFObjectAccessor<1,dim> &a) const
+{
+ return (TriaObjectAccessor<1,dim>::operator == (a)
+ &&
+ DoFAccessor<dim>::operator == (a));
+}
+
+
+template <int dim>
+inline
+bool
+DoFObjectAccessor<1,dim>::operator != (const DoFObjectAccessor<1,dim> &a) const
+{
+ return (TriaObjectAccessor<1,dim>::operator != (a)
+ ||
+ DoFAccessor<dim>::operator != (a));
+}
+
+
/*------------------------- Functions: DoFObjectAccessor<2,dim> -----------------------*/
template <int dim>
}
+
+template <int dim>
+inline
+bool
+DoFObjectAccessor<2,dim>::operator == (const DoFObjectAccessor<2,dim> &a) const
+{
+ return (TriaObjectAccessor<2,dim>::operator == (a)
+ &&
+ DoFAccessor<dim>::operator == (a));
+}
+
+
+template <int dim>
+inline
+bool
+DoFObjectAccessor<2,dim>::operator != (const DoFObjectAccessor<2,dim> &a) const
+{
+ return (TriaObjectAccessor<2,dim>::operator != (a)
+ ||
+ DoFAccessor<dim>::operator != (a));
+}
+
+
+
/*------------------------- Functions: DoFObjectAccessor<3,dim> -----------------------*/
}
+
+template <int dim>
+inline
+bool
+DoFObjectAccessor<3,dim>::operator == (const DoFObjectAccessor<3,dim> &a) const
+{
+ return (TriaObjectAccessor<3,dim>::operator == (a)
+ &&
+ DoFAccessor<dim>::operator == (a));
+}
+
+
+template <int dim>
+inline
+bool
+DoFObjectAccessor<3,dim>::operator != (const DoFObjectAccessor<3,dim> &a) const
+{
+ return (TriaObjectAccessor<3,dim>::operator != (a)
+ ||
+ DoFAccessor<dim>::operator != (a));
+}
+
+
/*------------------------- Functions: DoFCellAccessor -----------------------*/