Sandia Home Sandia Home
Main Page | Publications | Downloads | Configuration | Running the Code | Solver Parameters | FAQ | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

APPSPACK::Parameter::Entry Class Reference

#include <APPSPACK_Parameter_Entry.hpp>

Collaboration diagram for APPSPACK::Parameter::Entry:

Collaboration graph
[legend]
List of all members.

Detailed Description

Stores a List of parameters or a single parameter, which can be a bool, int, double, string, APPSPACK::Vector. For any single parameter, two attributes are tracked:
  1. Used (isGotten): True if it has been accessed by a "get" function (mutable)
  2. Default (isSetByGet): True if it was set by a "get" function

The "Used" parameter is mutable, which means it can be changed even for a const Entry.

Definition at line 64 of file APPSPACK_Parameter_Entry.hpp.

Public Member Functions

Constructors / Destructor
The "Used" parameter is set to false. The "Default" parameter is set to false, unless the optional second argument is true.

 Entry ()
 Create an empty Entry that doesn't contain anything.
 Entry (const Entry &source)
 Copy constructor.
 Entry (bool value, bool isCreatedByGet=false)
 Create an Entry containing a bool.
 Entry (int value, bool isCreatedByGet=false)
 Create an Entry containing an int.
 Entry (double value, bool isCreatedByGet=false)
 Create an Entry containing a double.
 Entry (const string &value, bool isCreatedByGet=false)
 Create an Entry containing a string.
 Entry (const Vector &value, bool isCreatedByGet=false)
 Create an Entry containing a ::Vector.
 ~Entry ()
 Destructor.
Copy
Entryoperator= (const Entry &source)
 Copy an entry.
Sublists
Functions for handling parameters that are themselves lists.

ListsetList (bool isCreatedByGet=false)
 Create a sublist. Sets "Default" according to the optional argument. Sets "Used" to false.
ListgetListValue ()
 Extract the reference to the list that is stored in the Entry. Set "Used" to true.
const ListgetListValue () const
 Extract the reference to the list that is stored in the Entry. Set "Used" to true.
Set functions.
Similar to the corresponding constructors. Completely erases the old entry. The "Used" parameter is (re-)set to false. The "Default" parameter is set to false, unless the optional second argument is true.

void setValue (bool value, bool isCreatedByGet=false)
 Set bool value.
void setValue (int value, bool isCreatedByGet=false)
 Set int value.
void setValue (double value, bool isCreatedByGet=false)
 Set double value.
void setValue (const char *value, bool isCreatedByGet=false)
 Set string value.
void setValue (const string &value, bool isCreatedByGet=false)
 Set string value.
void setValue (const Vector &value, bool isCreatedByGet=false)
 Set ::Vector value.
void setValue (const Matrix &value, bool isCreatedByGet=false)
 Set Matrix value.
Is functions.
Return true if the parameter is of the specified type; otherwise, return false. Has no affect on "Default" or "Used" status.

bool isBool () const
 Return true for bool entry.
bool isInt () const
 Return true for int entry.
bool isDouble () const
 Return true for double entry.
bool isString () const
 Return true for string entry.
bool isList () const
 Return true for list entry (i.e., a sublist).
bool isVector () const
 Return true for ::Vector entry.
bool isMatrix () const
 Return true for matrix entry.
Get functions.
Returns the value of the Entry. Sets "Used" to true. Does not affect "Default" bit.

Note:
This will not thrown an error if the type of get does not match the type of Entry. Use with caution.


bool getBoolValue () const
 Get bool value.
int getIntValue () const
 Get int value.
double getDoubleValue () const
 Get double value.
const string & getStringValue () const
 Get string value.
const VectorgetVectorValue () const
 Get ::Vector value.
const MatrixgetMatrixValue () const
 Get Vector value.
Pack/Unpack
Used by parallel version of APPSPACK to pack and unpack parameter lists for message passing. Uses APPSPACK::GCI functionality.

Note:
Only works if MPI is enabled at configure time; see MPI Configure Options.


void pack () const
 Pack the Entry.
