Argus Camera Sample
Argus Camera Sample
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
ArgusSamples::Options Class Reference

Handles command line options. More...

#include <Options.h>

List of all members.

Classes

class  Option
 Defines a single option. More...

Public Member Functions

 Options (const char *programName)
 ~Options ()
bool initialize ()
bool usage ()
 Print the usage message.
bool parse (const int argc, char *const *argv)
 Parse the command line options.
bool addOption (const Option &option, void *userPtr=NULL)
 Add a option.
bool addOptions (size_t count, const Option *options, void *userPtr=NULL)
 Add multiple options.
bool addDescription (const char *description)
 Add test to the description, will be printed with the usage message.
bool requestExit ()
 Request exit after the current option, called from callback function.
bool requestedExit () const
 Has the exit been requested?

Static Public Member Functions

static bool printHelp (void *userPtr, const char *optArg)
 help option callback
static bool exit (void *userPtr, const char *optArg)
 exit option callback

Private Member Functions

 Options ()
 Hide default constructor.

Private Attributes

bool m_initialized
bool m_requestExit
std::string m_programName
std::string m_description
std::vector< Optionm_options

Detailed Description

Handles command line options.

Definition at line 43 of file Options.h.


Constructor & Destructor Documentation

ArgusSamples::Options::Options ( const char *  programName)
explicit

Definition at line 60 of file Options.cpp.

ArgusSamples::Options::~Options ( )

Definition at line 67 of file Options.cpp.

ArgusSamples::Options::Options ( )
private

Hide default constructor.


Member Function Documentation

bool ArgusSamples::Options::addDescription ( const char *  description)

Add test to the description, will be printed with the usage message.

Parameters:
[in]descriptionDescription

Definition at line 118 of file Options.cpp.

bool ArgusSamples::Options::addOption ( const Option option,
void *  userPtr = NULL 
)

Add a option.

Parameters:
[in]optionoption to add
[in]userPtruser pointer passed to callback function

Definition at line 90 of file Options.cpp.

bool ArgusSamples::Options::addOptions ( size_t  count,
const Option options,
void *  userPtr = NULL 
)

Add multiple options.

Parameters:
[in]counthow many options to add
[in]optionsoption array
[in]userPtruser pointer passed to callback functions

Definition at line 109 of file Options.cpp.

bool ArgusSamples::Options::exit ( void *  userPtr,
const char *  optArg 
)
static

exit option callback

Definition at line 51 of file Options.cpp.

bool ArgusSamples::Options::initialize ( )

Definition at line 71 of file Options.cpp.

bool ArgusSamples::Options::parse ( const int  argc,
char *const *  argv 
)

Parse the command line options.

Parameters:
[in]argcargument count
[in]argvargument values

Definition at line 137 of file Options.cpp.

bool ArgusSamples::Options::printHelp ( void *  userPtr,
const char *  optArg 
)
static

help option callback

Definition at line 41 of file Options.cpp.

bool ArgusSamples::Options::requestedExit ( ) const

Has the exit been requested?

Definition at line 132 of file Options.cpp.

bool ArgusSamples::Options::requestExit ( )

Request exit after the current option, called from callback function.

Definition at line 126 of file Options.cpp.

bool ArgusSamples::Options::usage ( )

Print the usage message.

Definition at line 212 of file Options.cpp.


Member Data Documentation

std::string ArgusSamples::Options::m_description
private

Definition at line 211 of file Options.h.

bool ArgusSamples::Options::m_initialized
private

Definition at line 208 of file Options.h.

std::vector<Option> ArgusSamples::Options::m_options
private

Definition at line 212 of file Options.h.

std::string ArgusSamples::Options::m_programName
private

Definition at line 210 of file Options.h.

bool ArgusSamples::Options::m_requestExit
private

Definition at line 209 of file Options.h.


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