ALPS MPS Codes
Reference documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Friends | List of all members
parameters::proxy Class Reference

#include <parameter_proxy.h>

Public Member Functions

 proxy (std::string &val)
 
template<typename T >
as () const
 
template<typename T >
 operator T () const
 
bool operator== (proxy const &rhs) const
 
bool operator== (const char *rhs) const
 
bool operator!= (const char *rhs) const
 
template<typename T >
proxyoperator= (T const &new_val)
 
std::string const & str () const
 
const char * c_str () const
 
bool empty () const
 

Friends

std::ostream & operator<< (std::ostream &os, proxy const &p)
 

Detailed Description

Definition at line 97 of file parameter_proxy.h.

Constructor & Destructor Documentation

parameters::proxy::proxy ( std::string &  val)
inline

Definition at line 99 of file parameter_proxy.h.

99 : val_(val) { }

Member Function Documentation

template<typename T >
T parameters::proxy::as ( ) const
inline

Definition at line 102 of file parameter_proxy.h.

103  {
104  conversion::get_<T> g;
105  return g(val_);
106  }
const char* parameters::proxy::c_str ( ) const
inline

Definition at line 141 of file parameter_proxy.h.

142  {
143  return val_.c_str();
144  }
bool parameters::proxy::empty ( ) const
inline

Definition at line 146 of file parameter_proxy.h.

147  {
148  return val_.empty();
149  }
template<typename T >
parameters::proxy::operator T ( ) const
inline

Definition at line 109 of file parameter_proxy.h.

110  {
111  return as<T>();
112  }
bool parameters::proxy::operator!= ( const char *  rhs) const
inline

Definition at line 124 of file parameter_proxy.h.

125  {
126  return ( val_ != std::string(rhs) );
127  }
template<typename T >
proxy& parameters::proxy::operator= ( T const &  new_val)
inline

Definition at line 130 of file parameter_proxy.h.

131  {
132  val_ = boost::lexical_cast<std::string>(new_val);
133  return *this;
134  }
bool parameters::proxy::operator== ( proxy const &  rhs) const
inline

Definition at line 114 of file parameter_proxy.h.

115  {
116  return ( val_ == rhs.val_ );
117  }
bool parameters::proxy::operator== ( const char *  rhs) const
inline

Definition at line 119 of file parameter_proxy.h.

120  {
121  return ( val_ == std::string(rhs) );
122  }
std::string const& parameters::proxy::str ( ) const
inline

Definition at line 136 of file parameter_proxy.h.

137  {
138  return val_;
139  }

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
proxy const &  p 
)
friend

Definition at line 188 of file parameter_proxy.h.

189  {
190  os << p.val_;
191  return os;
192  }

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