COIN-OR::LEMON - Graph Library

Changeset 1038:ca63ec3424d8 in lemon-0.x for src


Ignore:
Timestamp:
12/16/04 13:15:02 (16 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1428
Message:

Renaming AlterationObserverRegistry? -> AlterationNotifier?
first step

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/lemon/alteration_observer_registry.h

    r1022 r1038  
    11/* -*- C++ -*-
    2  * src/lemon/observer_registry.h - Part of LEMON, a generic C++ optimization library
     2 * src/lemon/notifier.h - Part of LEMON, a generic C++ optimization library
    33 *
    44 * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     
    3737  /// alterations in a container. The alteration observers can be attached
    3838  /// to and detached from the registry. The observers have to inherit
    39   /// from the \ref AlterationObserverRegistry::ObserverBase and override
     39  /// from the \ref AlterationNotifier::ObserverBase and override
    4040  /// the virtual functions in that.
    4141  ///
     
    5050
    5151  template <typename _Item>
    52   class AlterationObserverRegistry {
     52  class AlterationNotifier {
    5353  public:
    5454    typedef _Item Item;
     
    7373    class ObserverBase {
    7474    protected:
    75       typedef AlterationObserverRegistry Registry;
    76 
    77       friend class AlterationObserverRegistry;
     75      typedef AlterationNotifier Registry;
     76
     77      friend class AlterationNotifier;
    7878
    7979      /// Default constructor.
     
    8585      virtual ~ObserverBase() {}
    8686
    87       /// Attaches the observer into an AlterationObserverRegistry.
    88 
    89       /// This member attaches the observer into an AlterationObserverRegistry.
    90       ///
    91       void attach(AlterationObserverRegistry& r) {
     87      /// Attaches the observer into an AlterationNotifier.
     88
     89      /// This member attaches the observer into an AlterationNotifier.
     90      ///
     91      void attach(AlterationNotifier& r) {
    9292        registry = &r;
    9393        registry->attach(*this);
    9494      }
    9595
    96       /// Detaches the observer into an AlterationObserverRegistry.
    97 
    98       /// This member detaches the observer from an AlterationObserverRegistry.
     96      /// Detaches the observer into an AlterationNotifier.
     97
     98      /// This member detaches the observer from an AlterationNotifier.
    9999      ///
    100100      void detach() {
     
    179179       
    180180    ///
    181     /// The default constructor of the AlterationObserverRegistry.
     181    /// The default constructor of the AlterationNotifier.
    182182    /// It creates an empty registry.
    183     AlterationObserverRegistry() {}
    184 
    185     /// Copy Constructor of the AlterationObserverRegistry.
    186        
    187     /// Copy constructor of the AlterationObserverRegistry.
     183    AlterationNotifier() {}
     184
     185    /// Copy Constructor of the AlterationNotifier.
     186       
     187    /// Copy constructor of the AlterationNotifier.
    188188    /// It creates only an empty registry because the copiable
    189189    /// registry's observers have to be registered still into that registry.
    190     AlterationObserverRegistry(const AlterationObserverRegistry&) {}
     190    AlterationNotifier(const AlterationObserverRegistry&) {}
    191191
    192192    /// Assign operator.
    193193               
    194     /// Assign operator for the AlterationObserverRegistry.
     194    /// Assign operator for the AlterationNotifier.
    195195    /// It makes the registry only empty because the copiable
    196196    /// registry's observers have to be registered still into that registry.
    197     AlterationObserverRegistry& operator=(const AlterationObserverRegistry&) {
     197    AlterationNotifier& operator=(const AlterationObserverRegistry&) {
    198198      typename Container::iterator it;
    199199      for (it = container.begin(); it != container.end(); ++it) {
     
    204204    /// Destructor.
    205205                               
    206     /// Destructor of the AlterationObserverRegistry.
     206    /// Destructor of the AlterationNotifier.
    207207    ///
    208     ~AlterationObserverRegistry() {
     208    ~AlterationNotifier() {
    209209      typename Container::iterator it;
    210210      for (it = container.begin(); it != container.end(); ++it) {
     
    309309
    310310    /// The edge observer registry.
    311     typedef AlterationObserverRegistry<Edge> EdgeObserverRegistry;
     311    typedef AlterationNotifier<Edge> EdgeObserverRegistry;
    312312    /// The node observer registry.
    313     typedef AlterationObserverRegistry<Node> NodeObserverRegistry;
     313    typedef AlterationNotifier<Node> NodeObserverRegistry;
    314314
    315315
    316316  protected:
    317317
    318     mutable EdgeObserverRegistry edge_observers;
    319 
    320     mutable NodeObserverRegistry node_observers;
    321 
    322   public:
    323 
    324     EdgeObserverRegistry& getObserverRegistry(Edge = INVALID) const {
     318    mutable EdgeNotifier edge_observers;
     319
     320    mutable NodeNotifier node_observers;
     321
     322  public:
     323
     324    EdgeNotifier& getObserverRegistry(Edge = INVALID) const {
    325325      return edge_observers;
    326326    }
    327327
    328     NodeObserverRegistry& getObserverRegistry(Node = INVALID) const {
     328    NodeNotifier& getObserverRegistry(Node = INVALID) const {
    329329      return node_observers;
    330330    }
     
    359359
    360360    /// The edge observer registry.
    361     typedef AlterationObserverRegistry<UndirEdge> UndirEdgeObserverRegistry;
     361    typedef AlterationNotifier<UndirEdge> UndirEdgeObserverRegistry;
    362362
    363363  protected:
    364364
    365     mutable UndirEdgeObserverRegistry undir_edge_observers;
    366 
    367   public:
    368 
    369     using Parent::getObserverRegistry;
    370     UndirEdgeObserverRegistry& getObserverRegistry(UndirEdge) const {
     365    mutable UndirEdgeNotifier undir_edge_observers;
     366
     367  public:
     368
     369    using Parent::getNotifier;
     370    UndirEdgeNotifier& getObserverRegistry(UndirEdge) const {
    371371      return undir_edge_observers;
    372372    }
Note: See TracChangeset for help on using the changeset viewer.