# Changeset 1438:826bdac3525a in lemon-0.x

Ignore:
Timestamp:
05/26/05 17:33:16 (16 years ago)
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1913
Message:

Some documentation got revised.

Files:
2 edited

Unmodified
Removed
• ## doc/named-param.dox

 r1141 The procedure above can also be applied when defining classes. In this case the type of the attributes can be changed. Initially we have to define a class with the default attribute types. This is the se called Traits Class. Later on the types of these attributes can be changed, as described below. In our software \ref DijkstraDefaultTraits is an example of how a traits class look like. Initially we have to define a class with the default attribute types. This is the so called Traits Class. Later on the types of these attributes can be changed, as described below. In our software \ref DijkstraDefaultTraits is an example of how a traits class looks like. \section named-templ-param Named Class Template Parameters If we would like to change the type of an attribute in a class that was instantiated by using a traits class as a template parameter, and the class contains named parameters, we do not have to reinstantiate the class with new traits class. Instead of that adaptor classes can be used like in the following cases. If we would like to change the type of an attribute in a class that was instantiated by using a traits class as a template parameter, and the class contains named parameters, we do not have to reinstantiate the class with new traits class. Instead of that, adaptor classes can be used like in the following cases. \code
• ## lemon/dfs.h

 r1435 /// ///\param nm must be a bool (or convertible) edge map. The algorithm ///will stop when it reaches a edge \c v with nm[v]==true. ///\warning Contrary to \ref Dfs and \ref Dijkstra, \c mn is an edge map, ///will stop when it reaches an edge \c e with nm[e]==true. ///\warning Contrary to \ref Dfs and \ref Dijkstra, \c nm is an edge map, ///not a node map. template ///This function copies the path on the DFS tree to \c t into \c p. ///If it \c \t is a source itself or unreachable, then it does not ///If \c t is a source itself or unreachable, then it does not ///alter \c p. ///\todo Is it the right way to handle unreachable nodes? ///\todo Is this the right way to handle unreachable nodes? /// ///\return Returns \c true if a path to \c t was actually copied to \c p, ///\c false otherwise. ///Returns the distance of a node from the root(s). ///\pre \ref run() must be called before using this function. ///\warning If node \c v in unreachable from the root(s) the return value ///\warning If node \c v is unreachable from the root(s) then the return value ///of this funcion is undefined. int dist(Node v) const { return (*_dist)[v]; } ///Checks if a node is reachable from the root. ///Returns \c true if \c v is reachable from the root. ///\warning The source nodes are inditated as unreached. ///Returns \c true if \c v is reachable from the root(s). ///\warning The source nodes are inditated as unreachable. ///\pre Either \ref run() or \ref start() ///must be called before using this function. /// /// It does not have own \ref run method. When its \ref run method is called /// it initiates a plain \ref Dfs class, and calls the \ref Dfs::run /// it initiates a plain \ref Dfs object, and calls the \ref Dfs::run /// method of it. template
Note: See TracChangeset for help on using the changeset viewer.