popt::option Class Reference

#include <popt_options.h>

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

Public Member Functions

template<class T >
 option (T &, char const *option_name, char short_name, char const *help_str, char const *arg_help_str)
 option (bool &, char const *option_name, char short_name, char const *help_str)
 non templatized ctor for boolean option
 ~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)

Private Attributes

option_basethe_option

Detailed Description

option - base class for a command line option

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

Definition at line 79 of file popt_options.h.


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 
)

non templatized ctor for boolean option

boolean operations don't get the same set of parameters as other option, as there is no argument to give help for. 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.

Definition at line 213 of file popt_options.cpp.

popt::option::~option (  ) 

Definition at line 206 of file popt_options.cpp.

References the_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.

Definition at line 221 of file popt_options.cpp.

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

Definition at line 231 of file popt_options.cpp.

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

Definition at line 241 of file popt_options.cpp.

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]

Field Documentation

Definition at line 104 of file popt_options.h.

Referenced by ~option().


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

Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1