void unpack ()
 Unpack the Entry.
Printing
ostream & leftshift (ostream &stream) const
 Output the parameter to the given stream.

Private Types

enum  EntryType {
  APPSPACK_NONE, APPSPACK_BOOL, APPSPACK_INT, APPSPACK_DOUBLE,
  APPSPACK_STRING, APPSPACK_LIST, APPSPACK_VECTOR, APPSPACK_MATRIX
}
 All possible parameter types that this class can store. More...

Private Member Functions

void reset ()
 Reset the entry.

Private Attributes

EntryType type
 Type of parameter stored in this object.
bool bval
 Boolean value, if this is of type BOOL.
int ival
 Integer value, if this is of type INT.
double dval
 Double value, if this is of type DOUBLE.
string sval
 String value, if this is of type STRING.
Listlval
 Pointer to list, if this is of type LIST.
Vector vectorval
 Vector value.
Matrix matrixval
 Matrix value.
bool isGotten
 True if this parameter been accessed by a "get" function.
bool isSetByGet
 True if this parameter is a nominal value assigned by a "get" function.


Member Enumeration Documentation

enum APPSPACK::Parameter::Entry::EntryType [private]
 

All possible parameter types that this class can store.

Enumeration values:
APPSPACK_NONE  No entry type set yet (will be set later by setValue().
APPSPACK_BOOL  Boolean.
APPSPACK_INT  Integer.
APPSPACK_DOUBLE  Double.
APPSPACK_STRING  String.
APPSPACK_LIST  Sublist (APPSPACK::Parameter::List).
APPSPACK_VECTOR  APPSPACK::Vector.
APPSPACK_MATRIX  APPSPACK::Matrix.

Definition at line 226 of file APPSPACK_Parameter_Entry.hpp.


Constructor & Destructor Documentation

APPSPACK::Parameter::Entry::Entry  ) 
 

Create an empty Entry that doesn't contain anything.

Definition at line 42 of file APPSPACK_Parameter_Entry.cpp.

APPSPACK::Parameter::Entry::Entry const Entry source  ) 
 

Copy constructor.

Definition at line 55 of file APPSPACK_Parameter_Entry.cpp.

References operator=().

APPSPACK::Parameter::Entry::Entry bool  value,
bool  isCreatedByGet = false
 

Create an Entry containing a bool.

Definition at line 95 of file APPSPACK_Parameter_Entry.cpp.

APPSPACK::Parameter::Entry::Entry int  value,
bool  isCreatedByGet = false
 

Create an Entry containing an int.

Definition at line 108 of file APPSPACK_Parameter_Entry.cpp.

APPSPACK::Parameter::Entry::Entry double  value,
bool  isCreatedByGet = false
 

Create an Entry containing a double.

Definition at line 121 of file APPSPACK_Parameter_Entry.cpp.

APPSPACK::Parameter::Entry::Entry const string &  value,
bool  isCreatedByGet = false
 

Create an Entry containing a string.

Definition at line 134 of file APPSPACK_Parameter_Entry.cpp.

APPSPACK::Parameter::Entry::Entry const Vector value,
bool  isCreatedByGet = false
 

Create an Entry containing a ::Vector.

Definition at line 147 of file APPSPACK_Parameter_Entry.cpp.

APPSPACK::Parameter::Entry::~Entry  ) 
 

Destructor.

Definition at line 160 of file APPSPACK_Parameter_Entry.cpp.

References reset().


Member Function Documentation

APPSPACK::Parameter::Entry & APPSPACK::Parameter::Entry::operator= const Entry source  ) 
 

Copy an entry.

Definition at line 69 of file APPSPACK_Parameter_Entry.cpp.

References bval, dval, isGotten, isSetByGet, ival, lval, reset(), sval, type, and vectorval.

Referenced by Entry().

APPSPACK::Parameter::List & APPSPACK::Parameter::Entry::setList bool  isCreatedByGet = false  ) 
 

Create a sublist. Sets "Default" according to the optional argument. Sets "Used" to false.

Definition at line 232 of file APPSPACK_Parameter_Entry.cpp.

