StringParameter Class Reference

#include <StringParameter.hpp>

Inheritance diagram for StringParameter:

Inheritance graph
[legend]
Collaboration diagram for StringParameter:

Collaboration graph
[legend]

List of all members.

Public Types

enum  Type { Double, Integer, String, Enum }

Public Member Functions

void get (IdentifierSet &I)
 Does not add other identifiers.
void set (const real_t d)
void set (const int i)
void set (const char *c)
 operator std::string & ()
 operator const std::string & () const
const std::string typeName () const
 StringParameter (const StringParameter &sp)
 StringParameter (const std::string &s, const char *label)
 StringParameter (const char *c, const char *label)
 ~StringParameter ()
void set (const std::string &s)
const Typetype () const
const char * label () const

Protected Attributes

Type __type

Private Member Functions

void reset ()
std::ostream & put (std::ostream &os) const

Private Attributes

const std::string __defaultStringValue
std::string __stringValue

Friends

std::ostream & operator<< (std::ostream &os, const Parameter &P)


Detailed Description

This is the base describes String Parameters.

Author:
Stéphane Del Pino.

Definition at line 35 of file StringParameter.hpp.


Member Enumeration Documentation

enum Parameter::Type [inherited]

Enumerator:
Double 
Integer 
String 
Enum 

Definition at line 41 of file Parameter.hpp.

00041             {
00042     Double,
00043     Integer,
00044     String,
00045     Enum
00046   };


Constructor & Destructor Documentation

StringParameter::StringParameter ( const StringParameter sp  )  [inline]

Definition at line 96 of file StringParameter.hpp.

00097     : Parameter(sp),
00098       __defaultStringValue(sp.__defaultStringValue),
00099       __stringValue(sp.__stringValue)
00100   {
00101     ;
00102   }

StringParameter::StringParameter ( const std::string &  s,
const char *  label 
) [inline]

Definition at line 104 of file StringParameter.hpp.

00105     : Parameter(Parameter::String, label),
00106       __defaultStringValue(s),
00107       __stringValue(__defaultStringValue)
00108   {
00109     ;
00110   }

StringParameter::StringParameter ( const char *  c,
const char *  label 
) [inline]

Definition at line 112 of file StringParameter.hpp.

00113     : Parameter(Parameter::String, label),
00114       __defaultStringValue(c),
00115       __stringValue(__defaultStringValue)
00116   {
00117     ;
00118   }

StringParameter::~StringParameter (  )  [inline]

Definition at line 120 of file StringParameter.hpp.

00121   {
00122     ;
00123   }


Member Function Documentation

void StringParameter::reset (  )  [inline, private, virtual]

Implements Parameter.

Definition at line 39 of file StringParameter.hpp.

References __defaultStringValue, and __stringValue.

00040   {
00041     __stringValue = __defaultStringValue;
00042   }

std::ostream& StringParameter::put ( std::ostream &  os  )  const [inline, private, virtual]

Implements Parameter.

Definition at line 47 of file StringParameter.hpp.

References __stringValue.

00048   {
00049     os << __stringValue;
00050     return os;
00051   }

void StringParameter::get ( IdentifierSet I  )  [inline, virtual]

Does not add other identifiers.

Implements Parameter.

Definition at line 55 of file StringParameter.hpp.

00056   {
00057     ;
00058   }

void StringParameter::set ( const real_t  d  )  [inline, virtual]

Implements Parameter.

Definition at line 60 of file StringParameter.hpp.

References ErrorHandler::normal, and stringify().

00061   {
00062     throw ErrorHandler(__FILE__,__LINE__,
00063                        "cannot assignate the real value '"+stringify(d)
00064                        +"' to a string parameter",
00065                        ErrorHandler::normal);
00066   }

Here is the call graph for this function:

void StringParameter::set ( const int  i  )  [inline, virtual]

Implements Parameter.

Definition at line 68 of file StringParameter.hpp.

References ErrorHandler::normal, and stringify().

00069   {
00070     throw ErrorHandler(__FILE__,__LINE__,
00071                        "cannot assignate the integer value '"+stringify(i)
00072                        +"' to a string parameter",
00073                        ErrorHandler::normal);
00074   }

Here is the call graph for this function:

void StringParameter::set ( const char *  c  )  [inline, virtual]

Implements Parameter.

Definition at line 76 of file StringParameter.hpp.

References __stringValue.

00077   {
00078     __stringValue = c;
00079   }

StringParameter::operator std::string & (  )  [inline]

Definition at line 81 of file StringParameter.hpp.

References __stringValue.

00082   {
00083     return __stringValue;
00084   }

StringParameter::operator const std::string & (  )  const [inline]

Definition at line 86 of file StringParameter.hpp.

References __stringValue.

00087   {
00088     return __stringValue;
00089   }

const std::string StringParameter::typeName (  )  const [inline, virtual]

Implements Parameter.

Definition at line 91 of file StringParameter.hpp.

00092   {
00093     return "string";
00094   }

void Parameter::set ( const std::string &  s  )  [inline, inherited]

Definition at line 67 of file Parameter.hpp.

00067                                {
00068     set(s.c_str());
00069   }

const Type& Parameter::type (  )  const [inline, inherited]

Definition at line 74 of file Parameter.hpp.

References Parameter::__type.

00075   {
00076     return __type;
00077   }

const char * Parameter::label (  )  const [inherited]

Definition at line 26 of file Parameter.cpp.

References Parameter::__label.

00027 {
00028   return __label;
00029 }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Parameter P 
) [friend, inherited]

Definition at line 79 of file Parameter.hpp.

00081   {
00082     return P.put(os);
00083   }


Member Data Documentation

const std::string StringParameter::__defaultStringValue [private]

Definition at line 44 of file StringParameter.hpp.

Referenced by reset().

std::string StringParameter::__stringValue [private]

Type Parameter::__type [protected, inherited]

Definition at line 49 of file Parameter.hpp.

Referenced by Parameter::type().


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

Generated on Wed Nov 19 00:15:21 2008 for FreeFEM3D (aka ff3d) by  doxygen 1.5.6