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

Value containing a signed, relative address. More...

#include <Value.h>

Inheritance diagram for RelAddressValue:
Collaboration diagram for RelAddressValue:

Public Member Functions

 RelAddressValue (const RelAddressValue &value)=delete
 Copy constructor, disabled. More...
 
RelAddressValueoperator= (const RelAddressValue &value)=delete
 Copy constructor, disabled. More...
 
 RelAddressValue (uint32 base_addr, int32 offset)
 Constructor. More...
 
bool IsAddress () override
 Return whether or not the Value is an address. More...
 
uint32 GetUnsigned () override
 Retrieves the exact address. More...
 
ValuePtr Dup (std::ostream &output) override
 Duplicates the value. More...
 
virtual std::ostream & Print (std::ostream &output) const override
 Print the relative address to a stream. More...
 
- Public Member Functions inherited from IntValue
 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 uint32 base_addr_
 The base address for the offset. More...
 
- Protected Attributes inherited from IntValue
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 a signed, relative address.

When asking for unsigned integer value, exact address is returned; when printing or getting signed value, relative address is used.

Constructor & Destructor Documentation

◆ RelAddressValue() [1/2]

RelAddressValue::RelAddressValue ( const RelAddressValue value)
delete

Copy constructor, disabled.

Parameters
[in]valueThe value to copy.

◆ RelAddressValue() [2/2]

RelAddressValue::RelAddressValue ( uint32  base_addr,
int32  offset 
)

Constructor.

Parameters
[in]base_addrThe base address for the offset.
[in]offsetThe relative offset to the base address.

Member Function Documentation

◆ Dup()

ValuePtr RelAddressValue::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 IntValue.

◆ GetUnsigned()

uint32 RelAddressValue::GetUnsigned ( )
overridevirtual

Retrieves the exact address.

Returns
The exact address.
Exceptions
WrongTypeExceptionif the value is not an integer.

Reimplemented from IntValue.

◆ IsAddress()

bool RelAddressValue::IsAddress ( )
overridevirtual

Return whether or not the Value is an address.

Returns
True.

Reimplemented from Value.

◆ operator=()

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

Copy constructor, disabled.

Parameters
[in]valueThe value to copy.

◆ Print()

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

Print the relative address to a stream.

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

Reimplemented from IntValue.

Member Data Documentation

◆ base_addr_

const uint32 RelAddressValue::base_addr_
protected

The base address for the offset.


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