Skip to content

MemoryBody

INCLUDE FILE
#include "Body/MemoryBody.h"

class MemoryBody

Represents a body that specifies a memory range: .memory start, end. It is used in the .output definition in targets.

DEFINITION
class MemoryBody;

constructor MemoryBody

DEFINITION
MemoryBody ( Location  location,
Expression  bank,
Expression  start_address,
Expression  end_address );
PARAMETERDESCRIPTION
location
bank
start_address
end_address

method cloneconst virtual

DEFINITION
virtual Body  clone ( const CloneContext & context ) const;
PARAMETERDESCRIPTION
context
RETURNSDESCRIPTION
Body

method createstatic

DEFINITION
static Body  create ( Location  location,
Expression  bank,
Expression  start_address,
Expression  end_address );
PARAMETERDESCRIPTION
location
bank
start_address
end_address
RETURNSDESCRIPTION
Body

method encodevirtual

Encode the BodyElement into a byte string.

The default implementation does nothing. Subclasses that represent data or instructions should override this method.

DEFINITION
virtual void  encode ( std::string & bytes,
const Memory * memory );
PARAMETERDESCRIPTION
bytes

The byte string to encode into.

memory

The memory context for encoding.

method serializeconst virtual

Serialize the BodyElement to a stream.

Subclasses must implement this method.

DEFINITION
virtual void  serialize ( std::ostream & stream,
const std::string & prefix ) const;
PARAMETERDESCRIPTION
stream

The stream to serialize to.

prefix

The prefix for each line of the serialized output.

method traversevirtual

Traverse the BodyElement.

This function is used by the default implementations of resolve() and expand_calls(). Unless a subclass overrides both of these methods, it should override traverse().

DEFINITION
virtual void  traverse ( std::function< void(Body &)>  body_callable,
std::function< void(Expression &)>  expression_callable );
PARAMETERDESCRIPTION
body_callable

A callable to apply to each sub-body-element.

expression_callable

A callable to apply to each sub-expression.

member bank

DEFINITION
Expression  bank;

member end_address

DEFINITION
Expression  end_address;

member start_address

DEFINITION
Expression  start_address;