Changeset 1134:56b07afdbf8d in lemon0.x
 Timestamp:
 02/07/05 11:49:44 (19 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@1533
 Location:
 src/lemon
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

src/lemon/alteration_notifier.h
r1040 r1134 322 322 public: 323 323 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 { 325 328 return edge_notifier; 326 329 } 327 330 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 { 329 335 return node_notifier; 330 336 } 
src/lemon/concept/graph_component.h
r1106 r1134 25 25 #include <lemon/invalid.h> 26 26 #include <lemon/concept/maps.h> 27 28 #include <lemon/alteration_notifier.h> 27 29 28 30 namespace lemon { … … 572 574 /// 573 575 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. 577 581 /// 578 582 explicit GraphIncIterator(const Graph&, const typename Graph::Node&) {} … … 672 676 checkConcept< BaseGraphComponent, _Graph>(); 673 677 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 >(); 676 682 checkConcept<GraphIncIterator<_Graph>, typename _Graph::InEdgeIt >(); 677 683 checkConcept<GraphIncIterator<_Graph>, typename _Graph::OutEdgeIt >(); 678 684 } 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 observernotifier 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 679 716 }; 680 717 … … 690 727 GraphMap() {} 691 728 public: 729 /// \brief Construct a new map. 730 /// 731 /// Construct a new map for the graph. 692 732 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. 693 736 GraphMap(const Graph&, const _Value&) {} 737 /// \brief Copy constructor. 738 /// 739 /// Copy Constructor. 694 740 GraphMap(const GraphMap&) {} 695 741 742 /// \brief Assign operator. 743 /// 744 /// Assign operator. 696 745 GraphMap& operator=(const GraphMap&) { return *this;} 697 746 … … 741 790 NodeMap(); 742 791 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 744 796 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. 745 800 NodeMap(const Graph&, const _Value&) {} 801 /// \brief Copy constructor. 802 /// 803 /// Copy Constructor. 746 804 NodeMap(const NodeMap&) {} 747 805 806 /// \brief Assign operator. 807 /// 808 /// Assign operator. 748 809 NodeMap& operator=(const NodeMap&) { return *this;} 749 810 … … 759 820 EdgeMap(); 760 821 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 762 826 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. 763 830 EdgeMap(const Graph&, const _Value&) {} 831 /// \brief Copy constructor. 832 /// 833 /// Copy Constructor. 764 834 EdgeMap(const EdgeMap&) {} 765 835 836 /// \brief Assign operator. 837 /// 838 /// Assign operator. 766 839 EdgeMap& operator=(const EdgeMap&) { return *this;} 767 840 … … 781 854 { // int map test 782 855 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 >(); 784 858 } { // bool map test 785 859 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 >(); 787 862 } { // Type map test 788 863 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 >(); 790 866 } 791 867 792 868 { // int map test 793 869 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 >(); 795 872 } { // bool map test 796 873 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 >(); 798 876 } { // Type map test 799 877 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 >(); 801 880 } 802 881 } … … 806 885 }; 807 886 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. 809 894 class ExtendableGraphComponent : virtual public BaseGraphComponent { 810 895 public: … … 815 900 typedef BaseGraphComponent::Edge Edge; 816 901 902 /// \brief Add a node to the graph. 903 /// 904 /// Add a node to the graph and notify the observers. 817 905 Node addNode() { 818 906 return INVALID; 819 907 } 820 908 909 /// \brief Add an edge to the graph. 910 /// 911 /// Add an edge to the graph and notify the observers. 821 912 Edge addEdge(const Node& from, const Node& to) { 822 913 return INVALID; … … 835 926 }; 836 927 }; 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. 837 936 class ErasableGraphComponent : virtual public BaseGraphComponent { 838 937 public: … … 843 942 typedef BaseGraphComponent::Edge Edge; 844 943 944 /// \brief Erase the Node and notify the node alteration observers. 945 /// 946 /// Erase the Node and notify the node alteration observers. 845 947 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. 846 952 void erase(const Edge&) {} 847 953
Note: See TracChangeset
for help on using the changeset viewer.