vValue::Expr::Core::Number< T > Class Template Reference

#include <vCore.h>

Inheritance diagram for vValue::Expr::Core::Number< T >:

Inheritance graph
[legend]
Collaboration diagram for vValue::Expr::Core::Number< T >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Number (T value)
 Constructor.
 Number (Base const &other)
 Copy constructor.
virtual ~Number ()
Basecopy (void) const
virtual Variant GetValue (void) const
 Returns the value in its native format.
virtual int GetInt (void) const
 Returns an integer using the current value.
virtual float GetFloat (void) const
 Returns a float using the current value.
virtual tString GetString (Base const *other=0) const
 Returns a String using the current value using Output().
bool operator== (Base const &other) const
 compares two values
bool operator!= (Base const &other) const
 compares two values
bool operator>= (Base const &other) const
 compares two values
bool operator<= (Base const &other) const
 compares two values
bool operator> (Base const &other) const
 compares two values
bool operator< (Base const &other) const
 compares two values

Private Attributes

m_value
 The stored value.


Detailed Description

template<typename T>
class vValue::Expr::Core::Number< T >

Basic number class

This should be used for types that can be converted to int and float and inserted into an istream

Definition at line 157 of file vCore.h.


Constructor & Destructor Documentation

template<typename T>
vValue::Expr::Core::Number< T >::Number ( value  )  [inline]

Constructor.

Stores the given value inside the new class.

Parameters:
value the value to be used

Definition at line 184 of file vCore.h.

Referenced by vValue::Expr::Core::Number< T >::copy().

00184                                              :
00185         Base(),
00186         m_value(value)
00187 { }

Here is the caller graph for this function:

template<typename T>
vValue::Expr::Core::Number< T >::Number ( Base const &  other  )  [inline]

Copy constructor.

If the other value is not a Number object this constructor will only copy the current value and drop all other information.

Parameters:
other another Base or derived class to copy from

Definition at line 191 of file vCore.h.

00191                                                        :
00192         Base(other), // TODO: check if Base or BaseExt goes here
00193         m_value(static_cast<T>(other))
00194 { }

template<typename T>
virtual vValue::Expr::Core::Number< T >::~Number (  )  [inline, virtual]

Definition at line 165 of file vCore.h.

00165 { };


Member Function Documentation

template<typename T>
Base * vValue::Expr::Core::Number< T >::copy ( void   )  const [inline, virtual]

Overwritten copy function

Returns:
a new copy of the current object

Reimplemented from vValue::Expr::Core::Base.

Definition at line 208 of file vCore.h.

References vValue::Expr::Core::Number< T >::Number().

00208                                                      {
00209     return new Number(*this);
00210 }

Here is the call graph for this function:

template<typename T>
Variant vValue::Expr::Core::Number< T >::GetValue ( void   )  const [inline, virtual]

Returns the value in its native format.

Returns the value stored inside the object

Returns:
a variant containing the current value

Reimplemented from vValue::Expr::Core::Base.

Definition at line 214 of file vCore.h.

References vValue::Expr::Core::Number< T >::m_value.

00214                                                            {
00215     return static_cast<T>(m_value);
00216 }

template<typename T>
int vValue::Expr::Core::Number< T >::GetInt ( void   )  const [inline, virtual]

Returns an integer using the current value.

Returns the value stored inside the object

Returns:
an integer containing the current value

Reimplemented from vValue::Expr::Core::Base.

Definition at line 220 of file vCore.h.

References vValue::Expr::Core::Number< T >::m_value.

00220                                                      {
00221     return static_cast<int>(m_value);
00222 }

template<typename T>
float vValue::Expr::Core::Number< T >::GetFloat ( void   )  const [inline, virtual]

Returns a float using the current value.

Returns the value stored inside the object, converted to a float

Returns:
a float containing the current value

Reimplemented from vValue::Expr::Core::Base.

Definition at line 226 of file vCore.h.

References vValue::Expr::Core::Number< T >::m_value.

00226                                                          {
00227     return static_cast<float>(m_value);
00228 }

template<typename T>
tString vValue::Expr::Core::Number< T >::GetString ( Base const *  other = 0  )  const [inline, virtual]

Returns a String using the current value using Output().

Calls Output() to convert the stored value to a string

Returns:
the resulting string

Reimplemented from vValue::Expr::Core::Base.

Definition at line 232 of file vCore.h.

References vValue::Expr::Core::Number< T >::m_value, and vValue::Expr::Core::Base::Output().

00232                                                                          {
00233     return Output(m_value, other);
00234 }

Here is the call graph for this function:

template<typename T>
bool vValue::Expr::Core::Number< T >::operator== ( Base const &  other  )  const [inline, virtual]

compares two values

Reimplemented from vValue::Expr::Core::Base.

Definition at line 236 of file vCore.h.

References vValue::Expr::Core::Number< T >::m_value.

00236                                                                        {
00237     return m_value == static_cast<T>(other);
00238 }

template<typename T>
bool vValue::Expr::Core::Number< T >::operator!= ( Base const &  other  )  const [inline, virtual]

compares two values

Reimplemented from vValue::Expr::Core::Base.

Definition at line 239 of file vCore.h.

References vValue::Expr::Core::Number< T >::m_value.

00239                                                                        {
00240     return m_value != static_cast<T>(other);
00241 }

template<typename T>
bool vValue::Expr::Core::Number< T >::operator>= ( Base const &  other  )  const [inline, virtual]

compares two values

Reimplemented from vValue::Expr::Core::Base.

Definition at line 242 of file vCore.h.

References vValue::Expr::Core::Number< T >::m_value.

00242                                                                        {
00243     return m_value >= static_cast<T>(other);
00244 }

template<typename T>
bool vValue::Expr::Core::Number< T >::operator<= ( Base const &  other  )  const [inline, virtual]

compares two values

Reimplemented from vValue::Expr::Core::Base.

Definition at line 245 of file vCore.h.

00245                                                                        {
00246     return m_value <= static_cast<T>(other);
00247 }

template<typename T>
bool vValue::Expr::Core::Number< T >::operator> ( Base const &  other  )  const [inline, virtual]

compares two values

Reimplemented from vValue::Expr::Core::Base.

Definition at line 248 of file vCore.h.

References vValue::Expr::Core::Number< T >::m_value.

00248                                                                        {
00249     return m_value > static_cast<T>(other);
00250 }

template<typename T>
bool vValue::Expr::Core::Number< T >::operator< ( Base const &  other  )  const [inline, virtual]

compares two values

Reimplemented from vValue::Expr::Core::Base.

Definition at line 251 of file vCore.h.

00251                                                                        {
00252     return m_value < static_cast<T>(other);
00253 }


Member Data Documentation

template<typename T>
T vValue::Expr::Core::Number< T >::m_value [private]

The stored value.

Definition at line 158 of file vCore.h.

Referenced by vValue::Expr::Core::Number< T >::GetFloat(), vValue::Expr::Core::Number< T >::GetInt(), vValue::Expr::Core::Number< T >::GetString(), vValue::Expr::Core::Number< T >::GetValue(), vValue::Expr::Core::Number< T >::operator!=(), vValue::Expr::Core::Number< T >::operator==(), vValue::Expr::Core::Number< T >::operator>(), and vValue::Expr::Core::Number< T >::operator>=().


The documentation for this class was generated from the following file:
Generated on Sun Mar 16 00:05:50 2008 for Armagetron Advanced by  doxygen 1.5.4