CARMA C++
carma::util::Program Class Reference

Class for managing resources and interfaces common across all carma programs. More...

#include <carma/util/Program.h>

Inheritance diagram for carma::util::Program:
carma::util::ProgramBase

Static Public Member Functions

static ProgramgetProgram ()
 Class static method to get the process-wide singleton instance of Program. More...
 
- Static Public Member Functions inherited from carma::util::ProgramBase
::std::string getArg0 ()
 Get the first argument passed to main() More...
 
::std::string getConfDir ()
 Get the configuration directory - assumes standard carma tree. More...
 
::std::string getConfFile (const ::std::string &filename)
 Get the absolute path of a configuration file. More...
 
::std::string getCwd ()
 Get the current working directory. More...
 
::std::string getExecutable ()
 Get absolute full path of executable. More...
 
::std::string getExecutableDir ()
 Get the directory where this program binary lives. More...
 
static int getExtraArgc ()
 Obtain the length of the array of command line arguments with all CARMA arguments removed. More...
 
static char ** getExtraArgv ()
 Obtain the array of command line arguments with all CARMA arguments removed. More...
 
::std::string getHostname (bool shorten)
 Get hostname of the machine this program is running on. More...
 
static log4cpp::Category & getLogger ()
 Returns a reference to the process-wide default logger. More...
 
static log4cpp::Category * getLoggerIfAvailable ()
 
static pid_t getPid ()
 Get pid of this program. More...
 
::std::string getRootDir ()
 Get the root build or install directory - assumes standard carma tree. More...
 
static carma::util::TracegetTraceObject ()
 
static carma::util::TracegetTraceObjectIfAvailable ()
 
static bool getUseDBMS ()
 Returns value of system keyword "useDBMS". More...
 

Friends

class ProgramBase
 

Additional Inherited Members

- Public Member Functions inherited from carma::util::ProgramBase
void adjustTraceLevel (int newTraceLevel)
 
bool DebugLevel (int level=0) const
 has a debug level exceeded the set value? More...
 
bool getBoolParameter (const ::std::string &key)
 get value of a bool parameter More...
 
carma::corba::ClientgetCorbaClient ()
 
carma::corba::ServergetCorbaServer ()
 
int getDebugLevel () const
 debug level of the program environment More...
 
double getDoubleParameter (const ::std::string &key)
 get value of a double parameter More...
 
::std::string getImrHostname () const
 Retrieve the imr hostname. More...
 
int getIntParameter (const ::std::string &key)
 get value of an int parameter More...
 
::std::string getLogHostname () const
 Gets hostname of machine that stores the log file. More...
 
::std::string getLogname () const
 get the log name of for the logger of this Progam More...
 
int getNiceLevel () const
 
::std::string getParameterRawValueString (const ::std::string &key)
 get the raw value string of a parameter More...
 
::std::string getStringParameter (const ::std::string &key)
 get value of a string parameter More...
 
int getTraceLevel () const
 
::std::string getUsageString () const
 Get the usage string for this program. More...
 
bool getUseGMT () const
 
bool haveImrHostname () const
 Was imr hostname specified on the commmand line? More...
 
bool imrTerminationRequested ()
 Check for an IMR instructed termination request. More...
 
bool orbInit (Orb *orb)
 Set ORB parameters. More...
 
bool parameterWasSpecified (const ::std::string &key)
 Query whether the value of the parameter was specified on the command line. More...
 
void setInstanceLogname (const ::std::string &logname)
 set the logger logname for this instance of a Program More...
 
- Protected Member Functions inherited from carma::util::ProgramBase
 ProgramBase ()
 Default constructor. More...
 
 ~ProgramBase ()
 Destructor. More...
 

Detailed Description

Class for managing resources and interfaces common across all carma programs.

Singleton class - only one instance per process.

Definition at line 645 of file Program.h.

Member Function Documentation

static Program& carma::util::Program::getProgram ( )
static

Class static method to get the process-wide singleton instance of Program.

Class static method that returns a reference to the process-wide single instance of class Program. Basically a factory method that is tailored to return the same instance for every call.

Returns
Reference to the singleton instance.
See Also
Singleton pattern in "Design Patterns", by Gamma, Helm, Johnson, and Vlissides.

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