GeoGen API Reference
Classes | Typedefs | Enumerations | Functions | Variables
geogen::runtime Namespace Reference

Contains the virtual machine and all associated classes. More...

Classes

class  BooleanScriptParameter
 Script parameter of type Boolean. More...
 
class  CallStack
 Data structure containing all required information about function call stack. More...
 
class  CallStackEntry
 Call stack frame. More...
 
class  CodeBlock
 Linear sequence of instructions. More...
 
class  CodeBlockStack
 Data structure containing a recursive sequence of calls to code block.Each CallStackEntry usually contains such stack. More...
 
class  CodeBlockStackEntry
 A code block stack frame. More...
 
struct  CompareObjects
 Comparator which allows ManagedObject::InstanceLessThan to be used for STL collections. More...
 
class  CompiledScript
 A compiled script. More...
 
class  EnumScriptParameter
 Script parameter of type Enum. More...
 
class  FunctionDefinition
 Base class for function definitions. More...
 
class  GlobalNativeFunctionDefinition
 Base class for global function definitions bound to a native function. More...
 
class  IncorrectTypeException
 Exception thrown when error geogen::GGE2101_IncorrectNativeFunctionArgumentType, geogen::GGE2102_IncorrectOperandType, geogen::GGE2104_IncorrectConditionResultType, geogen::GGE2708_IncorrectNoiseLayerWaveLengthType and geogen::GGE2709_IncorrectNoiseLayerAmplitudeType occurs. More...
 
class  IntermediateCodeException
 Exception thrown when error geogen::GGE5001_IntermediateCodeError occurs. More...
 
class  Library
 Collection of function, variable and type definitions. More...
 
class  MainMapNotGeneratedException
 Exception thrown when error geogen::GGE2801_MainMapNotGenerated occurs. More...
 
class  ManagedObject
 Base class for script objects managed by MemoryManager. More...
 
class  ManagedObjectHolder
 Holds a reference to an ManagedObject for as long as the holder exists. More...
 
class  MemberNativeFunctionDefinition
 A member native function definition. More...
 
class  MemoryManager
 Tracks objects and the references among them. It both uses ref-counting algorithm and holds a list of all objects so there are no memory leaks due to circular references. The actual ref-counts are stored in the objects themselves (and can be accessed using ManagedObject::AddRef, ManagedObject::RemoveRef and ManagedObject::GetRefCount). Formally, the managed owns all managed objects alive in the virtual machine - once the memory manager is destroyed, all the objects that are still alive will be destroyed too. More...
 
class  MetadataBoolean
 Boolean node in a metadata tree. More...
 
class  MetadataIdentifier
 Identifier node in a metadata tree. More...
 
class  MetadataKeyValueCollection
 KeyValueCollection node in a metadata tree. More...
 
class  MetadataList
 List node in a metadata tree. More...
 
class  MetadataNumber
 Number node in a metadata tree. More...
 
class  MetadataString
 String node in a metadata tree. More...
 
class  MetadataValue
 Base class for metadata tree node classes. More...
 
class  NullReferenceException
 Exception thrown when error geogen::GGE2106_NullReference occurs. More...
 
class  NumberOfArgumentsException
 Exception thrown when error geogen::GGE2103_IncorrectNumberOfArguments occurs. More...
 
class  NumberOverflowException
 Exception thrown when error geogen::GGE2302_NumberOverflow occurs. More...
 
class  NumberScriptParameter
 Script parameter of type Number. More...
 
class  NumberUnderflowException
 Exception thrown when error geogen::GGE2308_NumberUnderflow occurs. More...
 
class  ObjectStack
 Data structure containing in-expression objects and objects being passed into/from a function. More...
 
class  PrimitiveObject
 Universal class for most managed object types representing primitive types (Number, String etc.). More...
 
class  RandomSequence2DObject
 
class  ReadOnlyWriteException
 Exception thrown when error geogen::GGE2108_ReadOnlyWrite occurs. More...
 
class  RendererObjectStub
 Stub representing an geogen::renderer::RendererObject during execution of an VirtualMachine. More...
 
class  RenderingSequenceTooLongException
 Exception thrown when error geogen::GGE2504_RenderingSequenceTooLong occurs. More...
 
class  RuntimeException
 Base class for exceptions throw during script execution. More...
 
class  ScriptFunctionDefinition
 Definition of a function declared by the script. More...
 
