update to Element::configure methods

Eddie Kohler kohler at icir.org
Thu Feb 7 16:10:25 EST 2002


Hi all, fun fun fun!:

I've changed the signatures to Element::configure,
Element::live_reconfigure, and Element::configuration.

We used to have

   virtual int configure(const Vector<String> &conf, ErrorHandler *errh);
   virtual int live_reconfigure(const Vector<String> &conf, ErrorHandler *eh);

Note that "conf" is a const reference.
We now have

   virtual int configure(Vector<String> &conf, ErrorHandler *errh);
   virtual int live_reconfigure(Vector<String> &conf, ErrorHandler *errh);

"conf" is a regular reference (not const).

Now, configure() methods are allowed to change the Vector<String> &conf
argument however they would like. This can be useful if you want to divide
responsibility for parsing an argument list among multiple parties.

For example, you can use the new cp_va_parse_remove_keywords() function,
which parses a set of keywords from an argument list, and removes from the
list the keywords it parsed, leaving anything it did not understand.

Old code should continue to work, at least for a while, because of some
virtual function magic. Nevertheless, every element in the repository was
changed to follow the new signatures.

Oh, the change to configuration() is:

OLD    virtual void configuration(Vector<String> &, bool *) const;
NEW    virtual void configuration(Vector<String> &) const;

Eddie



More information about the click mailing list