]> https://gitweb.dealii.org/ - dealii.git/commitdiff
SmartPointer removed
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Fri, 4 Sep 1998 11:37:29 +0000 (11:37 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Fri, 4 Sep 1998 11:37:29 +0000 (11:37 +0000)
git-svn-id: https://svn.dealii.org/trunk@558 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/subscriptor.h

index 85efd8744010878bfa941aef4a2e9a56dd567401..e2c4482f3d976373d0acc8663c9137e4be632977 100644 (file)
@@ -5,9 +5,9 @@
 /*----------------------------   subscriptor.h     ---------------------------*/
 
 
-
+#ifndef __exceptions_H
 #include <base/exceptions.h>
-
+#endif
 
 
 /**
@@ -102,7 +102,10 @@ class Subscriptor
 
 
 /**
- * Smart references avoid destruction of a referenced object.
+ * Smart references avoid destruction of a referenced object.  This
+ * class has not been fully developed, since the compiler could not
+ * resolve the dot operator in a convenient manner. The use of
+ * #SmartPointer# is recommended, instead.
  */
 template<class T>
 class SmartReference
@@ -139,73 +142,6 @@ class SmartReference
 
 
 
-/**
- * Smart pointers avoid destruction of an object in use. They can be used just
- * like a pointer (i.e. using the #*# and #-># operators and through casting)
- * but make sure that the object pointed to is not deleted in the course of
- * use of the pointer by signalling the pointee its use. This is done using
- * the #Subscriptor# class, which handles a use count and refuses destruction
- * as long as a smart pointer or reference uses that object.
- */
-template<class T>
-class SmartPointer
-{
-    T* t;
-
-  public:
-                                    /**
-                                     * Constructor taking a normal pointer.
-                                     */
-    SmartPointer(T* tt)
-                   : t(tt) 
-      {
-       t->subscribe();
-      }
-
-                                    /**
-                                     * Destructor, removing the subscription.
-                                     */
-    ~SmartPointer()
-      {
-       t->unsubscribe();
-      }
-                                  /**
-                                   * Assignment operator. Change of
-                                   * subscription is necessary.
-                                   */
-  SmartPointer<T>& operator=(T* tt)
-      {
-       t->unsubscribe();
-       t = tt;
-       tt->subscribe();
-      }
-  
-
-                                    /**
-                                     * Conversion to normal pointer.
-                                     */
-    operator T* () const
-      {
-       return t;
-      }
-
-                                    /**
-                                     * Dereferencing operator.
-                                     */
-    T& operator* () const
-      {
-       return *t;
-      }
-
-                                    /**
-                                     * Dereferencing operator.
-                                     */
-    T* operator -> () const
-      {
-       return t;
-      }
-};
-
 
 
 

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.