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.
std::string typeName () const
 Return the name of the type.
bool same (const any &other) const
 Return if two any objects are the same or not.
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::string toString (const any &rhs)
 Converts the value in any to a std::string.
bool operator== (const any &a, const any &b)
 Returns true if two any objects have the same value.
bool operator!= (const any &a, const any &b)
 Returns true if two any objects do not have the same value.
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 43 of file Teuchos_any.hpp.


Constructor & Destructor Documentation

Teuchos::any::any (  )  [inline]

Empty constructor.

Definition at line 47 of file Teuchos_any.hpp.

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

Templated constructor.

Definition at line 53 of file Teuchos_any.hpp.

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

Copy constructor.

Definition at line 58 of file Teuchos_any.hpp.

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

Destructor.

Definition at line 63 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 69 of file Teuchos_any.hpp.

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

Copy the value rhs.

Definition at line 77 of file Teuchos_any.hpp.

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

Copy the value held in rhs.

Definition at line 84 of file Teuchos_any.hpp.

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

Return true if nothing is being stored.

Definition at line 91 of file Teuchos_any.hpp.

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

Return the type of value being stored.

Definition at line 97 of file Teuchos_any.hpp.

std::string Teuchos::any::typeName (  )  const [inline]

Return the name of the type.

Definition at line 103 of file Teuchos_any.hpp.

bool Teuchos::any::same ( const any other  )  const [inline]

Return if two any objects are the same or not.

Definition at line 109 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 122 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 Teuchos::bad_any_cast std::exception is thrown.

Definition at line 222 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 258 of file Teuchos_any.hpp.

std::string toString ( const any rhs  )  [related]

Converts the value in any to a std::string.

Write XMLObject to std::string.

Convert an array to a string representation.

Definition at line 266 of file Teuchos_any.hpp.

bool operator== ( const any a,
const any b 
) [related]

Returns true if two any objects have the same value.

Return true if two RCP objects point to the same referenced-counted object and have the same node.

rng1 == rng2.

Return true if two Ptr objects point to the same object.

Returns true if two parameter lists are the same.

Returns true if two ParameterEntry objects are equal.

Equality operator.

Returns:
Returns rng1.lbound() == rng2.ubound() && rng1.ubound() == rng2.ubound().

Definition at line 276 of file Teuchos_any.hpp.

bool operator!= ( const any a,
const any b 
) [related]

Returns true if two any objects do not have the same value.

Return true if two RCP objects do not point to the same referenced-counted object and have the same node.

Return true if two Ptr objects do not point to the same object.

Returns true if two parameter lists are not the same.

Returns true if two ParameterEntry objects are not equal.

Non-equality operator.

Definition at line 284 of file Teuchos_any.hpp.

std::ostream & operator<< ( std::ostream &  out,
const any rhs 
) [related]

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

Write XMLObject to os stream.

Ouput stream operator for RCPNodeHandle.

Output stream operator for handling the printing of the parameter list.

Output stream operator for handling the printing of parameter entries.

Write Hashtable to a stream.

Write HashSet to a stream.

Output stream inserter.

Write an Array to an ostream.

This prints arrays in the form:


 { 1.0, 2.0, 3.0 }

 

The implementation of this function just print pointer addresses and therefore puts not restrictions on the data types involved.

The implementation of this function just prints pointer addresses and therefore puts no restrictions on the data types involved.

Output stream operator for handling the printing of Object.

The implementation of this function just print pointer addresses and therefore puts no restrictions on the data types involved.

Definition at line 292 of file Teuchos_any.hpp.


Member Data Documentation

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

Definition at line 200 of file Teuchos_any.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Tue Oct 20 10:14:02 2009 for Teuchos Package Browser (Single Doxygen Collection) by  doxygen 1.6.1