GlobalTable Class Reference

This class reads, sets and prints CLI's global variable values. More...

#include <GlobalTable.h>

List of all members.

Static Public Member Functions

static void get_value (AData *var, const char *type_str=0)
 This grabs the value from the global variable's memory location, and places the value in the AData object passed in.
static bool get_variable (const char *var, AData *value)
 Looks up the global table for a variable with the given name.
static void set_variable (const char *var, AData *value)
 Looks up the global variable table for a variable with the given name, and sets the value if it exists.
static bool print_value (const char *var, ostream &outputstream)
 Prints out the value of the variable to the given stream.
static void print_all_values (ostream &outputstream)
 Prints out the values of all global variables to the console.
static vector< string > get_all_variable_names ()
 Returns all the global variable names.


Detailed Description

This class reads, sets and prints CLI's global variable values.

It reads and modifies the array automatically created by the stylized comment processor. Input and output is done using the AData class.


Member Function Documentation

static void GlobalTable::get_value ( AData var,
const char *  type_str = 0 
) [static]

This grabs the value from the global variable's memory location, and places the value in the AData object passed in.

AData.data.pval should point to the global variable's memory location, the AData.type field should be set to the global variable's type, and where

static bool GlobalTable::get_variable ( const char *  var,
AData value 
) [static]

Looks up the global table for a variable with the given name.

If the variable exist, the method returns non-zero, and the value is returned in the AData object. Otherwise, zero is returned.

static void GlobalTable::set_variable ( const char *  var,
AData value 
) [static]

Looks up the global variable table for a variable with the given name, and sets the value if it exists.

Exceptions are thrown when the type of value and variable do not match, or where the variable doesn't exist.

static bool GlobalTable::print_value ( const char *  var,
ostream &  outputstream 
) [static]

Prints out the value of the variable to the given stream.

Returns non-zero if successful, and zero otherwise.


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

Send suggestions, questions, and feedback to WEINBERG at ASTRO dot UMASS dot EDU.
Documentation generated at Fri Mar 26 00:35:11 2010 by doxygen