V-Gears 0
Free Final Fantasy VII engine.
BinaryOpValue Class Reference

Value representing the result of a binary operation. More...

#include <Value.h>

Inheritance diagram for BinaryOpValue:
Collaboration diagram for BinaryOpValue:

Public Member Functions

 BinaryOpValue (const BinaryOpValue &value)=delete
 Copy constructor, disabled. More...
 
BinaryOpValueoperator= (const BinaryOpValue &value)=delete
 Copy constructor, disabled. More...
 
 BinaryOpValue (ValuePtr left, ValuePtr right, std::string oper)
 Constructor. More...
 
virtual std::ostream & Print (std::ostream &output) const override
 Print the value to a stream. More...
 
virtual ValuePtr Negate () override
 Negates a value. More...
 
virtual int GetPrecedence () const override
 Retrieves the operator precedence for this operation. More...
 
- Public Member Functions inherited from Value
virtual ~Value ()
 Destructor. More...
 
virtual bool IsInteger ()
 Return whether or not the Value is an integer. More...
 
virtual bool IsAddress ()
 Return whether or not the Value is an address. More...
 
virtual bool IsSignedValue ()
 Returns whether or not any stored integer value is signed. More...
 
virtual int32 GetSigned ()
 Retrieves a signed integer representing the value, if possible. More...
 
virtual uint32 GetUnsigned ()
 Retrieves an unsigned integer representing the value, if possible. More...
 
virtual std::ostream & Print (std::ostream &output) const =0
 Print the value to a stream. More...
 
virtual std::string GetString () const
 Retrieves the string representation of the value. More...
 
virtual ValuePtr Dup (std::ostream &output)
 Duplicates a value. More...
 
virtual ValuePtr Negate ()
 Negates a value. More...
 
virtual int GetPrecedence () const
 Operator precedence for this value. More...
 

Protected Attributes

const ValuePtr left_val_
 Value at the left side of the operator. More...
 
const ValuePtr right_val_
 Value at the right side of the operator. More...
 
const std::string oper_
 The operator. More...
 

Additional Inherited Members

- Protected Member Functions inherited from RefCounted
 RefCounted ()
 
virtual ~RefCounted ()
 

Detailed Description

Value representing the result of a binary operation.

Constructor & Destructor Documentation

◆ BinaryOpValue() [1/2]

BinaryOpValue::BinaryOpValue ( const BinaryOpValue value)
delete

Copy constructor, disabled.

Parameters
[in]valueThe value to copy.

◆ BinaryOpValue() [2/2]

BinaryOpValue::BinaryOpValue ( ValuePtr  left,
ValuePtr  right,
std::string  oper 
)

Constructor.

Parameters
[in]leftValue representing the left side of the operator.
[in]rightValue representing the right side of the operator.
[in]operThe operator for this value.

Member Function Documentation

◆ GetPrecedence()

int BinaryOpValue::GetPrecedence ( ) const
overridevirtual

Retrieves the operator precedence for this operation.

Lower values bind stronger, i.e. they are resolved earlier. If an operand has a higher precedence value than the operator, parentheses are not required for that operand.

Returns
the order of precedence for the operation.

Reimplemented from Value.

◆ Negate()

ValuePtr BinaryOpValue::Negate ( )
overridevirtual

Negates a value.

Returns
The value, negated.

Reimplemented from Value.

◆ operator=()

BinaryOpValue & BinaryOpValue::operator= ( const BinaryOpValue value)
delete

Copy constructor, disabled.

Parameters
[in]valueThe value to copy.

◆ Print()

std::ostream & BinaryOpValue::Print ( std::ostream &  output) const
overridevirtual

Print the value to a stream.

Parameters
[out]outputThe stream to write to.
Returns
The stream used for output.

Implements Value.

Member Data Documentation

◆ left_val_

const ValuePtr BinaryOpValue::left_val_
protected

Value at the left side of the operator.

◆ oper_

const std::string BinaryOpValue::oper_
protected

The operator.

◆ right_val_

const ValuePtr BinaryOpValue::right_val_
protected

Value at the right side of the operator.


The documentation for this class was generated from the following files: