vValue::Expr::Math::Add Class Reference

#include <veMath.h>

Inheritance diagram for vValue::Expr::Math::Add:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Add (BasePtr lvalue, BasePtr rvalue)
 Add (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 46 of file veMath.h.


Constructor & Destructor Documentation

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

Definition at line 48 of file veMath.h.

Referenced by copy().

00048 : BinaryOp(lvalue, rvalue) {}; 

Here is the caller graph for this function:

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

Basic constructor.

Definition at line 49 of file veMath.h.

00049 : BinaryOp(other) {}; 


Member Function Documentation

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

Copy constructor.

Returns the value in its native format

Returns the result of adding the lvalue and rvalue

Returns:
the result

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

Definition at line 48 of file veMath.cpp.

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

00048                         {
00049     const Variant lvalue = m_lvalue->GetValue();
00050     const Variant rvalue = m_rvalue->GetValue();
00051     //return boost::apply_visitor(AddVisitor(), lvalue, rvalue);
00052     /*
00053         if (boost::get<tString>(&lvalue) || boost::get<tString>(&rvalue))
00054                 return boost::lexical_cast<tString>lvalue
00055                      + boost::lexical_cast<tString>rvalue;
00056         else
00057     */
00058     if (boost::get<int>(&lvalue) && boost::get<int>(&rvalue))
00059                 return boost::get<int>(lvalue) + boost::get<int>(rvalue);
00060     /*
00061     else
00062     if (boost::get<float>(&lvalue) || boost::get<float>(&rvalue))
00063         return boost::lexical_cast<float>(lvalue)
00064              + boost::lexical_cast<float>(rvalue);
00065     else
00066         throw(1);*/
00067     return m_lvalue->GetFloat() + m_rvalue->GetFloat();
00068 }

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

Returns an exact copy of this object.

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

Definition at line 70 of file veMath.cpp.

References Add().

00070                           {
00071     return new Add(*this);
00072 }

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:56 2008 for Armagetron Advanced by  doxygen 1.5.4