References isGotten, isSetByGet, lval, reset(), and type.

APPSPACK::Parameter::List & APPSPACK::Parameter::Entry::getListValue  ) 
 

Extract the reference to the list that is stored in the Entry. Set "Used" to true.

Definition at line 302 of file APPSPACK_Parameter_Entry.cpp.

References isGotten.

Referenced by APPSPACK::Parameter::List::print(), and APPSPACK::Parameter::List::sublist().

const APPSPACK::Parameter::List & APPSPACK::Parameter::Entry::getListValue  )  const
 

Extract the reference to the list that is stored in the Entry. Set "Used" to true.

Definition at line 308 of file APPSPACK_Parameter_Entry.cpp.

References isGotten.

void APPSPACK::Parameter::Entry::setValue bool  value,
bool  isCreatedByGet = false
 

Set bool value.

Definition at line 176 of file APPSPACK_Parameter_Entry.cpp.

References bval, isSetByGet, reset(), and type.

Referenced by APPSPACK::Parameter::List::getParameter().

void APPSPACK::Parameter::Entry::setValue int  value,
bool  isCreatedByGet = false
 

Set int value.

Definition at line 184 of file APPSPACK_Parameter_Entry.cpp.

References isSetByGet, ival, reset(), and type.

void APPSPACK::Parameter::Entry::setValue double  value,
bool  isCreatedByGet = false
 

Set double value.

Definition at line 192 of file APPSPACK_Parameter_Entry.cpp.

References dval, isSetByGet, reset(), and type.

void APPSPACK::Parameter::Entry::setValue const char *  value,
bool  isCreatedByGet = false
 

Set string value.

Definition at line 200 of file APPSPACK_Parameter_Entry.cpp.

References isSetByGet, reset(), sval, and type.

void APPSPACK::Parameter::Entry::setValue const string &  value,
bool  isCreatedByGet = false
 

Set string value.

Definition at line 208 of file APPSPACK_Parameter_Entry.cpp.

References isSetByGet, reset(), sval, and type.

void APPSPACK::Parameter::Entry::setValue const Vector value,
bool  isCreatedByGet = false
 

Set ::Vector value.

Definition at line 216 of file APPSPACK_Parameter_Entry.cpp.

References isSetByGet, reset(), type, and vectorval.

void APPSPACK::Parameter::Entry::setValue const Matrix value,
bool  isCreatedByGet = false
 

Set Matrix value.

Definition at line 224 of file APPSPACK_Parameter_Entry.cpp.

References isSetByGet, matrixval, reset(), and type.

bool APPSPACK::Parameter::Entry::isBool  )  const
 

Return true for bool entry.

Definition at line 243 of file APPSPACK_Parameter_Entry.cpp.

References type.

Referenced by APPSPACK::Parameter::List::getParameter(), APPSPACK::Parameter::List::isParameterBool(), and APPSPACK::Parameter::List::isParameterEqual().

bool APPSPACK::Parameter::Entry::isInt  )  const
 

Return true for int entry.

Definition at line 248 of file APPSPACK_Parameter_Entry.cpp.

References type.

Referenced by APPSPACK::Parameter::List::getParameter(), APPSPACK::Parameter::List::isParameterEqual(), and APPSPACK::Parameter::List::isParameterInt().

bool APPSPACK::Parameter::Entry::isDouble  )  const
 

Return true for double entry.

Definition at line 253 of file APPSPACK_Parameter_Entry.cpp.

References type.

Referenced by APPSPACK::Parameter::List::getDoubleParameter(), APPSPACK::Parameter::List::getParameter(), APPSPACK::Parameter::List::isParameterDouble(), and APPSPACK::Parameter::List::isParameterEqual().

bool APPSPACK::Parameter::Entry::isString  )  const
 

Return true for string entry.

Definition at line 258 of file APPSPACK_Parameter_Entry.cpp.

References type.

Referenced by APPSPACK::Parameter::List::getParameter(), APPSPACK::Parameter::List::isParameterEqual(), and APPSPACK::Parameter::List::isParameterString().

