Teuchos::ParameterEntry Class Reference

This object is held as the "value" in the Teuchos::ParameterList map. More...

#include <Teuchos_ParameterEntry.hpp>

List of all members.

Public Member Functions

Constructors/Destructor
 ParameterEntry ()
 Default Constructor.
 ParameterEntry (const ParameterEntry &source)
 Copy constructor.
template<typename T>
 ParameterEntry (T value, bool isDefault=false, bool isList=false)
 Templated constructor.
 ~ParameterEntry ()
 Destructor.
Set Methods
ParameterEntryoperator= (const ParameterEntry &source)
 Replace the current parameter entry with source.
template<typename T>
void setValue (T value, bool isDefault=false)
 Templated set method that uses the input value type to determine the type of parameter.
ParameterListsetList (bool isDefault=false)
 Create a parameter entry that is an empty list.
Get Methods
template<typename T>
T & getValue (T *ptr) const
 Templated get method that uses the input pointer type to determine the type of parameter to return.
anygetAny (bool activeQry=true)
 Direct access to the Teuchos::any data value underlying this object. The bool argument activeQry (default: true) indicates that the call to getAny() will set the isUsed() value of the ParameterEntry to true.
const anygetAny (bool activeQry=true) const
 Constant direct access to the Teuchos::any data value underlying this object. The bool argument activeQry (default: true) indicates that the call to getAny() will set the isUsed() value of the ParameterEntry to true.
Attribute/Query Methods
bool isUsed () const
 Return whether or not the value has been used; i.e., whether or not the value has been retrieved via a get function.
bool isList () const
 Return whether or not the value itself is a list.
template<typename T>
bool isType () const
 Test the type of the data being contained.
bool isDefault () const
 Indicate whether this entry takes on the default value.
I/O Methods
ostream & leftshift (ostream &os, bool printFlags=true) const
 Output a non-list parameter to the given output stream.

Related Functions

(Note that these are not member functions.)

template<typename T>
T & getValue (const ParameterEntry &entry)
 A templated helper function for returning the value of type T held in the ParameterEntry object, where the type T can be specified in the call. This is an easier way to call the getValue method in the ParameterEntry class, since the user does not have to pass in a pointer of type T.
bool operator== (const ParameterEntry &e1, const ParameterEntry &e2)
 Returns true if two ParameterEntry objects are equal.
bool operator!= (const ParameterEntry &e1, const ParameterEntry &e2)
 Returns true if two ParameterEntry objects are not equal.
ostream & operator<< (ostream &os, const ParameterEntry &e)
 Output stream operator for handling the printing of parameter entries.


Detailed Description

This object is held as the "value" in the Teuchos::ParameterList map.

This structure holds a Teuchos::any value and information on the status of this parameter (isUsed, isDefault, etc.). The type of parameter is chosen through the templated Set/Get methods.

Definition at line 52 of file Teuchos_ParameterEntry.hpp.


Constructor & Destructor Documentation

ParameterEntry::ParameterEntry  ) 
 

Default Constructor.

Definition at line 35 of file Teuchos_ParameterEntry.cpp.

ParameterEntry::ParameterEntry const ParameterEntry source  ) 
 

Copy constructor.

Definition at line 42 of file Teuchos_ParameterEntry.cpp.

template<typename T>
Teuchos::ParameterEntry::ParameterEntry value,
bool  isDefault = false,
bool  isList = false
[inline, explicit]
 

Templated constructor.

Definition at line 215 of file Teuchos_ParameterEntry.hpp.

Teuchos::ParameterEntry::~ParameterEntry  )  [inline]
 

Destructor.

Definition at line 223 of file Teuchos_ParameterEntry.hpp.


Member Function Documentation

ParameterEntry & ParameterEntry::operator= const ParameterEntry source  ) 
 

Replace the current parameter entry with source.

Definition at line 47 of file Teuchos_ParameterEntry.cpp.

template<typename T>
void Teuchos::ParameterEntry::setValue value,
bool  isDefault = false
[inline]
 

