ComputeArguments Class Reference

Command-line arguments parser for compute binary. More...

#include <ComputeArguments.h>

Inheritance diagram for ComputeArguments:

Inheritance graph
[legend]
Collaboration diagram for ComputeArguments:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::vector< std::string > StringContainer

Public Member Functions

 ComputeArguments ()
virtual ~ComputeArguments ()
float getTreshold ()
float getDivide ()
int getSteps ()
int getSaves ()
long getCache ()
char * getFileIn ()
char * getFileOut ()
bool getNormalize ()
bool parseArguments (int argc, char **argv)
char * getCstringValue (std::string name)
void setDescription (const char *description)
void setVersion (const char *version)
template<class T>
getValue (std::string name)
void clean ()

Static Public Attributes

static const char * NAMES []

Protected Member Functions

virtual void showHelp (bool quit=true, const char *custMessage=0)
void showError (StringContainer parts)
void showError (const char *message)
void showVersion (bool quit=false)
void setDelimiter (const char *new_var)
char * getDelimiter ()
void addArgument (const char *name, const char *description, bool required, const char *def)

Detailed Description

Command-line arguments parser for compute binary.

Definition at line 28 of file ComputeArguments.h.


Member Typedef Documentation

typedef std::vector<std::string> ArgumentParser::StringContainer [inherited]

Definition at line 25 of file ArgumentParser.h.


Constructor & Destructor Documentation

ComputeArguments::ComputeArguments (  ) 

Empty Constructor

virtual ComputeArguments::~ComputeArguments (  )  [virtual]

Empty Destructor


Member Function Documentation

float ComputeArguments::getTreshold (  ) 

Returns:
float

float ComputeArguments::getDivide (  ) 

Returns:
float

int ComputeArguments::getSteps (  ) 

Returns:
int

int ComputeArguments::getSaves (  ) 

Returns:
int

long ComputeArguments::getCache (  ) 

Returns:
long

char* ComputeArguments::getFileIn (  ) 

Returns:
char*

char* ComputeArguments::getFileOut (  ) 

Returns:
char*

bool ComputeArguments::getNormalize (  ) 

Returns:
bool

bool ArgumentParser::parseArguments ( int  argc,
char **  argv 
) [inherited]

Parse command line arguments

Returns:
bool
Parameters:
argc Argument count
argv Array of arguments.

char* ArgumentParser::getCstringValue ( std::string  name  )  [inherited]

Return char*

Returns:
char*
Parameters:
name Argument name

void ArgumentParser::setDescription ( const char *  description  )  [inherited]

Set program description

Parameters:
description Program description

void ArgumentParser::setVersion ( const char *  version  )  [inherited]

Set program version

Parameters:
version String describing program version

template<class T>
T ArgumentParser::getValue ( std::string  name  )  [inline, inherited]

Template for prasing cstrings.

Returns:
T
Parameters:
name Argument name.

Definition at line 69 of file ArgumentParser.h.

References ArgumentParser::showHelp().

void ArgumentParser::clean (  )  [inherited]

Free malloced memory.

virtual void ArgumentParser::showHelp ( bool  quit = true,
const char *  custMessage = 0 
) [protected, virtual, inherited]

Show help

Parameters:
quit if is true then function call exit(0) on end
custMessage Custom message to show on the top of help

Referenced by ArgumentParser::getValue().

void ArgumentParser::showError ( StringContainer  parts  )  [protected, inherited]

Show help message and quit

Parameters:
parts vector containing parts of error message

void ArgumentParser::showError ( const char *  message  )  [protected, inherited]

Show help message and quit

Parameters:
message error message

void ArgumentParser::showVersion ( bool  quit = false  )  [protected, inherited]

Show version

Parameters:
quit if is true then function call exit(1) on end

void ArgumentParser::setDelimiter ( const char *  new_var  )  [protected, inherited]

Set the value of delimiter_ Arguments delimiter.

Parameters:
new_var the new value of m_delimiter_

char* ArgumentParser::getDelimiter (  )  [protected, inherited]

Get the value of delimiter_ Arguments delimiter.

Returns:
the value of m_delimiter_

void ArgumentParser::addArgument ( const char *  name,
const char *  description,
bool  required,
const char *  def 
) [protected, inherited]

Add argument

Parameters:
name Argument name
description Argument description
required True if argument is required
def Default value like cstring ( char* )


Member Data Documentation

const char* ComputeArguments::NAMES[] [static]

Definition at line 49 of file ComputeArguments.h.


The documentation for this class was generated from the following file:
Generated on Thu Dec 6 19:33:12 2007 for Radiosity Renderer and Visualizer by  doxygen 1.5.2