bool APPSPACK::Parameter::Entry::isList  )  const
 

Return true for list entry (i.e., a sublist).

Definition at line 263 of file APPSPACK_Parameter_Entry.cpp.

References type.

Referenced by APPSPACK::Parameter::List::isParameterSublist(), APPSPACK::Parameter::List::print(), and APPSPACK::Parameter::List::sublist().

bool APPSPACK::Parameter::Entry::isVector  )  const
 

Return true for ::Vector entry.

Definition at line 273 of file APPSPACK_Parameter_Entry.cpp.

References type.

Referenced by APPSPACK::Parameter::List::getParameter(), APPSPACK::Parameter::List::getVectorParameter(), APPSPACK::Parameter::List::isParameterEqual(), and APPSPACK::Parameter::List::isParameterVector().

bool APPSPACK::Parameter::Entry::isMatrix  )  const
 

Return true for matrix entry.

Definition at line 268 of file APPSPACK_Parameter_Entry.cpp.

References type.

Referenced by APPSPACK::Parameter::List::getMatrixParameter(), and APPSPACK::Parameter::List::isParameterMatrix().

bool APPSPACK::Parameter::Entry::getBoolValue  )  const
 

Get bool value.

Definition at line 278 of file APPSPACK_Parameter_Entry.cpp.

References isGotten.

Referenced by APPSPACK::Parameter::List::getParameter(), and APPSPACK::Parameter::List::isParameterEqual().

int APPSPACK::Parameter::Entry::getIntValue  )  const
 

Get int value.

Definition at line 284 of file APPSPACK_Parameter_Entry.cpp.

References isGotten.

Referenced by APPSPACK::Parameter::List::getParameter(), and APPSPACK::Parameter::List::isParameterEqual().

double APPSPACK::Parameter::Entry::getDoubleValue  )  const
 

Get double value.

Definition at line 290 of file APPSPACK_Parameter_Entry.cpp.

References isGotten.

Referenced by APPSPACK::Parameter::List::getDoubleParameter(), APPSPACK::Parameter::List::getParameter(), and APPSPACK::Parameter::List::isParameterEqual().

const string & APPSPACK::Parameter::Entry::getStringValue  )  const
 

Get string value.

Definition at line 296 of file APPSPACK_Parameter_Entry.cpp.

References isGotten.

Referenced by APPSPACK::Parameter::List::getParameter(), and APPSPACK::Parameter::List::isParameterEqual().

const APPSPACK::Vector & APPSPACK::Parameter::Entry::getVectorValue  )  const
 

Get ::Vector value.

Definition at line 314 of file APPSPACK_Parameter_Entry.cpp.

References isGotten.

Referenced by APPSPACK::Parameter::List::getParameter(), APPSPACK::Parameter::List::getVectorParameter(), and APPSPACK::Parameter::List::isParameterEqual().

const APPSPACK::Matrix & APPSPACK::Parameter::Entry::getMatrixValue  )  const
 

Get Vector value.

Definition at line 320 of file APPSPACK_Parameter_Entry.cpp.

References isGotten.

Referenced by APPSPACK::Parameter::List::getMatrixParameter().

void APPSPACK::Parameter::Entry::pack  )  const
 

Pack the Entry.

Definition at line 361 of file APPSPACK_Parameter_Entry.cpp.

References APPSPACK_BOOL, APPSPACK_DOUBLE, APPSPACK_INT, APPSPACK_LIST, APPSPACK_STRING, APPSPACK_VECTOR, bval, dval, isGotten, isSetByGet, ival, lval, APPSPACK::Parameter::List::pack(), sval, and vectorval.

Referenced by APPSPACK::Parameter::List::pack().

void APPSPACK::Parameter::Entry::unpack  ) 
 

Unpack the Entry.

Definition at line 398 of file APPSPACK_Parameter_Entry.cpp.

References APPSPACK_BOOL, APPSPACK_DOUBLE, APPSPACK_INT, APPSPACK_LIST, APPSPACK_STRING, APPSPACK_VECTOR, bval, dval, isGotten, isSetByGet, ival, lval, sval, type, APPSPACK::Parameter::List::unpack(), and vectorval.

