popt::option Class Reference

option - base class for a command line option More...

#include <popt_options.h>

Collaboration diagram for popt::option:
Collaboration graph
[legend]

List of all members.

Public Member Functions

template<class T >
 option (T &, char const *option_name, char short_name, char const *help_str, char const *arg_help_str)
 Templatized constructor for an option.
 option (bool &, char const *option_name, char short_name, char const *help_str)
 boolean operations don't get the same set of parameters as other option, as there is no argument to give help for.
 ~option ()
template<>
 option (int &value, char const *name, char short_name, char const *help, char const *arg_help)
 specialization of option ctor for integer option
template<>
 option (string &value, char const *name, char short_name, char const *help, char const *arg_help)
 specialization of option ctor for string option
template<>
 option (vector< string > &value, char const *name, char short_name, char const *help, char const *arg_help)
 specialization of option ctor for vector<string> option
template<>
 option (std::string &, char const *option_name, char short_name, char const *help_str, char const *arg_help_str)
template<>
 option (std::vector< std::string > &, char const *option_name, char short_name, char const *help_str, char const *arg_help_str)

Detailed Description

option - base class for a command line option

Every command line option added before calling parse_options() is of this type.


Constructor & Destructor Documentation

template<class T >
popt::option::option ( T &  ,
char const *  option_name,
char  short_name,
char const *  help_str,
char const *  arg_help_str 
) [inline]

Templatized constructor for an option.

This adds the option to the option list on construction. This is specialized for each recognised option value type below.

popt::option::option ( bool &  value,
char const *  option_name,
char  short_name,
char const *  help_str 
)

boolean operations don't get the same set of parameters as other option, as there is no argument to give help for.

non templatized ctor for boolean option

Due to a bug in gcc 2.95 we can't use a default parameter in the templatized ctor above because 2.95 is unable to match the right ctor. So on we add a non-templatized ctor with an exact match for boolean option.

popt::option::~option (  ) 
popt::option::option ( int &  value,
char const *  name,
char  short_name,
char const *  help,
char const *  arg_help 
) [inline]

specialization of option ctor for integer option

The supported option type, boolean option are matched by a non templatized ctor above.

template<>
popt::option::option ( string &  value,
char const *  name,
char  short_name,
char const *  help,
char const *  arg_help 
) [inline]

specialization of option ctor for string option

template<>
popt::option::option ( vector< string > &  value,
char const *  name,
char  short_name,
char const *  help,
char const *  arg_help 
) [inline]

specialization of option ctor for vector<string> option

template<>
popt::option::option ( std::string &  ,
char const *  option_name,
char  short_name,
char const *  help_str,
char const *  arg_help_str 
) [inline]
template<>
popt::option::option ( std::vector< std::string > &  ,
char const *  option_name,
char  short_name,
char const *  help_str,
char const *  arg_help_str 
) [inline]

The documentation for this class was generated from the following files:

Generated on 29 Jul 2013 for oprofile by  doxygen 1.6.1