OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
osg::ApplicationUsage Class Reference

#include <ApplicationUsage.h>

Inheritance diagram for osg::ApplicationUsage:
Inheritance graph
[legend]
Collaboration diagram for osg::ApplicationUsage:
Collaboration graph
[legend]

Public Types

enum  Type {
  NO_HELP = 0x0, COMMAND_LINE_OPTION = 0x1, ENVIRONMENTAL_VARIABLE = 0x2, KEYBOARD_MOUSE_BINDING = 0x4,
  HELP_ALL = KEYBOARD_MOUSE_BINDING|ENVIRONMENTAL_VARIABLE|COMMAND_LINE_OPTION
}
 
typedef std::map< std::string,
std::string > 
UsageMap
 

Public Member Functions

 ApplicationUsage ()
 
 ApplicationUsage (const std::string &commandLineUsage)
 
void setApplicationName (const std::string &name)
 
const std::string & getApplicationName () const
 
void setDescription (const std::string &desc)
 
const std::string & getDescription () const
 
void addUsageExplanation (Type type, const std::string &option, const std::string &explanation)
 
void setCommandLineUsage (const std::string &explanation)
 
const std::string & getCommandLineUsage () const
 
void addCommandLineOption (const std::string &option, const std::string &explanation, const std::string &defaultValue="")
 
void setCommandLineOptions (const UsageMap &usageMap)
 
const UsageMapgetCommandLineOptions () const
 
void setCommandLineOptionsDefaults (const UsageMap &usageMap)
 
const UsageMapgetCommandLineOptionsDefaults () const
 
void addEnvironmentalVariable (const std::string &option, const std::string &explanation, const std::string &defaultValue="")
 
void setEnvironmentalVariables (const UsageMap &usageMap)
 
const UsageMapgetEnvironmentalVariables () const
 
void setEnvironmentalVariablesDefaults (const UsageMap &usageMap)
 
const UsageMapgetEnvironmentalVariablesDefaults () const
 
void addKeyboardMouseBinding (const std::string &prefix, int key, const std::string &explanation)
 
void addKeyboardMouseBinding (int key, const std::string &explanation)
 
void addKeyboardMouseBinding (const std::string &option, const std::string &explanation)
 
void setKeyboardMouseBindings (const UsageMap &usageMap)
 
const UsageMapgetKeyboardMouseBindings () const
 
void getFormattedString (std::string &str, const UsageMap &um, unsigned int widthOfOutput=80, bool showDefaults=false, const UsageMap &ud=UsageMap())
 
void write (std::ostream &output, const UsageMap &um, unsigned int widthOfOutput=80, bool showDefaults=false, const UsageMap &ud=UsageMap())
 
void write (std::ostream &output, unsigned int type=COMMAND_LINE_OPTION, unsigned int widthOfOutput=80, bool showDefaults=false)
 
void writeEnvironmentSettings (std::ostream &output)
 
- Public Member Functions inherited from osg::Referenced
 Referenced ()
 
 Referenced (bool threadSafeRefUnref)
 
 Referenced (const Referenced &)
 
Referencedoperator= (const Referenced &)
 
virtual void setThreadSafeRefUnref (bool threadSafe)
 
bool getThreadSafeRefUnref () const
 
OpenThreads::MutexgetRefMutex () const
 
int ref () const
 
int unref () const
 
int unref_nodelete () const
 
int referenceCount () const
 
ObserverSetgetObserverSet () const
 
ObserverSetgetOrCreateObserverSet () const
 
void addObserver (Observer *observer) const
 
void removeObserver (Observer *observer) const
 

Static Public Member Functions

static ApplicationUsageinstance ()
 
- Static Public Member Functions inherited from osg::Referenced
static OpenThreads::MutexgetGlobalReferencedMutex ()
 
static void setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting)
 
static bool getThreadSafeReferenceCounting ()
 
static void setDeleteHandler (DeleteHandler *handler)
 
static DeleteHandlergetDeleteHandler ()
 

Protected Member Functions

virtual ~ApplicationUsage ()
 
- Protected Member Functions inherited from osg::Referenced
virtual ~Referenced ()
 
void signalObserversAndDelete (bool signalDelete, bool doDelete) const
 
void deleteUsingDeleteHandler () const
 

Protected Attributes

std::string _applicationName
 
std::string _description
 
std::string _commandLineUsage
 
UsageMap _commandLineOptions
 
UsageMap _environmentalVariables
 
UsageMap _keyboardMouse
 
UsageMap _environmentalVariablesDefaults
 
UsageMap _commandLineOptionsDefaults
 
- Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr _observerSet
 
OpenThreads::Atomic _refCount
 

Detailed Description

Definition at line 25 of file ApplicationUsage.h.

Member Typedef Documentation

typedef std::map<std::string,std::string> osg::ApplicationUsage::UsageMap

Definition at line 35 of file ApplicationUsage.h.

Member Enumeration Documentation

Enumerator
NO_HELP 
COMMAND_LINE_OPTION 
ENVIRONMENTAL_VARIABLE 
KEYBOARD_MOUSE_BINDING 
HELP_ALL 

Definition at line 47 of file ApplicationUsage.h.

Constructor & Destructor Documentation

osg::ApplicationUsage::ApplicationUsage ( )
inline

Definition at line 31 of file ApplicationUsage.h.

osg::ApplicationUsage::ApplicationUsage ( const std::string &  commandLineUsage)
virtual osg::ApplicationUsage::~ApplicationUsage ( )
inlineprotectedvirtual