Referenced by APPSPACK::Parameter::List::unpack().

ostream & APPSPACK::Parameter::Entry::leftshift ostream &  stream  )  const
 

Output the parameter to the given stream.

Formats the output as "<type,value>", except in the case of a list which just outputs "\<sublist\>". If the parameter has not yet been set, it outputs "\<NONE\>". This is the function called by the ostream operator<<.

Definition at line 326 of file APPSPACK_Parameter_Entry.cpp.

References APPSPACK_BOOL, APPSPACK_DOUBLE, APPSPACK_INT, APPSPACK_LIST, APPSPACK_STRING, APPSPACK_VECTOR, bval, and sval.

Referenced by operator<<().

void APPSPACK::Parameter::Entry::reset  )  [private]
 

Reset the entry.

Definition at line 165 of file APPSPACK_Parameter_Entry.cpp.

References isGotten, isSetByGet, lval, and type.

Referenced by operator=(), setList(), setValue(), and ~Entry().


Member Data Documentation

EntryType APPSPACK::Parameter::Entry::type [private]
 

Type of parameter stored in this object.

Definition at line 246 of file APPSPACK_Parameter_Entry.hpp.

Referenced by isBool(), isDouble(), isInt(), isList(), isMatrix(), isString(), isVector(), operator=(), reset(), setList(), setValue(), and unpack().

bool APPSPACK::Parameter::Entry::bval [private]
 

Boolean value, if this is of type BOOL.

Definition at line 249 of file APPSPACK_Parameter_Entry.hpp.

Referenced by leftshift(), operator=(), pack(), setValue(), and unpack().

int APPSPACK::Parameter::Entry::ival [private]
 

Integer value, if this is of type INT.

Definition at line 252 of file APPSPACK_Parameter_Entry.hpp.

Referenced by operator=(), pack(), setValue(), and unpack().

double APPSPACK::Parameter::Entry::dval [private]
 

Double value, if this is of type DOUBLE.

Definition at line 255 of file APPSPACK_Parameter_Entry.hpp.

Referenced by operator=(), pack(), setValue(), and unpack().

string APPSPACK::Parameter::Entry::sval [private]
 

String value, if this is of type STRING.

Definition at line 258 of file APPSPACK_Parameter_Entry.hpp.

Referenced by leftshift(), operator=(), pack(), setValue(), and unpack().

List* APPSPACK::Parameter::Entry::lval [private]
 

Pointer to list, if this is of type LIST.

Definition at line 261 of file APPSPACK_Parameter_Entry.hpp.

Referenced by operator=(), pack(), reset(), setList(), and unpack().

Vector APPSPACK::Parameter::Entry::vectorval [private]
 

Vector value.

Definition at line 264 of file APPSPACK_Parameter_Entry.hpp.

Referenced by operator=(), pack(), setValue(), and unpack().

Matrix APPSPACK::Parameter::Entry::matrixval [private]
 

Matrix value.

Definition at line 267 of file APPSPACK_Parameter_Entry.hpp.

Referenced by setValue().

bool APPSPACK::Parameter::Entry::isGotten [mutable, private]
 

True if this parameter been accessed by a "get" function.

Definition at line 270 of file APPSPACK_Parameter_Entry.hpp.

Referenced by getBoolValue(), getDoubleValue(), getIntValue(), getListValue(), getMatrixValue(), getStringValue(), getVectorValue(), operator=(), pack(), reset(), setList(), and unpack().

bool APPSPACK::Parameter::Entry::isSetByGet [mutable, private]
 

True if this parameter is a nominal value assigned by a "get" function.

Definition at line 273 of file APPSPACK_Parameter_Entry.hpp.

Referenced by operator=(), pack(), reset(), setList(), setValue(), and unpack().


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

 

© Sandia Corporation | Site Contact | Privacy and Security

Generated on Fri Feb 16 10:33:36 2007 for APPSPACK 5.0.1 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2002