Templated set method that uses the input value type to determine the type of parameter.

Note:
  • Invalidates any previous values stored by this object although it doesn't necessarily erase them.
  • Resets 'isUsed' functionality.

Definition at line 230 of file Teuchos_ParameterEntry.hpp.

ParameterList & ParameterEntry::setList bool  isDefault = false  ) 
 

Create a parameter entry that is an empty list.

Definition at line 60 of file Teuchos_ParameterEntry.cpp.

template<typename T>
T & Teuchos::ParameterEntry::getValue T *  ptr  )  const [inline]
 

Templated get method that uses the input pointer type to determine the type of parameter to return.

Note:
This method will cast the value to the type requested. If that type is incorrect, an exception will be thrown by the any_cast.

Definition at line 240 of file Teuchos_ParameterEntry.hpp.

any & Teuchos::ParameterEntry::getAny bool  activeQry = true  )  [inline]
 

Direct access to the Teuchos::any data value underlying this object. The bool argument activeQry (default: true) indicates that the call to getAny() will set the isUsed() value of the ParameterEntry to true.

Definition at line 247 of file Teuchos_ParameterEntry.hpp.

const any & Teuchos::ParameterEntry::getAny bool  activeQry = true  )  const [inline]
 

Constant direct access to the Teuchos::any data value underlying this object. The bool argument activeQry (default: true) indicates that the call to getAny() will set the isUsed() value of the ParameterEntry to true.

Definition at line 256 of file Teuchos_ParameterEntry.hpp.

bool Teuchos::ParameterEntry::isUsed  )  const [inline]
 

Return whether or not the value has been used; i.e., whether or not the value has been retrieved via a get function.

Definition at line 267 of file Teuchos_ParameterEntry.hpp.

bool Teuchos::ParameterEntry::isList  )  const [inline]
 

Return whether or not the value itself is a list.

Definition at line 271 of file Teuchos_ParameterEntry.hpp.

template<typename T>
bool Teuchos::ParameterEntry::isType  )  const [inline]
 

Test the type of the data being contained.

Definition at line 276 of file Teuchos_ParameterEntry.hpp.

bool Teuchos::ParameterEntry::isDefault  )  const [inline]
 

Indicate whether this entry takes on the default value.

Definition at line 280 of file Teuchos_ParameterEntry.hpp.

ostream & ParameterEntry::leftshift ostream &  os,
bool  printFlags = true
const
 

Output a non-list parameter to the given output stream.

The parameter is followed by "[default]" if it is the default value given through a Set method. Otherwise, if the parameter was unused (not accessed through a Get method), it will be followed by "[unused]". This function is called by the "ostream& operator<<".

Definition at line 76 of file Teuchos_ParameterEntry.cpp.


Friends And Related Function Documentation

template<typename T>
T & getValue const ParameterEntry entry  )  [related]
 

A templated helper function for returning the value of type T held in the ParameterEntry object, where the type T can be specified in the call. This is an easier way to call the getValue method in the ParameterEntry class, since the user does not have to pass in a pointer of type T.

Definition at line 174 of file Teuchos_ParameterEntry.hpp.

bool operator== const ParameterEntry e1,
const ParameterEntry e2
[related]
 

Returns true if two ParameterEntry objects are equal.

Definition at line 182 of file Teuchos_ParameterEntry.hpp.

bool operator!= const ParameterEntry e1,
const ParameterEntry e2
[related]
 

Returns true if two ParameterEntry objects are not equal.

Definition at line 195 of file Teuchos_ParameterEntry.hpp.

ostream & operator<< ostream &  os,
const ParameterEntry e
[related]
 

Output stream operator for handling the printing of parameter entries.

Definition at line 203 of file Teuchos_ParameterEntry.hpp.


The documentation for this class was generated from the following files:
Generated on Thu Sep 18 12:30:32 2008 for Teuchos - Trilinos Tools Package by doxygen 1.3.9.1