#include <veMath.h>
Public Member Functions | |
Subtract (BasePtr lvalue, BasePtr rvalue) | |
Subtract (BinaryOp const &other) | |
Basic constructor. | |
virtual Variant | GetValue (void) const |
Copy constructor. | |
virtual Base * | copy (void) const |
Returns an exact copy of this object. |
Definition at line 54 of file veMath.h.
vValue::Expr::Math::Subtract::Subtract | ( | BasePtr | lvalue, | |
BasePtr | rvalue | |||
) | [inline] |
vValue::Expr::Math::Subtract::Subtract | ( | BinaryOp const & | other | ) | [inline] |
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
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 }