Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

expander::expvartype_numeric< StringType, NumType, NumTraits > Class Template Reference

The class that supplies the numeric vartype. More...

#include <expandlib-vartype-numeric.h>

Inherits expander::expandvartype< StringType >< StringType >.

Inheritance diagram for expander::expvartype_numeric< StringType, NumType, NumTraits >:

Inheritance graph
Collaboration diagram for expander::expvartype_numeric< StringType, NumType, NumTraits >:

Collaboration graph
List of all members.

Public Methods

 expvartype_numeric ()
 Default contructor, inits the value to 0.

 expvartype_numeric (const StringType &s)
 Constructor with a parameter of type StringType, inits the value to 's' (converted).

 expvartype_numeric (const _TCHAR *s)
 Constructor with a C-style string as parameter, inits the value to 's' (converted).

 expvartype_numeric (const NumType v)
 Constructor with a number as parameter, inits the value to 's' (converted).

virtual void AppendValue (StringType &dest) const throw ()
 Appends the value of the var to a string.

virtual void AppendValue (StringType &dest, const FParamVectorType &params, const FVarMapType &vars, ExpandResultsType &results) const throw ()
 Appends the value of the var to a string, using params and rvars, putting any expanding results into results.

virtual void SetValue (const StringType &s) throw ()
 Sets this variable to the string specified.

NumType get_value ()
 Returns the value.

void set_value (const NumType v)
 Sets the value.


Protected Types

typedef ::std::vector< StringType > FParamVectorType
 The type used for the parameter vectors (MSVC wouldn't allow me to use template arguments in these typedefs, or I don't know how it should be done).

typedef ::std::map< StringType,
::expander::expandvartype<
StringType > * > 
FVarMapType
 The type used for the map of variables (MSVC wouldn't allow me to use template arguments in these typedefs, or I don't know how it should be done).


Protected Attributes

NumType val
StringType val_str

Detailed Description

template<class StringType = ::std::string, class NumType = int, class NumTraits = expvartype_numeric_traits_normal<NumType>>
class expander::expvartype_numeric< StringType, NumType, NumTraits >

The class that supplies the numeric vartype.

This class can be used in the program using ExpandLib for simple numeric variables.

Definition at line 52 of file expandlib-vartype-numeric.h.


Member Typedef Documentation

template<class StringType = ::std::string>
typedef ::std::vector<StringType> expander::expandvartype< StringType >::FParamVectorType [protected, inherited]
 

The type used for the parameter vectors (MSVC wouldn't allow me to use template arguments in these typedefs, or I don't know how it should be done).

Definition at line 52 of file expandlib-vartype.h.

Referenced by expander::expvartype_list< StringType, ItemType >::AppendValue().

template<class StringType = ::std::string>
typedef ::std::map<StringType, ::expander::expandvartype<StringType>*> expander::expandvartype< StringType >::FVarMapType [protected, inherited]
 

The type used for the map of variables (MSVC wouldn't allow me to use template arguments in these typedefs, or I don't know how it should be done).

Definition at line 53 of file expandlib-vartype.h.


Constructor & Destructor Documentation

template<class StringType = ::std::string, class NumType = int, class NumTraits = expvartype_numeric_traits_normal<NumType>>
expander::expvartype_numeric< StringType, NumType, NumTraits >::expvartype_numeric   [inline]
 

Default contructor, inits the value to 0.

Definition at line 60 of file expandlib-vartype-numeric.h.

template<class StringType = ::std::string, class NumType = int, class NumTraits = expvartype_numeric_traits_normal<NumType>>
expander::expvartype_numeric< StringType, NumType, NumTraits >::expvartype_numeric const StringType &    s [inline]
 

Constructor with a parameter of type StringType, inits the value to 's' (converted).

Definition at line 71 of file expandlib-vartype-numeric.h.

References expander::expvartype_numeric< StringType, NumType, NumTraits >::set_value().

template<class StringType = ::std::string, class NumType = int, class NumTraits = expvartype_numeric_traits_normal<NumType>>
expander::expvartype_numeric< StringType, NumType, NumTraits >::expvartype_numeric const _TCHAR *    s [inline]
 

