My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
gcp::program::Program Class Reference

Public Member Functions

virtual ~Program ()
 
void show (void)
 
std::string getParameter (std::string key)
 get string value of a parameter More...
 
double getdParameter (std::string key)
 get double value of a parameter More...
 
int getiParameter (std::string key)
 get int value of a parameter More...
 
bool getbParameter (std::string key)
 get boolean value of a parameter More...
 
bool hasValue (std::string key)
 does keyword have a value More...
 
bool isDefault (std::string key)
 
int count (std::string key)
 usage count of a keyword More...
 
int run (int argc, char *argv[])
 

Static Public Member Functions

static ProgramgetProgram ()
 Class global method to get the process-wide singleton instance of Program. More...
 

Static Public Attributes

static KeyTabEntry keywords []
 

Constructor & Destructor Documentation

Program::~Program ( )
virtual

Destructor.

....................................................................... Destructor.

Member Function Documentation

int Program::count ( std::string  key)

usage count of a keyword

Returns
number of times a keyword has been accessed

....................................................................... Count the number of keywords

bool Program::getbParameter ( std::string  key)

get boolean value of a parameter

Returns
boolean value of a parameter

....................................................................... Return the value of a boolean keyword

double Program::getdParameter ( std::string  key)

get double value of a parameter

Returns
double value of a parameter

....................................................................... Return the value of a double keyword

int Program::getiParameter ( std::string  key)

get int value of a parameter

Returns
int value of a parameter

....................................................................... Return the value of an integer keyword

string Program::getParameter ( std::string  key)

get string value of a parameter

Returns
string value of a parameter

....................................................................... Return the string version of a keyword

Program * Program::getProgram ( )
static

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

Class global 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
Program& - reference to the singleton instance of class carma::util::Program.
See Also
Singleton pattern in "Design Patterns", by Gamma, Helm, Johnson, and Vlissides.

....................................................................... Get a pointer to a static instance of the Program class

bool Program::hasValue ( std::string  key)

does keyword have a value

Returns
does the keyword have a non-blank (assigned) value

....................................................................... Return true if the named key has a value.

bool Program::isDefault ( std::string  key)
Returns
has the keyword been used above their default definition After keywords are instantiated from a KeyTabEntry (as defined by the author of the program),

....................................................................... Return true if the named key has its default value

int Program::run ( int  argc,
char *  argv[] 
)

Run a program

....................................................................... Run a program

void Program::show ( void  )

debugging routine

....................................................................... Show a listing of this program

Member Data Documentation

KeyTabEntry Program::keywords
static
Initial value:
= {
{ "host", "localhost", "s", "mediator host"},
{ "simpmac", "f", "b", "Simulate having a PMAC?"},
{ "simgpib", "f", "b", "Simulate having a GPIB network?"},
{ "simdlp", "f", "b", "Simulate having a DLP temperature sensor bus?"},
{ "useprio", "f", "b", "Run in privileged mode?"},
{ "simlna", "f", "b", "Simulate having a LNA temperature sensor bus?"},
{ "simadc", "f", "b", "Simulate the Labjack ADC?"},
{ "simroach1", "f", "b", "Simulate having roach1?"},
{ "simroach2", "f", "b", "Simulate having roach2?"},
{ END_OF_KEYWORDS},
}

Static array of user-defined keywords


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