lemon/path.h
changeset 996 dd5b5d96b657
parent 877 141f9c0db4a3
parent 957 7440937d154b
equal deleted inserted replaced
20:058d12f101f5 22:5c305ecbdb4a
    62     /// \brief Default constructor
    62     /// \brief Default constructor
    63     ///
    63     ///
    64     /// Default constructor
    64     /// Default constructor
    65     Path() {}
    65     Path() {}
    66 
    66 
       
    67     /// \brief Copy constructor
       
    68     ///
       
    69     Path(const Path& cpath) {
       
    70       pathCopy(cpath, *this);
       
    71     }
       
    72 
    67     /// \brief Template copy constructor
    73     /// \brief Template copy constructor
    68     ///
    74     ///
    69     /// This constuctor initializes the path from any other path type.
    75     /// This constuctor initializes the path from any other path type.
    70     /// It simply makes a copy of the given path.
    76     /// It simply makes a copy of the given path.
    71     template <typename CPath>
    77     template <typename CPath>
    72     Path(const CPath& cpath) {
    78     Path(const CPath& cpath) {
    73       pathCopy(cpath, *this);
    79       pathCopy(cpath, *this);
       
    80     }
       
    81 
       
    82     /// \brief Copy assignment
       
    83     ///
       
    84     Path& operator=(const Path& cpath) {
       
    85       pathCopy(cpath, *this);
       
    86       return *this;
    74     }
    87     }
    75 
    88 
    76     /// \brief Template copy assignment
    89     /// \brief Template copy assignment
    77     ///
    90     ///
    78     /// This operator makes a copy of a path of any other type.
    91     /// This operator makes a copy of a path of any other type.
   250     /// \brief Default constructor
   263     /// \brief Default constructor
   251     ///
   264     ///
   252     /// Default constructor
   265     /// Default constructor
   253     SimplePath() {}
   266     SimplePath() {}
   254 
   267 
       
   268     /// \brief Copy constructor
       
   269     ///
       
   270     SimplePath(const SimplePath& cpath) {
       
   271       pathCopy(cpath, *this);
       
   272     }
       
   273 
   255     /// \brief Template copy constructor
   274     /// \brief Template copy constructor
   256     ///
   275     ///
   257     /// This path can be initialized with any other path type. It just
   276     /// This path can be initialized with any other path type. It just
   258     /// makes a copy of the given path.
   277     /// makes a copy of the given path.
   259     template <typename CPath>
   278     template <typename CPath>
   260     SimplePath(const CPath& cpath) {
   279     SimplePath(const CPath& cpath) {
   261       pathCopy(cpath, *this);
   280       pathCopy(cpath, *this);
       
   281     }
       
   282 
       
   283     /// \brief Copy assignment
       
   284     ///
       
   285     SimplePath& operator=(const SimplePath& cpath) {
       
   286       pathCopy(cpath, *this);
       
   287       return *this;
   262     }
   288     }
   263 
   289 
   264     /// \brief Template copy assignment
   290     /// \brief Template copy assignment
   265     ///
   291     ///
   266     /// This path can be initialized with any other path type. It just
   292     /// This path can be initialized with any other path type. It just
   429     /// \brief Default constructor
   455     /// \brief Default constructor
   430     ///
   456     ///
   431     /// Default constructor
   457     /// Default constructor
   432     ListPath() : first(0), last(0) {}
   458     ListPath() : first(0), last(0) {}
   433 
   459 
       
   460     /// \brief Copy constructor
       
   461     ///
       
   462     ListPath(const ListPath& cpath) : first(0), last(0) {
       
   463       pathCopy(cpath, *this);
       
   464     }
       
   465 
   434     /// \brief Template copy constructor
   466     /// \brief Template copy constructor
   435     ///
   467     ///
   436     /// This path can be initialized with any other path type. It just
   468     /// This path can be initialized with any other path type. It just
   437     /// makes a copy of the given path.
   469     /// makes a copy of the given path.
   438     template <typename CPath>
   470     template <typename CPath>
   443     /// \brief Destructor of the path
   475     /// \brief Destructor of the path
   444     ///
   476     ///
   445     /// Destructor of the path
   477     /// Destructor of the path
   446     ~ListPath() {
   478     ~ListPath() {
   447       clear();
   479       clear();
       
   480     }
       
   481 
       
   482     /// \brief Copy assignment
       
   483     ///
       
   484     ListPath& operator=(const ListPath& cpath) {
       
   485       pathCopy(cpath, *this);
       
   486       return *this;
   448     }
   487     }
   449 
   488 
   450     /// \brief Template copy assignment
   489     /// \brief Template copy assignment
   451     ///
   490     ///
   452     /// This path can be initialized with any other path type. It just
   491     /// This path can be initialized with any other path type. It just
   756     /// \brief Default constructor
   795     /// \brief Default constructor
   757     ///
   796     ///
   758     /// Default constructor
   797     /// Default constructor
   759     StaticPath() : len(0), arcs(0) {}
   798     StaticPath() : len(0), arcs(0) {}
   760 
   799 
       
   800     /// \brief Copy constructor
       
   801     ///
       
   802     StaticPath(const StaticPath& cpath) : arcs(0) {
       
   803       pathCopy(cpath, *this);
       
   804     }
       
   805 
   761     /// \brief Template copy constructor
   806     /// \brief Template copy constructor
   762     ///
   807     ///
   763     /// This path can be initialized from any other path type.
   808     /// This path can be initialized from any other path type.
   764     template <typename CPath>
   809     template <typename CPath>
   765     StaticPath(const CPath& cpath) : arcs(0) {
   810     StaticPath(const CPath& cpath) : arcs(0) {
   769     /// \brief Destructor of the path
   814     /// \brief Destructor of the path
   770     ///
   815     ///
   771     /// Destructor of the path
   816     /// Destructor of the path
   772     ~StaticPath() {
   817     ~StaticPath() {
   773       if (arcs) delete[] arcs;
   818       if (arcs) delete[] arcs;
       
   819     }
       
   820 
       
   821     /// \brief Copy assignment
       
   822     ///
       
   823     StaticPath& operator=(const StaticPath& cpath) {
       
   824       pathCopy(cpath, *this);
       
   825       return *this;
   774     }
   826     }
   775 
   827 
   776     /// \brief Template copy assignment
   828     /// \brief Template copy assignment
   777     ///
   829     ///
   778     /// This path can be made equal to any other path type. It simply
   830     /// This path can be made equal to any other path type. It simply