src/core/config.h
changeset 4654 2eaebe77d66b
parent 3787 985324e2caaa
     1.1 --- a/src/core/config.h	Fri Oct 24 12:35:28 2008 +0200
     1.2 +++ b/src/core/config.h	Sat Jul 04 08:15:48 2009 +0200
     1.3 @@ -111,26 +111,97 @@
     1.4   */
     1.5  void Disconnect (std::string path, const CallbackBase &cb);
     1.6  
     1.7 +/**
     1.8 + * \brief hold a set of objects which match a specific search string.
     1.9 + *
    1.10 + * This class also allows you to perform a set of configuration operations
    1.11 + * on the set of matching objects stored in the container. Specifically,
    1.12 + * it is possible to perform bulk Connects and Sets.
    1.13 + */
    1.14  class MatchContainer
    1.15  {
    1.16  public:
    1.17    typedef std::vector<Ptr<Object> >::const_iterator Iterator;
    1.18    MatchContainer ();
    1.19 +  // constructor used only by implementation.
    1.20    MatchContainer (const std::vector<Ptr<Object> > &objects, 
    1.21                    const std::vector<std::string> &contexts, 
    1.22                    std::string path);
    1.23  
    1.24 +  /**
    1.25 +   * \returns an iterator which points to the first item in the container
    1.26 +   */
    1.27    MatchContainer::Iterator Begin (void) const;
    1.28 +  /**
    1.29 +   * \returns an iterator which points to the last item in the container
    1.30 +   */
    1.31    MatchContainer::Iterator End (void) const;
    1.32 +  /**
    1.33 +   * \returns the number of items in the container
    1.34 +   */
    1.35    uint32_t GetN (void) const;
    1.36 +  /**
    1.37 +   * \param i index of item to lookup ([0,n[)
    1.38 +   * \returns the item requested.
    1.39 +   */
    1.40    Ptr<Object> Get (uint32_t i) const;
    1.41 +  /**
    1.42 +   * \param i index of item to lookup ([0,n[)
    1.43 +   * \returns the fully-qualified matching path associated
    1.44 +   *          to the requested item.
    1.45 +   *
    1.46 +   * The matching patch uniquely identifies the requested object.
    1.47 +   */
    1.48    std::string GetMatchedPath (uint32_t i) const;
    1.49 +  /**
    1.50 +   * \returns the path used to perform the object matching.
    1.51 +   */
    1.52    std::string GetPath (void) const;
    1.53  
    1.54 +  /**
    1.55 +   * \param name name of attribute to set
    1.56 +   * \param value value to set to the attribute
    1.57 +   *
    1.58 +   * Set the specified attribute value to all the objects stored in this
    1.59 +   * container.
    1.60 +   * \sa ns3::Config::Set
    1.61 +   */
    1.62    void Set (std::string name, const AttributeValue &value);
    1.63 +  /**
    1.64 +   * \param name the name of the trace source to connect to
    1.65 +   * \param cb the sink to connect to the trace source
    1.66 +   *
    1.67 +   * Connect the specified sink to all the objects stored in this
    1.68 +   * container.
    1.69 +   * \sa ns3::Config::Connect
    1.70 +   */
    1.71    void Connect (std::string name, const CallbackBase &cb);
    1.72 +  /**
    1.73 +   * \param name the name of the trace source to connect to
    1.74 +   * \param cb the sink to connect to the trace source
    1.75 +   *
    1.76 +   * Connect the specified sink to all the objects stored in this
    1.77 +   * container.
    1.78 +   * \sa ns3::Config::ConnectWithoutContext     
    1.79 +   */
    1.80    void ConnectWithoutContext (std::string name, const CallbackBase &cb);
    1.81 +  /**
    1.82 +   * \param name the name of the trace source to disconnect from
    1.83 +   * \param cb the sink to disconnect from the trace source
    1.84 +   *
    1.85 +   * Disconnect the specified sink from all the objects stored in this
    1.86 +   * container.
    1.87 +   * \sa ns3::Config::Disconnect
    1.88 +   */
    1.89    void Disconnect (std::string name, const CallbackBase &cb);
    1.90 +  /**
    1.91 +   * \param name the name of the trace source to disconnect from
    1.92 +   * \param cb the sink to disconnect from the trace source
    1.93 +   *
    1.94 +   * Disconnect the specified sink from all the objects stored in this
    1.95 +   * container.
    1.96 +   * \sa ns3::Config::DisconnectWithoutContext
    1.97 +   */
    1.98    void DisconnectWithoutContext (std::string name, const CallbackBase &cb);
    1.99  private:
   1.100    std::vector<Ptr<Object> > m_objects;
   1.101 @@ -138,6 +209,11 @@
   1.102    std::string m_path;
   1.103  };
   1.104  
   1.105 +/**
   1.106 + * \param path the path to perform a match against
   1.107 + * \returns a container which contains all the objects which match the input
   1.108 + *          path.
   1.109 + */
   1.110  MatchContainer LookupMatches (std::string path);
   1.111  
   1.112  /**