]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Rename and deprecate MGLevelObject::clear()
authorJonathan Robey <class4kayaker@gmail.com>
Fri, 5 Aug 2016 22:59:34 +0000 (15:59 -0700)
committerJonathan Robey <class4kayaker@gmail.com>
Fri, 5 Aug 2016 22:59:34 +0000 (15:59 -0700)
include/deal.II/base/mg_level_object.h

index 71058f9a47866627b120ac8b651ee70946ccbf38..7fcbb840c9795ed51cf408531462a89512753153 100644 (file)
@@ -105,6 +105,18 @@ public:
    */
   MGLevelObject<Object> &operator = (const double d);
 
+  /**
+   * Call @p clear on all objects stored by this object. This function
+   * is only implemented for some @p Object classes, e.g., matrix
+   * types or the PreconditionBlockSOR and similar classes. Using this
+   * function will fail with a compiler error if the @p Object
+   * template type to this class does not provide a
+   * <code>clear()</code> member function.
+   *
+   * @deprecated Use clear_elements () instead
+   */
+  void clear() DEAL_II_DEPRECATED;
+
   /**
    * Call @p clear on all objects stored by this object. This function
    * is only implemented for some @p Object classes, e.g., matrix
@@ -113,7 +125,7 @@ public:
    * template type to this class does not provide a
    * <code>clear()</code> member function.
    */
-  void clear();
+  void clear_elements();
 
   /**
    * The coarsest level for which this class stores a level object.
@@ -207,7 +219,16 @@ MGLevelObject<Object>::operator = (const double d)
 
 template<class Object>
 void
-MGLevelObject<Object>::clear ()
+MGLevelObject<Object>::clear () // DEPRECATED
+{
+  // Avoid code duplication in deprecated call by calling replacing function
+  clear_elements();
+}
+
+
+template<class Object>
+void
+MGLevelObject<Object>::clear_elements ()
 {
   typename std::vector<std_cxx11::shared_ptr<Object> >::iterator v;
   for (v = objects.begin(); v != objects.end(); ++v)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.