COIN-OR::LEMON - Graph Library

Changeset 2121:09a07a851506 in lemon-0.x for lemon/concept/graph.h


Ignore:
Timestamp:
07/10/06 21:04:17 (18 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2834
Message:

Modifications in the Graph Component concepts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/concept/graph.h

    r2120 r2121  
    3333  namespace concept {
    3434
    35    
    36     /**************** The full-featured graph concepts ****************/
    37 
    38 
    39     // \brief Modular static graph class.
    40     //     
    41     // It should be the same as the \c Graph class.
    42     class _Graph
    43       :  virtual public BaseGraphComponent,
    44          public IterableGraphComponent, public MappableGraphComponent {
    45     public:
    46 
    47       typedef BaseGraphComponent::Node Node;
    48       typedef BaseGraphComponent::Edge Edge;
    49 
    50       template <typename _Graph>
    51       struct Constraints {
    52         void constraints() {
    53           checkConcept<IterableGraphComponent, _Graph>();
    54           checkConcept<MappableGraphComponent, _Graph>();
    55         }
    56       };
    57     };
    58 
    5935    /// \addtogroup graph_concepts
    6036    /// @{
     
    411387      /// \warning Making maps that can handle bool type (NodeMap<bool>)
    412388      /// needs some extra attention!
    413       /// \todo Wrong documentation
    414389      template<class T>
    415       class NodeMap : public ReadWriteMap< Node, T >
    416       {
     390      class NodeMap : public ReadWriteMap< Node, T > {
    417391      public:
    418392
     
    425399        NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
    426400        ///Assignment operator
    427         NodeMap& operator=(const NodeMap&) { return *this; }
    428         // \todo fix this concept
     401        template <typename CMap>
     402        NodeMap& operator=(const CMap&) {
     403          checkConcept<ReadMap<Node, T>, CMap>();
     404          return *this;
     405        }
    429406      };
    430407
     
    435412      /// \warning Making maps that can handle bool type (EdgeMap<bool>)
    436413      /// needs some extra attention!
    437       /// \todo Wrong documentation
    438414      template<class T>
    439       class EdgeMap : public ReadWriteMap<Edge,T>
    440       {
     415      class EdgeMap : public ReadWriteMap<Edge,T> {
    441416      public:
    442417
     
    448423        EdgeMap(const EdgeMap& em) : ReadWriteMap<Edge,T>(em) { }
    449424        ///Assignment operator
    450         EdgeMap& operator=(const EdgeMap&) { return *this; }
    451         // \todo fix this concept   
     425        template <typename CMap>
     426        EdgeMap& operator=(const CMap&) {
     427          checkConcept<ReadMap<Edge, T>, CMap>();
     428          return *this;
     429        }
    452430      };
    453431
    454432      template <typename RGraph>
    455       struct Constraints : public _Graph::Constraints<RGraph> {};
     433      struct Constraints {
     434        void constraints() {
     435          checkConcept<BaseIterableGraphComponent<>, Graph>();
     436          checkConcept<IterableGraphComponent<>, Graph>();
     437          checkConcept<MappableGraphComponent<>, Graph>();
     438        }
     439      };
    456440
    457441    };
Note: See TracChangeset for help on using the changeset viewer.