< Previous by Date Date Index Next by Date >
  Thread Index  

[reSIProcate] Problem using extension parameters with Auth


Because Auth adds its own overloads for param(), hiding the ones in ParserCategory, extension parameters don't work quite the way they should (as specified in http://warsaw.sjc.purplecomm.com/wiki/index.php?title=Use_Overview#Extension_parameters).

In particular this doesn't compile:
   static const ExtensionParameter p_foo("foo");
   ...
   Auth auth;
   auth.param(p_foo) = "bar";

A workaround is to explicitly qualify:
   auth.ParserCategory::param(p_foo) = "bar";
but this is ugly and means you have to write different code for built-in and extension parameters.

One solution would be to just add a "using ParserCategory::param;" in the Auth class definition - but that would make all of the usual parameters available, and I'm not sure that's the intention. An alternative would be to add to Auth the two overloads
      const Data& param(const ExtensionParameter& param) const;
      Data& param(const ExtensionParameter& param);
and just make both forward to the version in the base class.

- Alan