Changeset 1030:c8a41699e613 in lemon-0.x for src/lemon/concept/graph_component.h
- Timestamp:
- 12/06/04 01:30:44 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1420
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/lemon/concept/graph_component.h
r1022 r1030 15 15 */ 16 16 17 ///\ingroup concept17 ///\ingroup graph_concepts 18 18 ///\file 19 19 ///\brief The graph components. … … 29 29 namespace concept { 30 30 31 /// \addtogroup graph_concepts 32 /// @{ 31 33 32 34 /**************** Graph iterator concepts ****************/ 33 35 34 /// Skeleton class for graph Node and Edge 35 36 /// \note Because Node and Edge are forbidden to inherit from the same 37 /// base class, this is a template. For Node you should instantiate it 38 /// with character 'n' and for Edge with 'e'. 39 40 template<char _selector> 36 /// Skeleton class for graph Node and Edge types 37 38 /// This class describes the interface of Node and Edge (and UndirEdge 39 /// in undirected graphs) subtypes of graph types. 40 /// 41 /// \note This class is a template class so that we can use it to 42 /// create graph skeleton classes. The reason for this is than Node 43 /// and Edge types should \em not derive from the same base class. 44 /// For Node you should instantiate it with character 'n' and for Edge 45 /// with 'e'. 46 47 #ifndef DOXYGEN 48 template <char _selector = '0'> 49 #endif 41 50 class GraphItem { 42 51 public: 43 52 /// Default constructor. 44 53 45 /// @warning The default constructor sets the item 46 /// to an undefined value. 54 /// \warning The default constructor is not required to set 55 /// the item to some well-defined value. So you should consider it 56 /// as uninitialized. 47 57 GraphItem() {} 48 58 /// Copy constructor. … … 72 82 bool operator!=(GraphItem) const { return false; } 73 83 74 // Technical requirement. Do we really need this? 75 // bool operator<(GraphItem) const { return false; } 76 84 /// Artificial ordering operator. 85 86 /// To allow the use of graph descriptors as key type in std::map or 87 /// similar associative container we require this. 88 /// 89 /// \note This operator only have to define some strict ordering of 90 /// the items; this order has nothing to do with the iteration 91 /// ordering of the items. 92 /// 93 /// \bug This is a technical requirement. Do we really need this? 94 bool operator<(GraphItem) const { return false; } 77 95 78 96 template<typename _GraphItem> … … 89 107 b = (ia == ib) && (ia != ib); 90 108 b = (ia == INVALID) && (ib != INVALID); 109 b = (ia < ib); 91 110 } 92 111 … … 95 114 }; 96 115 }; 116 117 /// A type describing the concept of graph node 118 119 /// This is an instantiation of \ref GraphItem which can be used as a 120 /// Node subtype in graph skeleton definitions 121 typedef GraphItem<'n'> GraphNode; 122 123 /// A type describing the concept of graph edge 124 125 /// This is an instantiation of \ref GraphItem which can be used as a 126 /// Edge subtype in graph skeleton definitions 127 typedef GraphItem<'e'> GraphEdge; 128 129 130 /**************** Basic features of graphs ****************/ 97 131 98 132 /// An empty base graph class. … … 630 664 631 665 666 /// Class describing the concept of graph maps 667 668 /// This class describes the common interface of the graph maps 669 /// (NodeMap, EdgeMap), that is \ref maps "maps" which can be used to 670 /// associate data to graph descriptors (nodes or edges). 632 671 template <typename Graph, typename Item, typename _Value> 633 672 class GraphMap : public ReadWriteMap<Item, _Value> { … … 805 844 }; 806 845 846 /// @} 847 807 848 } 808 849
Note: See TracChangeset
for help on using the changeset viewer.