COIN-OR::LEMON - Graph Library

Changeset 1134:56b07afdbf8d in lemon-0.x for src/lemon


Ignore:
Timestamp:
02/07/05 11:49:44 (19 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1533
Message:

Documentation

Location:
src/lemon
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/lemon/alteration_notifier.h

    r1040 r1134  
    322322  public:
    323323
    324     EdgeNotifier& getNotifier(Edge = INVALID) const {
     324    /// \brief Gives back the edge alteration notifier.
     325    ///
     326    /// Gives back the edge alteration notifier.
     327    EdgeNotifier& getNotifier(Edge) const {
    325328      return edge_notifier;
    326329    }
    327330
    328     NodeNotifier& getNotifier(Node = INVALID) const {
     331    /// \brief Gives back the node alteration notifier.
     332    ///
     333    /// Gives back the node alteration notifier.
     334    NodeNotifier& getNotifier(Node) const {
    329335      return node_notifier;
    330336    }
  • src/lemon/concept/graph_component.h

    r1106 r1134  
    2525#include <lemon/invalid.h>
    2626#include <lemon/concept/maps.h>
     27
     28#include <lemon/alteration_notifier.h>
    2729
    2830namespace lemon {
     
    572574      ///
    573575      GraphIncIterator(GraphIncIterator const&) {}
    574       /// Sets the iterator to the first edge incoming into or outgoing from the node.
    575      
    576       /// Sets the iterator to the first edge incoming into or outgoing from the node.
     576      /// Sets the iterator to the first edge incoming into or outgoing
     577      /// from the node.
     578     
     579      /// Sets the iterator to the first edge incoming into or outgoing
     580      /// from the node.
    577581      ///
    578582      explicit GraphIncIterator(const Graph&, const typename Graph::Node&) {}
     
    672676        checkConcept< BaseGraphComponent, _Graph>();
    673677
    674         checkConcept<GraphIterator<_Graph, typename _Graph::Edge>, typename _Graph::EdgeIt >();
    675         checkConcept<GraphIterator<_Graph, typename _Graph::Node>, typename _Graph::NodeIt >();
     678        checkConcept<GraphIterator<_Graph, typename _Graph::Edge>,
     679          typename _Graph::EdgeIt >();
     680        checkConcept<GraphIterator<_Graph, typename _Graph::Node>,
     681          typename _Graph::NodeIt >();
    676682        checkConcept<GraphIncIterator<_Graph>, typename _Graph::InEdgeIt >();
    677683        checkConcept<GraphIncIterator<_Graph>, typename _Graph::OutEdgeIt >();
    678684      }
     685    };
     686
     687    /// An empty alteration notifier base graph class.
     688 
     689    /// This class provides beside the core graph features
     690    /// alteration notifier interface for the graph structure.
     691    /// This is an observer-notifier pattern. More Obsevers can
     692    /// be registered into the notifier and whenever an alteration
     693    /// occured in the graph all the observers will notified about it.
     694    class AlterableGraphComponent : virtual public BaseGraphComponent {
     695    public:
     696
     697      /// The edge observer registry.
     698      typedef AlterationNotifier<Edge> EdgeNotifier;
     699      /// The node observer registry.
     700      typedef AlterationNotifier<Node> NodeNotifier;
     701     
     702      /// \brief Gives back the edge alteration notifier.
     703      ///
     704      /// Gives back the edge alteration notifier.
     705      EdgeNotifier getNotifier(Edge) const {
     706        return EdgeNotifier();
     707      }
     708     
     709      /// \brief Gives back the node alteration notifier.
     710      ///
     711      /// Gives back the node alteration notifier.
     712      NodeNotifier getNotifier(Node) const {
     713        return NodeNotifier();
     714      }
     715     
    679716    };
    680717
     
    690727      GraphMap() {}
    691728    public:
     729      /// \brief Construct a new map.
     730      ///
     731      /// Construct a new map for the graph.
    692732      explicit GraphMap(const Graph&) {}
     733      /// \brief Construct a new map with default value.
     734      ///
     735      /// Construct a new map for the graph and initalise the values.
    693736      GraphMap(const Graph&, const _Value&) {}
     737      /// \brief Copy constructor.
     738      ///
     739      /// Copy Constructor.
    694740      GraphMap(const GraphMap&) {}
    695741     
     742      /// \brief Assign operator.
     743      ///
     744      /// Assign operator.
    696745      GraphMap& operator=(const GraphMap&) { return *this;}
    697746
     
    741790        NodeMap();
    742791      public:
    743         // \todo call the right parent class constructor
     792        /// \brief Construct a new map.
     793        ///
     794        /// Construct a new map for the graph.
     795        /// \todo call the right parent class constructor
    744796        explicit NodeMap(const Graph&) {}
     797        /// \brief Construct a new map with default value.
     798        ///
     799        /// Construct a new map for the graph and initalise the values.
    745800        NodeMap(const Graph&, const _Value&) {}
     801        /// \brief Copy constructor.
     802        ///
     803        /// Copy Constructor.
    746804        NodeMap(const NodeMap&) {}
    747805
     806        /// \brief Assign operator.
     807        ///
     808        /// Assign operator.
    748809        NodeMap& operator=(const NodeMap&) { return *this;}
    749810
     
    759820        EdgeMap();
    760821      public:
    761         // \todo call the right parent class constructor
     822        /// \brief Construct a new map.
     823        ///
     824        /// Construct a new map for the graph.
     825        /// \todo call the right parent class constructor
    762826        explicit EdgeMap(const Graph&) {}
     827        /// \brief Construct a new map with default value.
     828        ///
     829        /// Construct a new map for the graph and initalise the values.
    763830        EdgeMap(const Graph&, const _Value&) {}
     831        /// \brief Copy constructor.
     832        ///
     833        /// Copy Constructor.
    764834        EdgeMap(const EdgeMap&) {}
    765835
     836        /// \brief Assign operator.
     837        ///
     838        /// Assign operator.
    766839        EdgeMap& operator=(const EdgeMap&) { return *this;}
    767840
     
    781854          { // int map test
    782855            typedef typename _Graph::template NodeMap<int> IntNodeMap;
    783             checkConcept<GraphMap<_Graph, typename _Graph::Node, int>, IntNodeMap >();
     856            checkConcept<GraphMap<_Graph, typename _Graph::Node, int>,
     857              IntNodeMap >();
    784858          } { // bool map test
    785859            typedef typename _Graph::template NodeMap<bool> BoolNodeMap;
    786             checkConcept<GraphMap<_Graph, typename _Graph::Node, bool>, BoolNodeMap >();
     860            checkConcept<GraphMap<_Graph, typename _Graph::Node, bool>,
     861              BoolNodeMap >();
    787862          } { // Type map test
    788863            typedef typename _Graph::template NodeMap<Type> TypeNodeMap;
    789             checkConcept<GraphMap<_Graph, typename _Graph::Node, Type>, TypeNodeMap >();
     864            checkConcept<GraphMap<_Graph, typename _Graph::Node, Type>,
     865              TypeNodeMap >();
    790866          }
    791867
    792868          { // int map test
    793869            typedef typename _Graph::template EdgeMap<int> IntEdgeMap;
    794             checkConcept<GraphMap<_Graph, typename _Graph::Edge, int>, IntEdgeMap >();
     870            checkConcept<GraphMap<_Graph, typename _Graph::Edge, int>,
     871              IntEdgeMap >();
    795872          } { // bool map test
    796873            typedef typename _Graph::template EdgeMap<bool> BoolEdgeMap;
    797             checkConcept<GraphMap<_Graph, typename _Graph::Edge, bool>, BoolEdgeMap >();
     874            checkConcept<GraphMap<_Graph, typename _Graph::Edge, bool>,
     875              BoolEdgeMap >();
    798876          } { // Type map test
    799877            typedef typename _Graph::template EdgeMap<Type> TypeEdgeMap;
    800             checkConcept<GraphMap<_Graph, typename _Graph::Edge, Type>, TypeEdgeMap >();
     878            checkConcept<GraphMap<_Graph, typename _Graph::Edge, Type>,
     879              TypeEdgeMap >();
    801880          }
    802881        }
     
    806885    };
    807886
    808 
     887    /// \brief An empty extendable extended graph class.
     888    ///
     889    /// This class provides beside the core graph features
     890    /// item addition interface for the graph structure.
     891    /// The difference between this class and the
     892    /// \c BaseExtendableGraphComponent is that it should
     893    /// notify the item alteration observers.
    809894    class ExtendableGraphComponent : virtual public BaseGraphComponent {
    810895    public:
     
    815900      typedef BaseGraphComponent::Edge Edge;
    816901
     902      /// \brief Add a node to the graph.
     903      ///
     904      /// Add a node to the graph and notify the observers.
    817905      Node addNode() {
    818906        return INVALID;
    819907      }
    820908   
     909      /// \brief Add an edge to the graph.
     910      ///
     911      /// Add an edge to the graph and notify the observers.
    821912      Edge addEdge(const Node& from, const Node& to) {
    822913        return INVALID;
     
    835926      };
    836927    };
     928
     929    /// \brief An empty erasable extended graph class.
     930    ///
     931    /// This class provides beside the core graph features
     932    /// item erase interface for the graph structure.
     933    /// The difference between this class and the
     934    /// \c BaseErasableGraphComponent is that it should
     935    /// notify the item alteration observers.
    837936    class ErasableGraphComponent : virtual public BaseGraphComponent {
    838937    public:
     
    843942      typedef BaseGraphComponent::Edge Edge;
    844943
     944      /// \brief Erase the Node and notify the node alteration observers.
     945      ///
     946      ///  Erase the Node and notify the node alteration observers.
    845947      void erase(const Node&) {}   
     948
     949      /// \brief Erase the Edge and notify the edge alteration observers.
     950      ///
     951      ///  Erase the Edge and notify the edge alteration observers.
    846952      void erase(const Edge&) {}
    847953
Note: See TracChangeset for help on using the changeset viewer.