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

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

#include <Value.h>

Inheritance diagram for UnaryOpValue:
Collaboration diagram for UnaryOpValue:

Public Member Functions

 UnaryOpValue (const UnaryOpValue &value)=delete
 Copy constructor, disabled. More...
 
UnaryOpValueoperator= (const UnaryOpValue &value)=delete
 Copy constructor, disabled. More...
 
 UnaryOpValue (ValuePtr operand, std::string oper, bool postfix)
 Constructor. More...
 
virtual std::ostream & Print (std::ostream &output) const override
 Print the value to a stream. 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 operand_
 The operand of the operation. More...
 
const std::string oper_
 The operator for this value. More...
 
const bool postfix_
 True if the operator is postfixed to the operand, false otherwise. More...
 

Additional Inherited Members

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

Detailed Description

Value representing the result of a unary operation.

Used as base class for prefix and postfix variants.

Constructor & Destructor Documentation

◆ UnaryOpValue() [1/2]

UnaryOpValue::UnaryOpValue ( const UnaryOpValue value)
delete

Copy constructor, disabled.

Parameters
[in]valueThe value to copy.

◆ UnaryOpValue() [2/2]

UnaryOpValue::UnaryOpValue ( ValuePtr  operand,
std::string  oper,
bool  postfix 
)

Constructor.

Parameters
[in]operandValue representing the operand of the operation.
[in]operThe operator for this value.
[in]postfixWhether or not the operator should be postfixed to the operand.

Member Function Documentation

◆ GetPrecedence()

int UnaryOpValue::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
{
See also
PRECEDENCE_UNARY_OP}.

Reimplemented from Value.

◆ operator=()

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

Copy constructor, disabled.

Parameters
[in]valueThe value to copy.

◆ Print()

std::ostream & UnaryOpValue::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

◆ oper_

const std::string UnaryOpValue::oper_
protected

The operator for this value.

◆ operand_

const ValuePtr UnaryOpValue::operand_
protected

The operand of the operation.

◆ postfix_

const bool UnaryOpValue::postfix_
protected

True if the operator is postfixed to the operand, false otherwise.


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