lemon/path.h
changeset 964 7fdaa05a69a1
parent 877 141f9c0db4a3
parent 957 7440937d154b
     1.1 --- a/lemon/path.h	Wed Sep 12 17:25:48 2012 +0200
     1.2 +++ b/lemon/path.h	Thu Sep 13 11:56:19 2012 +0200
     1.3 @@ -64,6 +64,12 @@
     1.4      /// Default constructor
     1.5      Path() {}
     1.6  
     1.7 +    /// \brief Copy constructor
     1.8 +    ///
     1.9 +    Path(const Path& cpath) {
    1.10 +      pathCopy(cpath, *this);
    1.11 +    }
    1.12 +
    1.13      /// \brief Template copy constructor
    1.14      ///
    1.15      /// This constuctor initializes the path from any other path type.
    1.16 @@ -73,6 +79,13 @@
    1.17        pathCopy(cpath, *this);
    1.18      }
    1.19  
    1.20 +    /// \brief Copy assignment
    1.21 +    ///
    1.22 +    Path& operator=(const Path& cpath) {
    1.23 +      pathCopy(cpath, *this);
    1.24 +      return *this;
    1.25 +    }
    1.26 +
    1.27      /// \brief Template copy assignment
    1.28      ///
    1.29      /// This operator makes a copy of a path of any other type.
    1.30 @@ -252,6 +265,12 @@
    1.31      /// Default constructor
    1.32      SimplePath() {}
    1.33  
    1.34 +    /// \brief Copy constructor
    1.35 +    ///
    1.36 +    SimplePath(const SimplePath& cpath) {
    1.37 +      pathCopy(cpath, *this);
    1.38 +    }
    1.39 +
    1.40      /// \brief Template copy constructor
    1.41      ///
    1.42      /// This path can be initialized with any other path type. It just
    1.43 @@ -261,6 +280,13 @@
    1.44        pathCopy(cpath, *this);
    1.45      }
    1.46  
    1.47 +    /// \brief Copy assignment
    1.48 +    ///
    1.49 +    SimplePath& operator=(const SimplePath& cpath) {
    1.50 +      pathCopy(cpath, *this);
    1.51 +      return *this;
    1.52 +    }
    1.53 +
    1.54      /// \brief Template copy assignment
    1.55      ///
    1.56      /// This path can be initialized with any other path type. It just
    1.57 @@ -431,6 +457,12 @@
    1.58      /// Default constructor
    1.59      ListPath() : first(0), last(0) {}
    1.60  
    1.61 +    /// \brief Copy constructor
    1.62 +    ///
    1.63 +    ListPath(const ListPath& cpath) : first(0), last(0) {
    1.64 +      pathCopy(cpath, *this);
    1.65 +    }
    1.66 +
    1.67      /// \brief Template copy constructor
    1.68      ///
    1.69      /// This path can be initialized with any other path type. It just
    1.70 @@ -447,6 +479,13 @@
    1.71        clear();
    1.72      }
    1.73  
    1.74 +    /// \brief Copy assignment
    1.75 +    ///
    1.76 +    ListPath& operator=(const ListPath& cpath) {
    1.77 +      pathCopy(cpath, *this);
    1.78 +      return *this;
    1.79 +    }
    1.80 +
    1.81      /// \brief Template copy assignment
    1.82      ///
    1.83      /// This path can be initialized with any other path type. It just
    1.84 @@ -758,6 +797,12 @@
    1.85      /// Default constructor
    1.86      StaticPath() : len(0), arcs(0) {}
    1.87  
    1.88 +    /// \brief Copy constructor
    1.89 +    ///
    1.90 +    StaticPath(const StaticPath& cpath) : arcs(0) {
    1.91 +      pathCopy(cpath, *this);
    1.92 +    }
    1.93 +
    1.94      /// \brief Template copy constructor
    1.95      ///
    1.96      /// This path can be initialized from any other path type.
    1.97 @@ -773,6 +818,13 @@
    1.98        if (arcs) delete[] arcs;
    1.99      }
   1.100  
   1.101 +    /// \brief Copy assignment
   1.102 +    ///
   1.103 +    StaticPath& operator=(const StaticPath& cpath) {
   1.104 +      pathCopy(cpath, *this);
   1.105 +      return *this;
   1.106 +    }
   1.107 +
   1.108      /// \brief Template copy assignment
   1.109      ///
   1.110      /// This path can be made equal to any other path type. It simply