class  ScriptParameter
 Base class for classes representing individual types of script parameters. More...
 
class  ScriptParameters
 Contains configuration of map size, rendering bounds and any additional parameters the script may have. More...
 
class  StackOverflowException
 Exception thrown when error geogen::GGE2501_CallStackOverflow, geogen::GGE2502_CodeBlockStackOverflow and geogen::GGE2503_ObjectStackOverflow occurs. More...
 
class  StaticObject
 
class  SymbolDefinitionException
 Base class for runtime exceptions related to a definition of a symbol. More...
 
class  SymbolDefinitionTable
 Table containing symbol definitions, indexed by name. More...
 
class  TypeDefinition
 Base class for definitions of script classes. More...
 
class  UndefinedSymbolAccessException
 Exception thrown when error geogen::GGE2201_UndefinedFunction, geogen::GGE2202_UndefinedVariable and geogen::GGE2203_UndefinedMemberVariable occurs. More...
 
class  UserErrorException
 Exception thrown when error geogen::GGE6000_UserError occurs. More...
 
class  VariableDefinition
 Base class for definitions of pre-defined variables. These are often not strictly necessary though - any code can insert items straight into an appropriate VariableTable. More...
 
class  VariableRedefinitionException
 Exception thrown when error geogen::GGE2204_VariableAlreadyDefined occurs. More...
 
class  VariableTable
 Table of variables declared in a single context. More...
 
class  VariableTableItem
 Item in VariableTable, representing a single defined variable. More...
 
class  VirtualMachine
 Intermediate code simulator. Loads a CompiledScript and and then executes the script, producing a geogen::renderer::RenderingSequence. More...
 
class  VirtualMachineStatusGuard
 Guard that sets a status of a VirtualMachine to a specified value when it is destroyed. Used mark VM as failed when native execution leaves a block prematurely, for example because an exception was thrown. More...
 

Typedefs

typedef unsigned ObjectId
 Numeric managed object identifier.
 

Enumerations

enum  CallStackEntryStepResult { CALL_STACK_ENTRY_STEP_RESULT_RUNNING, CALL_STACK_ENTRY_STEP_RESULT_FINISHED }
 Result of a call to CallStackEntry::Step.
 
enum  CodeBlockStackEntryStepResult { CODE_BLOCK_STACK_ENTRY_STEP_RESULT_TYPE_RUNNING, CODE_BLOCK_STACK_ENTRY_STEP_RESULT_TYPE_FINISHED, CODE_BLOCK_STACK_ENTRY_STEP_RESULT_TYPE_BREAK, CODE_BLOCK_STACK_ENTRY_STEP_RESULT_TYPE_CONTINUE }
 Result of a call to CodeBlockStackEntry::Step.
 
enum  InstructionStepResult { INSTRUCTION_STEP_RESULT_TYPE_NORMAL, INSTRUCTION_STEP_RESULT_TYPE_CONTINUE, INSTRUCTION_STEP_RESULT_TYPE_BREAK }
 
enum  MethodType { METHOD_TYPE_STATIC, METHOD_TYPE_INSTANCE }
 Type of a member function - static vs. instance.
 
enum  MetadataType {
  METADATA_TYPE_NUMBER, METADATA_TYPE_STRING, METADATA_TYPE_BOOLEAN, METADATA_TYPE_IDENTIFIER,
  METADATA_LIST, METADATA_TYPE_KEYVALUE_COLLECTION
}
 Types of metadata tree nodes. More...
 
enum  ScriptParameterValueRestriction { SCRIPT_PARAMETER_VALUE_RESTRICTION_UNRESTRICTED, SCRIPT_PARAMETER_VALUE_RESTRICTION_INTEGERS, SCRIPT_PARAMETER_VALUE_RESTRICTION_POWERS_OF_2, SCRIPT_PARAMETER_VALUE_RESTRICTION_POWERS_OF_10 }
 NumberScriptParameter value restrictions. More...
 
enum  ScriptParameterType { SCRIPT_PARAMETER_TYPE_NUMBER, SCRIPT_PARAMETER_TYPE_BOOLEAN, SCRIPT_PARAMETER_TYPE_ENUM }
 Type of a ScriptParameter. More...
 
enum  StackType { STACK_TYPE_OBJECT, STACK_TYPE_CALL, STACK_TYPE_CODE_BLOCK }
 Stack types. More...
 
