Skip to content

Address

class Address

Represents an address, consisting of a bank and an address within that bank. The bank defaults to 0.

DEFINITION
class Address;

constructor Address

Constructs an address with the given address and a default bank of 0.

DEFINITION
Address ( uint64_t  address );
PARAMETERDESCRIPTION
address

The address within the bank.

constructor Address

Constructs an address with the given bank and address.

DEFINITION
Address ( uint64_t  bank,
uint64_t  address );
PARAMETERDESCRIPTION
bank

The bank of the address.

address

The address within the bank.

constructor Address

Constructs an address by parsing an expression from a tokenizer.

DEFINITION
Address ( Tokenizer & tokenizer,
std::shared_ptr< Environment >  environment = {} );
PARAMETERDESCRIPTION
tokenizer

The tokenizer to parse the expression from.

environment

The environment to evaluate the expression in.

method operator!=const

Compares two addresses for inequality.

DEFINITION
bool  operator!= ( const Address & other ) const;
PARAMETERDESCRIPTION
other

The address to compare with.

RETURNSDESCRIPTION
bool

true if the addresses are not equal, false otherwise.

method operator<const

Compares two addresses. Addresses are ordered by bank first, then by address within the bank.

DEFINITION
bool  operator< ( const Address & other ) const;
PARAMETERDESCRIPTION
other

The address to compare with.

RETURNSDESCRIPTION
bool

true if the address is less than the other, false otherwise.

method operator==const

Compares two addresses for equality.

DEFINITION
bool  operator== ( const Address & other ) const;
PARAMETERDESCRIPTION
other

The address to compare with.

RETURNSDESCRIPTION
bool

true if the addresses are equal, false otherwise.

method serializeconst

Serializes the address to a stream. The format is address if the bank is 0, and bank:address otherwise.

DEFINITION
void  serialize ( std::ostream & stream ) const;
PARAMETERDESCRIPTION
stream

member address

The address within the bank.

DEFINITION
uint64_t  address;

member bank

The bank of the address.

DEFINITION
uint64_t  bank;