template class OptionHandlerAdap0<typename C, typename R> : OptionHandler

Option handler adapter template.

This template creates an option handler for instances of class C by using a parameterless member function that return a value of type R. Also a template OptionHandlerAdap1 exists that could be used for member functions with one parameter.

Instead of explicitly instantiating the adapter templates, a convenience function exists that creates an option handler from a member function on the fly:

template<typename C, typename R> 
      inline OptionHandler<C>* option (const string& id, bool consuming, R (C::*func) ());

template<typename C, typename R, typename A> 
      inline OptionHandler<C>* option (const string& id, bool consuming, R (C::*func) (A), A arg);
 




Public Members:
    OptionHandlerAdap0 (const string& id, bool consuming, MemFunc0 func) ;
    Creates an option handler adapter instance.
    If an option with name id is found in the argument list, member function func will be used to handle the option.

    virtual ArgVector::iterator fireOption (C& inst, const string& id, ArgVector& args, ArgVector::iterator rest) ;
    An option is handled.
    When an option id is found, member function func is applied to the inst of class C. No further parameters are consumed, so rest is returned unchanged.




The Scrunitizer C++ Unit Test Framework
by Bernd Linowski

[Scrunitizer]  [Overview]  [Cookbook]  [Download]  [Index]  [Linosphere]

Page generated: 1 Nov 2000
(C) by Bernd Linowski
scrunitizer@linosphere.de