Teuchos::any Class Reference

Modified boost::any class, which is a container for a templated value. More...

#include <Teuchos_any.hpp>

List of all members.

Public Member Functions

 any ()
 Empty constructor.
template<typename ValueType>
 any (const ValueType &value)
 Templated constructor.
 any (const any &other)
 Copy constructor.
 ~any ()
 Destructor.
anyswap (any &rhs)
 Method for swapping the contents of two any classes.
template<typename ValueType>
anyoperator= (const ValueType &rhs)
 Copy the value rhs.
anyoperator= (const any &rhs)
 Copy the value held in rhs.
bool empty () const
 Return true if nothing is being stored.
const std::type_info & type () const
 Return the type of value being stored.
void print (std::ostream &os) const
 Print this value to the output stream os.

Private Attributes

placeholder * content

Related Functions

(Note that these are not member functions.)

template<typename ValueType>
ValueType & any_cast (any &operand)
 Used to extract the templated value held in Teuchos::any to a given value type.
template<typename ValueType>
const ValueType & any_cast (const any &operand)
 Used to extract the const templated value held in Teuchos::any to a given const value type.
std::ostream & operator<< (std::ostream &os, const any &rhs)
 Writes "any" input rhs to the output stream os.


Detailed Description

Modified boost::any class, which is a container for a templated value.

Definition at line 47 of file Teuchos_any.hpp.


Constructor & Destructor Documentation

Teuchos::any::any  )  [inline]
 

Empty constructor.

Definition at line 51 of file Teuchos_any.hpp.

template<typename ValueType>
Teuchos::any::any const ValueType &  value  )  [inline]
 

Templated constructor.

Definition at line 57 of file Teuchos_any.hpp.

Teuchos::any::any const any other  )  [inline]
 

Copy constructor.

Definition at line 62 of file Teuchos_any.hpp.

Teuchos::any::~any  )  [inline]
 

Destructor.

Definition at line 67 of file Teuchos_any.hpp.


Member Function Documentation

any& Teuchos::any::swap any rhs  )  [inline]
 

Method for swapping the contents of two any classes.

Definition at line 73 of file Teuchos_any.hpp.

template<typename ValueType>
any& Teuchos::any::operator= const ValueType &  rhs  )  [inline]
 

Copy the value rhs.

Definition at line 81 of file Teuchos_any.hpp.

any& Teuchos::any::operator= const any rhs  )  [inline]
 

Copy the value held in rhs.

Definition at line 88 of file Teuchos_any.hpp.

bool Teuchos::any::empty  )  const [inline]
 

Return true if nothing is being stored.

Definition at line 95 of file Teuchos_any.hpp.

const std::type_info& Teuchos::any::type  )  const [inline]
 

Return the type of value being stored.

Definition at line 101 of file Teuchos_any.hpp.

void Teuchos::any::print std::ostream &  os  )  const [inline]
 

Print this value to the output stream os.

Definition at line 107 of file Teuchos_any.hpp.


Friends And Related Function Documentation

template<typename ValueType>
ValueType & any_cast any operand  )  [related]
 

Used to extract the templated value held in Teuchos::any to a given value type.

Note:
  • If the templated value type and templated type are not the same then a bad_any_cast is thrown.
  • If the dynamic cast fails, then a logic_error is thrown.

Definition at line 189 of file Teuchos_any.hpp.

template<typename ValueType>
const ValueType & any_cast const any operand  )  [related]
 

Used to extract the const templated value held in Teuchos::any to a given const value type.

Note:
  • If the templated value type and templated type are not the same then a bad_any_cast is thrown.
  • If the dynamic cast fails, then a logic_error is thrown.

Definition at line 218 of file Teuchos_any.hpp.

std::ostream & operator<< std::ostream &  os,
const any rhs
[related]
 

Writes "any" input rhs to the output stream os.

Definition at line 227 of file Teuchos_any.hpp.


Member Data Documentation

placeholder* Teuchos::any::content [private]
 

Definition at line 167 of file Teuchos_any.hpp.


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