SAMRAI::hier::VariableContext Class Reference

#include <source/hierarchy/variables/VariableContext.h>

List of all members.

Public Member Functions

 VariableContext (const std::string &name)
virtual ~VariableContext ()
int getIndex () const
const std::string & getName () const
bool operator== (const VariableContext &other) const

Static Public Member Functions

static int getCurrentMaximumInstanceNumber ()


Detailed Description

Class VariableContext is a simple class that is used to manage variable storage in a meaningful, customizable manner. A variable context has a name string and a unique integer instance identifier. Context objects are typically generated and used by the variable database for mapping names to storage locations, but they may also be created independently of the variable database.

SAMRAI applications use contexts and the variable database to manage patch storage locations for variables. For example, an integration algorithm may require multiple unique contexts to manage storage for a problem variable, such as "OLD" and "NEW". The algorithm interacts with the database to obtain the contexts and the mapping between the context and the patch descriptor index to access data on the patch hierarchy.

 * Important note:
 *
 *    It is strongly recommended that context objects be generated by 
 *    the variable database and obtained via the getContext() function.
 *    While contexts can be created by using the variable context 
 *    constructor directly and used with the database, this may produce 
 *    unexpected results due to potentially improperly generated and name 
 *    string context identifiers.
 *
 * 

See also:
hier::VariableDatabase


Constructor & Destructor Documentation

SAMRAI::hier::VariableContext::VariableContext ( const std::string &  name  ) 

The variable context constructor creates a context with the given name and increments the context index counter.

When assertion checking is active, an unrecoverable assertion results when the name string is empty.

SAMRAI::hier::VariableContext::~VariableContext (  )  [virtual]

The virtual destructor does nothing interesting.


Member Function Documentation

int SAMRAI::hier::VariableContext::getCurrentMaximumInstanceNumber (  )  [inline, static]

Return the current maximum instance number over all variable context objects. The instance identifiers returned from variable context objects are guaranteed to be between 0 and this number minus one. Note that this number changes as new variable contexts are created.

int SAMRAI::hier::VariableContext::getIndex (  )  const [inline]

Return integer index for VariableContext object.

const std::string & SAMRAI::hier::VariableContext::getName (  )  const [inline]

Return name string identifier for VariableContext object.

bool SAMRAI::hier::VariableContext::operator== ( const VariableContext other  )  const [inline]

Check whether two contexts are the same. Return true if the index of the argument context matches the index of this context object. Otherwise, return false.


The documentation for this class was generated from the following files:
Generated on Thu Jun 18 11:28:31 2009 for SAMRAI by  doxygen 1.5.1