#line 1 "/user/cvsspst/ees1cg/RAVL/RAVL-0.7/Core/Container/Graph/GraphConnIt.hh" // This file is part of RAVL, Recognition And Vision Library // Copyright (C) 2001, University of Surrey // This code may be redistributed under the terms of the GNU Lesser // General Public License (LGPL). See the lgpl.licence file for details or // see http://www.gnu.org/copyleft/lesser.html // file-header-ends-here #ifndef GRAPHCONNITER_HEADER #define GRAPHCONNITER_HEADER 1 ////////////////////////////////////////////////////////////// //! file="Ravl/Core/Container/Graph/GraphConnIt.hh" //! lib=RavlCore //! userlevel=Normal //! author="Charles Galambos" //! date="2/1/1997" //! docentry="Ravl.Core.Graphs" //! rcsid="$Id: GraphConnIt.hh,v 1.1.1.1 2001/04/11 12:45:57 craftit Exp $" #include "Ravl/GraphBConIt.hh" #include "Ravl/GraphNode.hh" namespace RavlN { //: Connected node iterator. // Iterate all nodes that maybe reached from the given starting // point. This does not necessarily include the start point itself. template class GraphConnIterC : public GraphBaseConnIterC { public: GraphConnIterC(GraphNodeIterC &Nd) : GraphBaseConnIterC(Nd.BaseNodeIter()) {} // Constructor GraphConnIterC(GraphConnIterC &Oth) : GraphBaseConnIterC(Oth) {} // Copy constructor inline GraphNodeIterC Node(void) { return GraphNodeIterC(GraphBaseConnIterC::Data()); } // Get a node iterator. inline NodeT &Data(void) { return static_cast &>(GraphBaseConnIterC::Data().NodeRep()).Data(); } // Get some data. inline bool operator==(const GraphNodeIterC &Nd) const { return (&Nd.BaseNodeIter().NodeRep() == &GraphBaseConnIterC::Data().NodeRep()); } // At a particular node ? void AddOpen(const GraphNodeIterC &Nd) { GraphBaseConnIterC::AddOpen(Nd.BaseNodeIter()); } // Add node to open list. }; } #endif