enum  VirtualMachineStatus { VIRTUAL_MACHINE_STATUS_READY, VIRTUAL_MACHINE_STATUS_FINISHED, VIRTUAL_MACHINE_STATUS_FAULTED }
 Statuses of the VirtualMachine. More...
 
enum  VirtualMachineStepResult { VIRTUAL_MACHINE_STEP_RESULT_RUNNING, VIRTUAL_MACHINE_STEP_RESULT_FINISHED }
 Results of VirtualMachine::Step. There is no "failed" result, because that is indicated by throwing exception.
 

Functions

String MetadataTypeToString (MetadataType metadataType)
 Converts metadata type to string. More...
 
static String ScriptParameterTypeToString (ScriptParameterType scriptParameterType)
 Converts a script parameter type to string. More...
 

Variables

static const ObjectId UNASSIGNED_OBJECT_ID = 0
 Default object ID for an object that wasn't registered with the MemoryManager.
 
static const ObjectId MAX_OBJECT_ID = std::numeric_limits<ObjectId>::max()
 The maximum object ID.
 
static const ObjectId MIN_OBJECT_ID = 1
 The minimum object ID. This is the first object ID assigned, subsequent IDs are then assigned sequentially by adding one each time.
 
const unsigned MAP_SIZE_INFINITE = -1
 Infinite size in given dimension.
 
const unsigned MAP_SIZE_AUTOMATIC = -2
 The size in given dimension will be set automatically by the generator. More...
 
const unsigned MAP_SIZE_MAX = -3
 Maximum numeric value of a map size in either dimension.
 
const unsigned MAP_SIZE_MIN = 1
 Minimum numeric value of a map size in either dimension.
 
const double RENDER_SCALE_MIN = 0.001
 The minimum render scale.
 
const double RENDER_SCALE_MAX = 10
 The maximum render scale.
 
const Size1D RENDER_SIZE_DEFAULT = 1000
 The default render size (if no other size can be used).
 
const Size1D MAP_SIZE_DEFAULT = 1000
 The default default map size.
 

Detailed Description

Contains the virtual machine and all associated classes.

Enumeration Type Documentation

Types of metadata tree nodes.

Enumerator
METADATA_TYPE_NUMBER 

Number node.

METADATA_TYPE_STRING 

String node.

METADATA_TYPE_BOOLEAN 

Boolean node.

METADATA_TYPE_IDENTIFIER 

Identifier node.

METADATA_LIST 

List node.

METADATA_TYPE_KEYVALUE_COLLECTION 

KeyValueCollection node.

Type of a ScriptParameter.

Enumerator
SCRIPT_PARAMETER_TYPE_NUMBER 

Number.

SCRIPT_PARAMETER_TYPE_BOOLEAN 

Boolean.

NumberScriptParameter value restrictions.

Enumerator
SCRIPT_PARAMETER_VALUE_RESTRICTION_UNRESTRICTED 

Unrestricted.

SCRIPT_PARAMETER_VALUE_RESTRICTION_INTEGERS 

Integers only.

SCRIPT_PARAMETER_VALUE_RESTRICTION_POWERS_OF_2 

Powers of two only.

SCRIPT_PARAMETER_VALUE_RESTRICTION_POWERS_OF_10 

Powers of ten only.

Stack types.

Enumerator
STACK_TYPE_OBJECT 

ObjectStack.

STACK_TYPE_CALL 

CallStack.

STACK_TYPE_CODE_BLOCK 

CodeBlockStack.

Statuses of the VirtualMachine.

Enumerator
VIRTUAL_MACHINE_STATUS_READY 

The VM is ready to execute.

VIRTUAL_MACHINE_STATUS_FINISHED 

Execution of the virtual machine was finished successfully, no further execution is possible.

VIRTUAL_MACHINE_STATUS_FAULTED 

Execution of the virtual machine was terminated prematurely with an error, no further execution is possible.

Function Documentation

String geogen::runtime::MetadataTypeToString ( MetadataType  metadataType)

Converts metadata type to string.

Parameters
metadataTypeType of the metadata node.
Returns
A type name.
static String geogen::runtime::ScriptParameterTypeToString ( ScriptParameterType  scriptParameterType)
inlinestatic

Converts a script parameter type to string.

Parameters
dimensionsThe script parameter type.
Returns
Converted string.

Variable Documentation

const unsigned geogen::runtime::MAP_SIZE_AUTOMATIC = -2

The size in given dimension will be set automatically by the generator.