vValue::Expr::Math::Subtract Class Reference

#include <veMath.h>

Inheritance diagram for vValue::Expr::Math::Subtract:

Inheritance graph
[legend]
Collaboration diagram for vValue::Expr::Math::Subtract:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Subtract (BasePtr lvalue, BasePtr rvalue)
 Subtract (BinaryOp const &other)
 Basic constructor.
virtual Variant GetValue (void) const
 Copy constructor.
virtual Basecopy (void) const
 Returns an exact copy of this object.


Detailed Description

Definition at line 54 of file veMath.h.


Constructor & Destructor Documentation

vValue::Expr::Math::Subtract::Subtract ( BasePtr  lvalue,
BasePtr  rvalue 
) [inline]

Definition at line 56 of file veMath.h.

Referenced by copy().

00056 : BinaryOp(lvalue, rvalue) {}; 

Here is the caller graph for this function:

vValue::Expr::Math::Subtract::Subtract ( BinaryOp const &  other  )  [inline]

Basic constructor.

Definition at line 57 of file veMath.h.

00057 : BinaryOp(other) {}; 


Member Function Documentation

Variant vValue::Expr::Math::Subtract::GetValue ( void   )  const [virtual]

Copy constructor.

Returns the value in its native format

Returns the result of subtracting rvalue from lvalue

Returns:
the result

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

Definition at line 77 of file veMath.cpp.

References vValue::Expr::Core::BinaryOp::m_lvalue, and vValue::Expr::Core::BinaryOp::m_rvalue.

00077                              {
00078     const Variant lvalue = m_lvalue->GetValue();
00079     const Variant rvalue = m_rvalue->GetValue();
00080     if (boost::get<int>(&lvalue) && boost::get<int>(&rvalue))
00081                 return boost::get<int>(lvalue) - boost::get<int>(rvalue);
00082     return m_lvalue->GetFloat() - m_rvalue->GetFloat();
00083     /*
00084     if (boost::get<float>(&lvalue) || boost::get<float>(&rvalue))
00085         return boost::lexical_cast<float>(lvalue)
00086              - boost::lexical_cast<float>(rvalue);
00087     else
00088     if (boost::get<int>(&lvalue) && boost::get<int>(&rvalue))
00089         return boost::get<int>(lvalue) - boost::get<int>(rvalue);
00090     else
00091         throw(1);
00092     */
00093 }

Base * vValue::Expr::Math::Subtract::copy ( void   )  const [virtual]

Returns an exact copy of this object.

Reimplemented from vValue::Expr::Core::BinaryOp.

Definition at line 95 of file veMath.cpp.

References Subtract().

00095                                {
00096     return new Subtract(*this);
00097 }

Here is the call graph for this function:


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