Definition at line 98 of file ApplicationUsage.h.

Member Function Documentation

void osg::ApplicationUsage::addCommandLineOption ( const std::string &  option,
const std::string &  explanation,
const std::string &  defaultValue = "" 
)
void osg::ApplicationUsage::addEnvironmentalVariable ( const std::string &  option,
const std::string &  explanation,
const std::string &  defaultValue = "" 
)
void osg::ApplicationUsage::addKeyboardMouseBinding ( const std::string &  prefix,
int  key,
const std::string &  explanation 
)
void osg::ApplicationUsage::addKeyboardMouseBinding ( int  key,
const std::string &  explanation 
)
void osg::ApplicationUsage::addKeyboardMouseBinding ( const std::string &  option,
const std::string &  explanation 
)
void osg::ApplicationUsage::addUsageExplanation ( Type  type,
const std::string &  option,
const std::string &  explanation 
)

Here is the caller graph for this function:

const std::string& osg::ApplicationUsage::getApplicationName ( ) const
inline

Definition at line 40 of file ApplicationUsage.h.

const UsageMap& osg::ApplicationUsage::getCommandLineOptions ( ) const
inline

Definition at line 65 of file ApplicationUsage.h.

const UsageMap& osg::ApplicationUsage::getCommandLineOptionsDefaults ( ) const
inline

Definition at line 68 of file ApplicationUsage.h.

const std::string& osg::ApplicationUsage::getCommandLineUsage ( ) const
inline

Definition at line 59 of file ApplicationUsage.h.

const std::string& osg::ApplicationUsage::getDescription ( ) const
inline

Definition at line 45 of file ApplicationUsage.h.

const UsageMap& osg::ApplicationUsage::getEnvironmentalVariables ( ) const
inline

Definition at line 74 of file ApplicationUsage.h.

const UsageMap& osg::ApplicationUsage::getEnvironmentalVariablesDefaults ( ) const
inline

Definition at line 77 of file ApplicationUsage.h.

void osg::ApplicationUsage::getFormattedString ( std::string &  str,
const UsageMap um,
unsigned int  widthOfOutput = 80,
bool  showDefaults = false,
const UsageMap ud = UsageMap() 
)
const UsageMap& osg::ApplicationUsage::getKeyboardMouseBindings ( ) const
inline

Definition at line 85 of file ApplicationUsage.h.

static ApplicationUsage* osg::ApplicationUsage::instance ( )
static

Here is the caller graph for this function:

void osg::ApplicationUsage::setApplicationName ( const std::string &  name)
inline

The ApplicationName is often displayed when logging errors, and frequently incorporated into the Description (below).

Definition at line 39 of file ApplicationUsage.h.

void osg::ApplicationUsage::setCommandLineOptions ( const UsageMap usageMap)
inline

Definition at line 64 of file ApplicationUsage.h.

void osg::ApplicationUsage::setCommandLineOptionsDefaults ( const UsageMap usageMap)
inline

Definition at line 67 of file ApplicationUsage.h.

void osg::ApplicationUsage::setCommandLineUsage ( const std::string &  explanation)
inline

Definition at line 58 of file ApplicationUsage.h.

void osg::ApplicationUsage::setDescription ( const std::string &  desc)
inline

If non-empty, the Description is typically shown by the Help Handler as text on the Help display (which also lists keyboard abbreviations.

Definition at line 44 of file ApplicationUsage.h.

void osg::ApplicationUsage::setEnvironmentalVariables ( const UsageMap usageMap)
inline

Definition at line 73 of file ApplicationUsage.h.

void osg::ApplicationUsage::setEnvironmentalVariablesDefaults ( const UsageMap usageMap)
inline

Definition at line 76 of file ApplicationUsage.h.

void osg::ApplicationUsage::setKeyboardMouseBindings ( const UsageMap usageMap)
inline

Definition at line 84 of file ApplicationUsage.h.

void osg::ApplicationUsage::write ( std::ostream &  output,
const UsageMap um,
unsigned int  widthOfOutput = 80,
bool  showDefaults = false,
const UsageMap ud = UsageMap() 
)
void osg::ApplicationUsage::write ( std::ostream &  output,
unsigned int  type = COMMAND_LINE_OPTION,
unsigned int  widthOfOutput = 80,
bool  showDefaults = false 
)
void osg::ApplicationUsage::writeEnvironmentSettings ( std::ostream &  output)

Member Data Documentation

std::string osg::ApplicationUsage::_applicationName
protected

Definition at line 100 of file ApplicationUsage.h.

UsageMap osg::ApplicationUsage::_commandLineOptions
protected

Definition at line 103 of file ApplicationUsage.h.

UsageMap osg::ApplicationUsage::_commandLineOptionsDefaults
protected

Definition at line 107 of file ApplicationUsage.h.

std::string osg::ApplicationUsage::_commandLineUsage
protected

Definition at line 102 of file ApplicationUsage.h.

std::string osg::ApplicationUsage::_description
protected

Definition at line 101 of file ApplicationUsage.h.

UsageMap osg::ApplicationUsage::_environmentalVariables
protected

Definition at line 104 of file ApplicationUsage.h.

UsageMap osg::ApplicationUsage::_environmentalVariablesDefaults
protected

Definition at line 106 of file ApplicationUsage.h.

UsageMap osg::ApplicationUsage::_keyboardMouse
protected

Definition at line 105 of file ApplicationUsage.h.


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