SimpleRepeatBody
INCLUDE FILE
#include "Body/SimpleRepeatBody.h"
class SimpleRepeatBody
Represents a body that repeats a block of code a specified number of times, not using a variable.
DEFINITION
class SimpleRepeatBody;
constructor SimpleRepeatBody
DEFINITION
| SimpleRepeatBody | ( | RepeatRange range, | |
| Body body | ); |
| PARAMETER | DESCRIPTION |
|---|---|
range |
|
body |
method cloneconst virtual
DEFINITION
| virtual Body clone | ( | const CloneContext & context | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
context |
| RETURNS | DESCRIPTION |
|---|---|
Body |
method createstatic
DEFINITION
| static Body create | ( | RepeatRange range, | |
| Body body | ); |
| PARAMETER | DESCRIPTION |
|---|---|
range |
|
body |
| RETURNS | DESCRIPTION |
|---|---|
Body |
method createstatic
DEFINITION
| static Body create | ( | Expression start, | |
| Expression end, | |||
| Body body | ); |
| PARAMETER | DESCRIPTION |
|---|---|
start |
|
end |
|
body |
| RETURNS | DESCRIPTION |
|---|---|
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 | ); |
| PARAMETER | DESCRIPTION |
|---|---|
bytes |
The byte string to encode into. |
memory |
The memory context for encoding. |
method evaluate_processvirtual protected
Evaluate the body element after all sub-body-elements and sub-expressions have been evaluated.
The default implementation does nothing.
DEFINITION
| virtual std::optional< Body > evaluate_process | ( | const EvaluationContext & context | ); |
| PARAMETER | DESCRIPTION |
|---|---|
context |
The evaluation context. |
| RETURNS | DESCRIPTION |
|---|---|
std::optional< Body > |
The Body to replace this BodyElement with, {} if no replacement is needed. |
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; |
| PARAMETER | DESCRIPTION |
|---|---|
stream |
The stream to serialize to. |
prefix |
The prefix for each line of the serialized output. |
method simplifystatic private
DEFINITION
| static std::optional< Body > simplify | ( | const RepeatRange & range, | |
| const Body & body, | |||
| bool always_create | ); |
| PARAMETER | DESCRIPTION |
|---|---|
range |
|
body |
|
always_create |
| RETURNS | DESCRIPTION |
|---|---|
std::optional< Body > |