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

Value containing an integer. More...

#include <Value.h>

Inheritance diagram for IntValue:
Collaboration diagram for IntValue:

Public Member Functions

 IntValue (const IntValue &value)=delete
 Copy constructor, disabled. More...
 
IntValueoperator= (const IntValue &value)=delete
 Copy constructor, disabled. More...
 
 IntValue (int32 val, bool is_signed)
 Constructor for IntValue. More...
 
 IntValue (uint32 val, bool is_signed)
 Constructor for IntValue. More...
 
bool IsInteger () override
 Return whether or not the Value is an integer. More...
 
bool IsSignedValue () override
 Returns whether or not the stored integer value is signed. More...
 
int32 GetSigned () override
 Retrieves a signed integer representing the value, if possible. More...
 
uint32 GetUnsigned () override
 Retrieves an unsigned integer representing the value, if possible. More...
 
ValuePtr Dup (std::ostream &output) override
 Duplicates the value. More...
 
virtual std::ostream & Print (std::ostream &output) const override
 Print the value to a stream. 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 int32 val_
 The value of the integer. More...
 
const bool signed_
 True if the value is signed, false if it's not. More...
 

Additional Inherited Members

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

Detailed Description

Value containing an integer.

Constructor & Destructor Documentation

◆ IntValue() [1/3]

IntValue::IntValue ( const IntValue value)
delete

Copy constructor, disabled.

Parameters
[in]valueThe value to copy.

◆ IntValue() [2/3]

IntValue::IntValue ( int32  val,
bool  is_signed 
)

Constructor for IntValue.

Parameters
[in]valThe integer value to be contained.
[in]is_signedWhether or not the value is signed. This will affect output.

◆ IntValue() [3/3]

IntValue::IntValue ( uint32  val,
bool  is_signed 
)

Constructor for IntValue.

Parameters
[in]valThe integer value to be contained.
[in]is_signedWhether or not the value is signed. This will affect output.

Member Function Documentation

◆ Dup()

ValuePtr IntValue::Dup ( std::ostream &  output)
overridevirtual

Duplicates the value.

Parameters
[out]outputThe stream to output any necessary assignment.
Returns
A Value corresponding to a duplicate of the value.

Reimplemented from Value.

Reimplemented in AddressValue, and RelAddressValue.

◆ GetSigned()

int32 IntValue::GetSigned ( )
overridevirtual

Retrieves a signed integer representing the value, if possible.

Returns
A signed integer representing the value, if possible.

Reimplemented from Value.

Reimplemented in AddressValue.

◆ GetUnsigned()

uint32 IntValue::GetUnsigned ( )
overridevirtual

Retrieves an unsigned integer representing the value, if possible.

Returns
An unsigned integer representing the value, if possible.
Exceptions
WrongTypeExceptionif the value is not an integer.

Reimplemented from Value.

Reimplemented in RelAddressValue.

◆ IsInteger()

bool IntValue::IsInteger ( )
overridevirtual

Return whether or not the Value is an integer.

Returns
True.

Reimplemented from Value.

◆ IsSignedValue()

bool IntValue::IsSignedValue ( )
overridevirtual

Returns whether or not the stored integer value is signed.

Returns
True if the integer value is signed, false if it is not.

Reimplemented from Value.

◆ operator=()

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

Copy constructor, disabled.

Parameters
[in]valueThe value to copy.

◆ Print()

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

Reimplemented in AddressValue, and RelAddressValue.

Member Data Documentation

◆ signed_

const bool IntValue::signed_
protected

True if the value is signed, false if it's not.

◆ val_

const int32 IntValue::val_
protected

The value of the integer.


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