OSG
3.4.0
|
#include <ApplicationUsage.h>
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 UsageMap & | getCommandLineOptions () const |
void | setCommandLineOptionsDefaults (const UsageMap &usageMap) |
const UsageMap & | getCommandLineOptionsDefaults () const |
void | addEnvironmentalVariable (const std::string &option, const std::string &explanation, const std::string &defaultValue="") |
void | setEnvironmentalVariables (const UsageMap &usageMap) |
const UsageMap & | getEnvironmentalVariables () const |
void | setEnvironmentalVariablesDefaults (const UsageMap &usageMap) |
const UsageMap & | getEnvironmentalVariablesDefaults () 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 UsageMap & | getKeyboardMouseBindings () 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) |
![]() | |
Referenced () | |
Referenced (bool threadSafeRefUnref) | |
Referenced (const Referenced &) | |
Referenced & | operator= (const Referenced &) |
virtual void | setThreadSafeRefUnref (bool threadSafe) |
bool | getThreadSafeRefUnref () const |
OpenThreads::Mutex * | getRefMutex () const |
int | ref () const |
int | unref () const |
int | unref_nodelete () const |
int | referenceCount () const |
ObserverSet * | getObserverSet () const |
ObserverSet * | getOrCreateObserverSet () const |
void | addObserver (Observer *observer) const |
void | removeObserver (Observer *observer) const |
Static Public Member Functions | |
static ApplicationUsage * | instance () |
![]() | |
static OpenThreads::Mutex * | getGlobalReferencedMutex () |
static void | setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting) |
static bool | getThreadSafeReferenceCounting () |
static void | setDeleteHandler (DeleteHandler *handler) |
static DeleteHandler * | getDeleteHandler () |
Protected Member Functions | |
virtual | ~ApplicationUsage () |
![]() | |
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 |
![]() | |
OpenThreads::AtomicPtr | _observerSet |
OpenThreads::Atomic | _refCount |
Definition at line 25 of file ApplicationUsage.h.
typedef std::map<std::string,std::string> osg::ApplicationUsage::UsageMap |
Definition at line 35 of file ApplicationUsage.h.
Enumerator | |
---|---|
NO_HELP | |
COMMAND_LINE_OPTION | |
ENVIRONMENTAL_VARIABLE | |
KEYBOARD_MOUSE_BINDING | |
HELP_ALL |
Definition at line 47 of file ApplicationUsage.h.
|
inline |
Definition at line 31 of file ApplicationUsage.h.
osg::ApplicationUsage::ApplicationUsage | ( | const std::string & | commandLineUsage | ) |
|
inlineprotectedvirtual |
Definition at line 98 of file ApplicationUsage.h.
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 | ||
) |
|
inline |
Definition at line 40 of file ApplicationUsage.h.
|
inline |
Definition at line 65 of file ApplicationUsage.h.
|
inline |
Definition at line 68 of file ApplicationUsage.h.
|
inline |
Definition at line 59 of file ApplicationUsage.h.
|
inline |
Definition at line 45 of file ApplicationUsage.h.
|
inline |
Definition at line 74 of file ApplicationUsage.h.
|
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() |
||
) |
|
inline |
Definition at line 85 of file ApplicationUsage.h.
|
static |
|
inline |
The ApplicationName is often displayed when logging errors, and frequently incorporated into the Description (below).
Definition at line 39 of file ApplicationUsage.h.
Definition at line 64 of file ApplicationUsage.h.
Definition at line 67 of file ApplicationUsage.h.
|
inline |
Definition at line 58 of file ApplicationUsage.h.
|
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.
Definition at line 73 of file ApplicationUsage.h.
Definition at line 76 of file ApplicationUsage.h.
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 | ) |
|
protected |
Definition at line 100 of file ApplicationUsage.h.
|
protected |
Definition at line 103 of file ApplicationUsage.h.
|
protected |
Definition at line 107 of file ApplicationUsage.h.
|
protected |
Definition at line 102 of file ApplicationUsage.h.
|
protected |
Definition at line 101 of file ApplicationUsage.h.
|
protected |
Definition at line 104 of file ApplicationUsage.h.
|
protected |
Definition at line 106 of file ApplicationUsage.h.
|
protected |
Definition at line 105 of file ApplicationUsage.h.