Constructor with a C-style string as parameter, inits the value to 's' (converted).

Definition at line 81 of file expandlib-vartype-numeric.h.

References expander::expvartype_numeric< StringType, NumType, NumTraits >::set_value().

template<class StringType = ::std::string, class NumType = int, class NumTraits = expvartype_numeric_traits_normal<NumType>>
expander::expvartype_numeric< StringType, NumType, NumTraits >::expvartype_numeric const NumType    v [inline]
 

Constructor with a number as parameter, inits the value to 's' (converted).

Definition at line 91 of file expandlib-vartype-numeric.h.

References expander::expvartype_numeric< StringType, NumType, NumTraits >::set_value().


Member Function Documentation

template<class StringType = ::std::string, class NumType = int, class NumTraits = expvartype_numeric_traits_normal<NumType>>
virtual void expander::expvartype_numeric< StringType, NumType, NumTraits >::AppendValue StringType &    dest,
const FParamVectorType   params,
const FVarMapType   vars,
ExpandResultsType   results
const throw () [inline, virtual]
 

Appends the value of the var to a string, using params and rvars, putting any expanding results into results.

This is called directly from 'expandable<StringType>::expand', when a variable with parameters has been found.

Implements expander::expandvartype< StringType >.

Definition at line 98 of file expandlib-vartype-numeric.h.

template<class StringType = ::std::string, class NumType = int, class NumTraits = expvartype_numeric_traits_normal<NumType>>
virtual void expander::expvartype_numeric< StringType, NumType, NumTraits >::AppendValue StringType &    dest const throw () [inline, virtual]
 

Appends the value of the var to a string.

This is called by operator+=(StringType &s,::expander::expandvartype<StringType> *v), which is called by 'expandable<StringType>::expand' when a variable without parameters has been found.

Implements expander::expandvartype< StringType >.

Definition at line 93 of file expandlib-vartype-numeric.h.

template<class StringType = ::std::string, class NumType = int, class NumTraits = expvartype_numeric_traits_normal<NumType>>
NumType expander::expvartype_numeric< StringType, NumType, NumTraits >::get_value   [inline]
 

Returns the value.

Definition at line 113 of file expandlib-vartype-numeric.h.

template<class StringType = ::std::string, class NumType = int, class NumTraits = expvartype_numeric_traits_normal<NumType>>
void expander::expvartype_numeric< StringType, NumType, NumTraits >::set_value const NumType    v [inline]
 

Sets the value.

Definition at line 116 of file expandlib-vartype-numeric.h.

Referenced by expander::expvartype_numeric< StringType, NumType, NumTraits >::expvartype_numeric(), and expander::expvartype_numeric< StringType, NumType, NumTraits >::SetValue().

template<class StringType = ::std::string, class NumType = int, class NumTraits = expvartype_numeric_traits_normal<NumType>>
virtual void expander::expvartype_numeric< StringType, NumType, NumTraits >::SetValue const StringType &    s throw () [inline, virtual]
 

Sets this variable to the string specified.

This isn't called from ExpandLib itself, but it can be used by other programs.

Implements expander::expandvartype< StringType >.

Definition at line 103 of file expandlib-vartype-numeric.h.

References expander::expvartype_numeric< StringType, NumType, NumTraits >::set_value().


Member Data Documentation

template<class StringType = ::std::string, class NumType = int, class NumTraits = expvartype_numeric_traits_normal<NumType>>
NumType expander::expvartype_numeric< StringType, NumType, NumTraits >::val [protected]
 

Definition at line 54 of file expandlib-vartype-numeric.h.

template<class StringType = ::std::string, class NumType = int, class NumTraits = expvartype_numeric_traits_normal<NumType>>
StringType expander::expvartype_numeric< StringType, NumType, NumTraits >::val_str [protected]
 

Definition at line 55 of file expandlib-vartype-numeric.h.


The documentation for this class was generated from the following file:
Generated on Tue Feb 4 17:24:30 2003 for ExpandLib by doxygen1.3-rc2