% This file has been created automatically by FPDoc.
% Linear output (c) 2005 Michael Van Canneyt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Reference for unit 'Thorium'
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Reference for unit 'Thorium'}
\label{thoriumcorepkg:thorium}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Used units
\section{Used units}
\begin{FPCltable}{lr}{Used units by unit 'Thorium'}{Thorium:0units}
Name & Page \\ \hline
Classes\index{unit!Classes} & \pageref{thoriumcorepkg:thorium} \\
contnrs\index{unit!contnrs} & \pageref{thoriumcorepkg:thorium} \\
md5\index{unit!md5} & \pageref{thoriumcorepkg:thorium} \\
SysUtils\index{unit!SysUtils} & \pageref{thoriumcorepkg:thorium} \\
thorium\_globals\index{unit!thorium\_globals} & \pageref{thoriumcorepkg:thorium} \\
thorium\_utils\index{unit!thorium\_utils} & \pageref{thoriumcorepkg:thorium} \\
typinfo\index{unit!typinfo} & \pageref{thoriumcorepkg:thorium} \\
Variants\index{unit!Variants} & \pageref{thoriumcorepkg:thorium} \\
zstream\index{unit!zstream} & \pageref{thoriumcorepkg:thorium} \\
\end{FPCltable}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Constants, types and variables
\section{Constants, types and variables}
\label{thoriumconststypesvars}
% Types
\subsection{Types}
\label{thoriumtypes}

\begin{verbatim}
PPThoriumType = ^PThoriumType
\end{verbatim}
\label{thoriumcorepkg:thorium:ppthoriumtype}
\index{PPThoriumType}



\begin{verbatim}
PThoriumExternalFunctionVarType = ^TThoriumExternalFunctionVarType
\end{verbatim}
\label{thoriumcorepkg:thorium:pthoriumexternalfunctionvartype}
\index{PThoriumExternalFunctionVarType}



\begin{verbatim}
PThoriumHostObjectTypeValue = ^TThoriumHostObjectTypeValue
\end{verbatim}
\label{thoriumcorepkg:thorium:pthoriumhostobjecttypevalue}
\index{PThoriumHostObjectTypeValue}



\begin{verbatim}
PThoriumPersistent = ^TThoriumPersistent
\end{verbatim}
\label{thoriumcorepkg:thorium:pthoriumpersistent}
\index{PThoriumPersistent}



\begin{verbatim}
PThoriumRelocation = ^TThoriumRelocation
\end{verbatim}
\label{thoriumcorepkg:thorium:pthoriumrelocation}
\index{PThoriumRelocation}



\begin{verbatim}
PThoriumSimpleVarargs = ^TThoriumSimpleVarargs
\end{verbatim}
\label{thoriumcorepkg:thorium:pthoriumsimplevarargs}
\index{PThoriumSimpleVarargs}



\begin{verbatim}
PThoriumStackEntry = ^TThoriumStackEntry
\end{verbatim}
\label{thoriumcorepkg:thorium:pthoriumstackentry}
\index{PThoriumStackEntry}



\begin{verbatim}
PThoriumTableEntry = ^TThoriumTableEntry
\end{verbatim}
\label{thoriumcorepkg:thorium:pthoriumtableentry}
\index{PThoriumTableEntry}



\begin{verbatim}
PThoriumType = ^TThoriumType
\end{verbatim}
\label{thoriumcorepkg:thorium:pthoriumtype}
\index{PThoriumType}



\begin{verbatim}
PThoriumValue = ^TThoriumValue
\end{verbatim}
\label{thoriumcorepkg:thorium:pthoriumvalue}
\index{PThoriumValue}



\begin{verbatim}
TThoriumBuiltInValue = record
end

\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumbuiltinvalue}
\index{TThoriumBuiltInValue}
An instance of this record represents a built-in type value in Thorium. This includes integers (Int64-based), floats (Double-based) and strings (UTF8String-based).


\begin{verbatim}
TThoriumClassMethod = procedure(const Input: Array of Pointer;
                                Result: PThoriumValue) of object
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumclassmethod}
\index{TThoriumClassMethod}
This is the only kind of method which can be called without NativeCall.


\begin{verbatim}
TThoriumDebugCallbackObject = procedure
                                        (Sender: TThoriumDebuggingVirtualMachine;
                                        Kind: TThoriumDebugEvent;
                                        Obj: TObject) of object
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumdebugcallbackobject}
\index{TThoriumDebugCallbackObject}



\begin{verbatim}
TThoriumDebugCallbackValue = procedure
                                       (Sender: TThoriumDebuggingVirtualMachine;
                                       Kind: TThoriumDebugEvent;
                                       Value: LongInt) of object
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumdebugcallbackvalue}
\index{TThoriumDebugCallbackValue}



\begin{verbatim}
TThoriumExternalFunctionVarType = record
  HostType : TThoriumHostType;
  Extended : TThoriumHostObjectType;
  Storing : Boolean;
end

\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumexternalfunctionvartype}
\index{TThoriumExternalFunctionVarType}
This fully defines a type from the host environment, including a reference to an host object type object if it is a class type. It also tells whether it is Storing. For more information about the storing-flag see TThoriumHostObjectType.GetPropertyStoring (\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:getpropertystoring}).


\begin{verbatim}
TThoriumHostFunctionBaseClass = Class of TThoriumHostFunctionBase
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionbaseclass}
\index{TThoriumHostFunctionBaseClass}



\begin{verbatim}
TThoriumHostObjectTypeArray = Array of TThoriumHostObjectType
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttypearray}
\index{TThoriumHostObjectTypeArray}



\begin{verbatim}
TThoriumHostObjectTypeClass = Class of TThoriumHostObjectType
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttypeclass}
\index{TThoriumHostObjectTypeClass}



\begin{verbatim}
TThoriumHostObjectTypeValue = record
  Value : TThoriumHostObject;
  TypeClass : TThoriumHostObjectType;
  Size : TThoriumSizeInt;
end

\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttypevalue}
\index{TThoriumHostObjectTypeValue}
An instance of this record reflects a host object type value in Thorium. It contains the value, a pointer to the type and the size of the data allocated in the pointer if it should be automatically handled by Thorium.


\begin{verbatim}
TThoriumInstructionFunc1R = function(RI: Word) : TThoriumInstruction
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriuminstructionfunc1r}
\index{TThoriumInstructionFunc1R}



\begin{verbatim}
TThoriumLibraryClass = Class of TThoriumLibrary
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumlibraryclass}
\index{TThoriumLibraryClass}



\begin{verbatim}
TThoriumLibraryPropertyArray = Array of TThoriumLibraryProperty
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertyarray}
\index{TThoriumLibraryPropertyArray}



\begin{verbatim}
TThoriumLibraryPropertyClass = Class of TThoriumLibraryProperty
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertyclass}
\index{TThoriumLibraryPropertyClass}



\begin{verbatim}
TThoriumOnCompilerOutput = procedure(Sender: TThorium;
                                     const Module: TThoriumModule;
                                     const Msg: String) of object
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumoncompileroutput}
\index{TThoriumOnCompilerOutput}
See TThorium.OnCompilerOutput (\pageref{thoriumcorepkg:thorium:tthorium:oncompileroutput}).


\begin{verbatim}
TThoriumOnOpenModule = procedure(Sender: TThorium;
                                 const ModuleName: String;
                                 var Stream: TStream) of object
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumonopenmodule}
\index{TThoriumOnOpenModule}
See TThorium.OnOpenModule (\pageref{thoriumcorepkg:thorium:tthorium:onopenmodule})


\begin{verbatim}
TThoriumOnPropertyGet = procedure(Sender: TThoriumLibraryProperty;
                                  var AThoriumValue: TThoriumValue)
                                   of object
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumonpropertyget}
\index{TThoriumOnPropertyGet}
An event of this kind is needed when an event based library property is read.


\begin{verbatim}
TThoriumOnPropertySet = procedure(Sender: TThoriumLibraryProperty;
                                  const AThoriumValue: TThoriumValue)
                                   of object
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumonpropertyset}
\index{TThoriumOnPropertySet}
An event of this kind is called when an event based library property is written.


\begin{verbatim}
TThoriumOnPropertySetCallback = procedure
                                          (Sender: TThoriumLibraryProperty;
                                          const AThoriumValue: TThoriumValue;
                                          var AllowSet: Boolean)
                                           of object
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumonpropertysetcallback}
\index{TThoriumOnPropertySetCallback}
This kind of event gets called when a non-event based library with write-hook gets written.


\begin{verbatim}
TThoriumOnRequireModule = procedure(Sender: TThorium;const Name: String;
                                    var ANewModule: TThoriumModule)
                                     of object
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumonrequiremodule}
\index{TThoriumOnRequireModule}
See TThorium.OnRequireModule (\pageref{thoriumcorepkg:thorium:tthorium:onrequiremodule}).


\begin{verbatim}
TThoriumPersistentClass = Class of TThoriumPersistent
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumpersistentclass}
\index{TThoriumPersistentClass}



\begin{verbatim}
TThoriumQualifiedIdentifier = record
  FullStr : String;
  Kind : TThoriumQualifiedIdentifierKind;
  IsStatic : Boolean;
  FinalType : TThoriumType;
  Value : TThoriumValue;
  GetJumpMarks : TThoriumIntArray;
  GetCode : TThoriumInstructionArray;
  SetJumpMarks : TThoriumIntArray;
  SetCode : TThoriumInstructionArray;
  UsedExtendedTypes : Array of TThoriumHostObjectType;
  UsedLibraryProps : Array of TThoriumLibraryProperty;
end

\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumqualifiedidentifier}
\index{TThoriumQualifiedIdentifier}
This record represents a fully qualified identifier, which means that enough parsing has been done to find out what kind of identifier it is and how to access it (both read and write). It also keeps track about which types and library properties are accessed.


\begin{verbatim}
TThoriumRegisters = Array[0..THORIUM_REGISTER_COUNT-1] of TThoriumValue
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumregisters}
\index{TThoriumRegisters}
An array which reflects the whole set of registers a Thorium virtual machine contains.


\begin{verbatim}
TThoriumRelocation = record
  ByteOffset : Cardinal;
  ObjectIndex : Cardinal;
end

\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumrelocation}
\index{TThoriumRelocation}
Information about a relocation which has to be done when loading a module.


\begin{verbatim}
TThoriumRTTIMethods = Array of TThoriumHostMethodBase
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumrttimethods}
\index{TThoriumRTTIMethods}
An array of host methods for RTTI based host object types.


\begin{verbatim}
TThoriumRTTIMethodsCallback = procedure(Sender: TThoriumRTTIObjectType;
                                        var Methods: TThoriumRTTIMethods)
                                         of object
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumrttimethodscallback}
\index{TThoriumRTTIMethodsCallback}



\begin{verbatim}
TThoriumRTTIStaticMethods = Array of TThoriumHostFunctionBase
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumrttistaticmethods}
\index{TThoriumRTTIStaticMethods}
An array of static methods for RTTI based host object types.


\begin{verbatim}
TThoriumRTTIStaticMethodsCallback = procedure
                                              (Sender: TThoriumRTTIObjectType;
                                              var Methods: TThoriumRTTIStaticMethods)
                                               of object
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumrttistaticmethodscallback}
\index{TThoriumRTTIStaticMethodsCallback}



\begin{verbatim}
TThoriumSimpleMethod = procedure(const Input: Array of Pointer;
                                 Result: PThoriumValue) of object
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumsimplemethod}
\index{TThoriumSimpleMethod}
This is the only kind of function which can be called without NativeCall.


\begin{verbatim}
TThoriumSimpleVarargs = record
  Count : SizeUInt;
  Data : Pointer;
end

\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumsimplevarargs}
\index{TThoriumSimpleVarargs}
This record is used in simple (i.e. not NativeCall based) calls to host environment functions to represent an array passed to the function.


\begin{verbatim}
TThoriumStackEntry = record
end

\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumstackentry}
\index{TThoriumStackEntry}
Each stack entry is represented by an instance of this record. It can contain either a value, a stack frame or a varargs-container.


\begin{verbatim}
TThoriumStackEntryType = (etValue,etStackFrame,etVarargs,etNull)
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumstackentrytype}
\index{TThoriumStackEntryType}
\begin{FPCltable}{ll}{Enumeration values for type TThoriumStackEntryType
}{table1}
Value
 & Explanation
\\ \hline
etNull
 & \\
etStackFrame
 & \\
etValue
 & \\
etVarargs
 & \\
\end{FPCltable}



\begin{verbatim}
TThoriumTableEntry = record
  Name : PString;
  Scope : Integer;
  _Type : TThoriumTableEntryType;
  Offset : Integer;
  TypeSpec : TThoriumType;
  Value : TThoriumValue;
  Ptr : Pointer;
end

\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumtableentry}
\index{TThoriumTableEntry}
Each entry in an identifier table of Thorium is represented by an instance of this record. It contains information about the name, which type of object it is and where and how to access it.


\begin{verbatim}
TThoriumType = record
end

\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumtype}
\index{TThoriumType}
This record reflects a type which can be processed by Thorium.


\begin{verbatim}
TThoriumValue = record
end

\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumvalue}
\index{TThoriumValue}
A value which can be processed by Thorium. This can either be a host object based or a built-in value. Functions are not supported during runtime.


\begin{verbatim}
TThoriumValues = Array of TThoriumValue
\end{verbatim}
\label{thoriumcorepkg:thorium:tthoriumvalues}
\index{TThoriumValues}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Procedures and functions
\section{Procedures and functions}
\label{thoriumfunctions}
% ThoriumCreateExtendedTypeValue
\subsection{ThoriumCreateExtendedTypeValue}
\label{thoriumcorepkg:thorium:thoriumcreateextendedtypevalue}
\index{ThoriumCreateExtendedTypeValue}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function ThoriumCreateExtendedTypeValue
                                       (const TypeClass: TThoriumHostObjectType)
                                        : TThoriumValue
\end{verbatim}
\Visibility
default
\end{FPCList}
% ThoriumCreateFloatValue
\subsection{ThoriumCreateFloatValue}
\label{thoriumcorepkg:thorium:thoriumcreatefloatvalue}
\index{ThoriumCreateFloatValue}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function ThoriumCreateFloatValue(const Value: TThoriumFloat)
                                 : TThoriumValue
\end{verbatim}
\Visibility
default
\end{FPCList}
% ThoriumCreateIntegerValue
\subsection{ThoriumCreateIntegerValue}
\label{thoriumcorepkg:thorium:thoriumcreateintegervalue}
\index{ThoriumCreateIntegerValue}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function ThoriumCreateIntegerValue(const Value: TThoriumInteger)
                                   : TThoriumValue
\end{verbatim}
\Visibility
default
\end{FPCList}
% ThoriumCreateStringValue
\subsection{ThoriumCreateStringValue}
\label{thoriumcorepkg:thorium:thoriumcreatestringvalue}
\index{ThoriumCreateStringValue}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function ThoriumCreateStringValue(const Value: TThoriumString)
                                  : TThoriumValue
\end{verbatim}
\Visibility
default
\end{FPCList}
% ThoriumCreateValue
\subsection{ThoriumCreateValue}
\label{thoriumcorepkg:thorium:thoriumcreatevalue}
\index{ThoriumCreateValue}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function ThoriumCreateValue(const ATypeSpec: TThoriumType)
                            : TThoriumValue
\end{verbatim}
\Visibility
default
\end{FPCList}
% ThoriumExternalVarTypeToTypeSpec
\subsection{ThoriumExternalVarTypeToTypeSpec}
\label{thoriumcorepkg:thorium:thoriumexternalvartypetotypespec}
\index{ThoriumExternalVarTypeToTypeSpec}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure ThoriumExternalVarTypeToTypeSpec
                                          (VarType: PThoriumExternalFunctionVarType;
                                          out TypeSpec: TThoriumType)
\end{verbatim}
\Visibility
default
\end{FPCList}
% ThoriumInstructionToStr
\subsection{ThoriumInstructionToStr}
\label{thoriumcorepkg:thorium:thoriuminstructiontostr}
\index{ThoriumInstructionToStr}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function ThoriumInstructionToStr(AInstruction: TThoriumInstruction)
                                 : String
\end{verbatim}
\Visibility
default
\end{FPCList}
% ThoriumMakeOOPEvent
\subsection{ThoriumMakeOOPEvent}
\label{thoriumcorepkg:thorium:thoriummakeoopevent}
\index{ThoriumMakeOOPEvent}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function ThoriumMakeOOPEvent(ACode: Pointer;Userdata: Pointer) : TMethod
\end{verbatim}
\Visibility
default
\end{FPCList}
% ThoriumRegisterToStr
\subsection{ThoriumRegisterToStr}
\label{thoriumcorepkg:thorium:thoriumregistertostr}
\index{ThoriumRegisterToStr}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function ThoriumRegisterToStr(ARegisterID: TThoriumRegisterID) : String
\end{verbatim}
\Visibility
default
\end{FPCList}
% ThoriumValueToStr
\subsection{ThoriumValueToStr}
\label{thoriumcorepkg:thorium:thoriumvaluetostr}
\index{ThoriumValueToStr}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function ThoriumValueToStr(const Value: TThoriumValue) : String
\end{verbatim}
\Visibility
default
\end{FPCList}
% ThoriumVarTypeToTypeSpec
\subsection{ThoriumVarTypeToTypeSpec}
\label{thoriumcorepkg:thorium:thoriumvartypetotypespec}
\index{ThoriumVarTypeToTypeSpec}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure ThoriumVarTypeToTypeSpec(VarType: TThoriumHostType;
                                  var TypeSpec: TThoriumType)
\end{verbatim}
\Visibility
default
\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% EThoriumCompilerException
\section{EThoriumCompilerException}
\label{thoriumcorepkg:thorium:ethoriumcompilerexception}
\index{EThoriumCompilerException}
% Description
\subsection{Description}
This exception is thrown whenever the compiler enters a state which was not expected to happen by the author. You should inform the author of Thorium about any exception of this kind you catch and provide a sample script to produce it.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% EThoriumDebuggerException
\section{EThoriumDebuggerException}
\label{thoriumcorepkg:thorium:ethoriumdebuggerexception}
\index{EThoriumDebuggerException}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% EThoriumDependencyException
\section{EThoriumDependencyException}
\label{thoriumcorepkg:thorium:ethoriumdependencyexception}
\index{EThoriumDependencyException}
% Description
\subsection{Description}
This exception gets thrown for example by the LoadModuleFromStream (\pageref{thoriumcorepkg:thorium:tthorium:loadmodulefromstream}) method when a required module or library cannot be found.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% EThoriumException
\section{EThoriumException}
\label{thoriumcorepkg:thorium:ethoriumexception}
\index{EThoriumException}
% Description
\subsection{Description}
An exception of this class is only thrown when no other of the specialized exceptions matches the situation. Useful to catch any exception thrown by Thorium.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% EThoriumHashException
\section{EThoriumHashException}
\label{thoriumcorepkg:thorium:ethoriumhashexception}
\index{EThoriumHashException}
% Description
\subsection{Description}
This kind of exception is thrown when a hash check for a module, library, function, property or class type fails.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% EThoriumRuntimeException
\section{EThoriumRuntimeException}
\label{thoriumcorepkg:thorium:ethoriumruntimeexception}
\index{EThoriumRuntimeException}
% Description
\subsection{Description}
The virtual machine and other runtime parts of Thorium throw this kind of exception when anything is wrong. This includes mismatched parameter types or counts.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% EThoriumRuntimeExecutionException
\section{EThoriumRuntimeExecutionException}
\label{thoriumcorepkg:thorium:ethoriumruntimeexecutionexception}
\index{EThoriumRuntimeExecutionException}
% Description
\subsection{Description}
The virtual machine catches any exception thrown by any instruction and encapsulates it in a new exception of this class. It contains additional information like the module in which the exception occured, the line, the instruction address and which exact instruction caused the exception. A reference to the original exception is supplied too.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:ethoriumruntimeexecutionexception:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:ethoriumruntimeexecutionexception:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:ethoriumruntimeexecutionexception:destroy} & Destroy  &  \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:ethoriumruntimeexecutionexception:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:ethoriumruntimeexecutionexception:originalexception} & OriginalException & r & Access the original exception. \\
\hline
\end{tabularx}
% EThoriumRuntimeExecutionException.Create
\subsection{EThoriumRuntimeExecutionException.Create}
\label{thoriumcorepkg:thorium:ethoriumruntimeexecutionexception:create}
\index{EThoriumRuntimeExecutionException.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create(Module: TThoriumModule;
                  InstructionAddr: TThoriumInstructionAddress;
                  Instruction: PThoriumInstruction;
                  OriginalException: Exception)
\end{verbatim}
\Visibility
public
\end{FPCList}
% EThoriumRuntimeExecutionException.Destroy
\subsection{EThoriumRuntimeExecutionException.Destroy}
\label{thoriumcorepkg:thorium:ethoriumruntimeexecutionexception:destroy}
\index{EThoriumRuntimeExecutionException.Destroy}
\begin{FPCList}
\Declaration 

\begin{verbatim}
destructor Destroy;  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% EThoriumRuntimeExecutionException.OriginalException
\subsection{EThoriumRuntimeExecutionException.OriginalException}
\label{thoriumcorepkg:thorium:ethoriumruntimeexecutionexception:originalexception}
\index{EThoriumRuntimeExecutionException.OriginalException}
\begin{FPCList}
\Synopsis
Access the original exception.\Declaration 

\begin{verbatim}
Property OriginalException : Exception
\end{verbatim}
\Visibility
public
\Access
Read
\Description
This property provides access to the original exception thrown by the instruction.\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% EThoriumVerificationException
\section{EThoriumVerificationException}
\label{thoriumcorepkg:thorium:ethoriumverificationexception}
\index{EThoriumVerificationException}
% Description
\subsection{Description}
During the various LoadFromStream methods a lot of effort is done to ensure that any reference to anything is resolved correctly and does not result in some weird errors. If anything cannot be resolved for sure, an exception of this class or a descendant is thrown.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% IThoriumPersistent
\section{IThoriumPersistent}
\label{thoriumcorepkg:thorium:ithoriumpersistent}
\index{IThoriumPersistent}
% Description
\subsection{Description}
Any class which is to be published to Thorium using TThoriumRTTIObjectType (\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype}) must implement this interface. It is used to notify the class about copies on the stack and in the registers of Thorium to avoid it from being freed. % Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:ithoriumpersistent:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:ithoriumpersistent:disablehostcontrol} & DisableHostControl  & Enable freeing by reference count. \\
\pageref{thoriumcorepkg:thorium:ithoriumpersistent:enablehostcontrol} & EnableHostControl  & Disable free by reference counting. \\
\pageref{thoriumcorepkg:thorium:ithoriumpersistent:freereference} & FreeReference  & Release a reference. \\
\pageref{thoriumcorepkg:thorium:ithoriumpersistent:getreference} & GetReference  & Increase reference counter and return reference. \\
\hline
\end{tabularx}
% IThoriumPersistent.EnableHostControl
\subsection{IThoriumPersistent.EnableHostControl}
\label{thoriumcorepkg:thorium:ithoriumpersistent:enablehostcontrol}
\index{IThoriumPersistent.EnableHostControl}
\begin{FPCList}
\Synopsis
Disable free by reference counting.\Declaration 

\begin{verbatim}
procedure EnableHostControl
\end{verbatim}
\Visibility
default
\Description
An implementation of this method is expected to set a flag which disables freeing the object when it runs out of references.\end{FPCList}
% IThoriumPersistent.DisableHostControl
\subsection{IThoriumPersistent.DisableHostControl}
\label{thoriumcorepkg:thorium:ithoriumpersistent:disablehostcontrol}
\index{IThoriumPersistent.DisableHostControl}
\begin{FPCList}
\Synopsis
Enable freeing by reference count.\Declaration 

\begin{verbatim}
procedure DisableHostControl
\end{verbatim}
\Visibility
default
\Description
An implementation of this method is expected to set a flag which enables freeing the object when it runs out of references. It should also immediately free the object if the reference counter is already at zero.\end{FPCList}
% IThoriumPersistent.FreeReference
\subsection{IThoriumPersistent.FreeReference}
\label{thoriumcorepkg:thorium:ithoriumpersistent:freereference}
\index{IThoriumPersistent.FreeReference}
\begin{FPCList}
\Synopsis
Release a reference.\Declaration 

\begin{verbatim}
procedure FreeReference
\end{verbatim}
\Visibility
default
\Description
An implementation of this method is expected to decrease the reference counter of the instance by one and, if applicable, free the instance.\end{FPCList}
% IThoriumPersistent.GetReference
\subsection{IThoriumPersistent.GetReference}
\label{thoriumcorepkg:thorium:ithoriumpersistent:getreference}
\index{IThoriumPersistent.GetReference}
\begin{FPCList}
\Synopsis
Increase reference counter and return reference.\Declaration 

\begin{verbatim}
function GetReference : TObject
\end{verbatim}
\Visibility
default
\Description
An implementation of this method is expected to increase the reference counter of the object by one and return the object itself too.\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThorium
\section{TThorium}
\label{thoriumcorepkg:thorium:tthorium}
\index{TThorium}
% Description
\subsection{Description}
This class manages all the modules, libraries and the virtual machine and thus is the class you probably want to use first. It represents a whole Thorium context. There may even exist several instances of this class representing different Thorium contexts.  Please note that this class is not threadsafe and each instance should only be used by exactly one thread or the usage must be carefully synchronized since accessing modules or even the virtual machine at the same time from two different threads, maybe while an execution is running in a third thread will cause at least interesting errors.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthorium:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthorium:clearlibraries} & ClearLibraries  & Unload all loaded libraries. \\
\pageref{thoriumcorepkg:thorium:tthorium:clearmodules} & ClearModules  & Delete all loaded modules. \\
\pageref{thoriumcorepkg:thorium:tthorium:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthorium:destroy} & Destroy  &  \\
\pageref{thoriumcorepkg:thorium:tthorium:docompileroutput} & DoCompilerOutput  &  \\
\pageref{thoriumcorepkg:thorium:tthorium:doopenmodule} & DoOpenModule  &  \\
\pageref{thoriumcorepkg:thorium:tthorium:dorequiremodule} & DoRequireModule  &  \\
\pageref{thoriumcorepkg:thorium:tthorium:findlibrary} & FindLibrary  & Return a library by name. \\
\pageref{thoriumcorepkg:thorium:tthorium:findmodule} & FindModule  & Look up a module by name. \\
\pageref{thoriumcorepkg:thorium:tthorium:initializevirtualmachine} & InitializeVirtualMachine  & Attach and initialize a virtual machine. \\
\pageref{thoriumcorepkg:thorium:tthorium:loadlibrary} & LoadLibrary  & Load a host library. \\
\pageref{thoriumcorepkg:thorium:tthorium:loadmodulefromfile} & LoadModuleFromFile  & Load a module from file. \\
\pageref{thoriumcorepkg:thorium:tthorium:loadmodulefromstream} & LoadModuleFromStream  & Load a module from stream. \\
\pageref{thoriumcorepkg:thorium:tthorium:newmodule} & NewModule  & Create a new empty module. \\
\pageref{thoriumcorepkg:thorium:tthorium:releasevirtualmachine} & ReleaseVirtualMachine  & Free the virtual machine. \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthorium:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthorium:hostlibrary} & HostLibrary & r & Access to loaded libraries \\
\pageref{thoriumcorepkg:thorium:tthorium:hostlibrarycount} & HostLibraryCount & r & Amount of loaded libraries \\
\pageref{thoriumcorepkg:thorium:tthorium:locked} & Locked & r & Whether the context is locked. \\
\pageref{thoriumcorepkg:thorium:tthorium:module} & Module & r & Access to modules in the context. \\
\pageref{thoriumcorepkg:thorium:tthorium:modulecount} & ModuleCount & r & Count of loaded modules. \\
\pageref{thoriumcorepkg:thorium:tthorium:oncompileroutput} & OnCompilerOutput & rw & Event for compiler output. \\
\pageref{thoriumcorepkg:thorium:tthorium:onopenmodule} & OnOpenModule & rw & Event when a file needs to be opened. \\
\pageref{thoriumcorepkg:thorium:tthorium:onrequiremodule} & OnRequireModule & rw & Event before a module is loaded from file. \\
\pageref{thoriumcorepkg:thorium:tthorium:virtualmachine} & VirtualMachine & r & Access to the attached virtual machine. \\
\hline
\end{tabularx}
% TThorium.Create
\subsection{TThorium.Create}
\label{thoriumcorepkg:thorium:tthorium:create}
\index{TThorium.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create;  Virtual
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThorium.Destroy
\subsection{TThorium.Destroy}
\label{thoriumcorepkg:thorium:tthorium:destroy}
\index{TThorium.Destroy}
\begin{FPCList}
\Declaration 

\begin{verbatim}
destructor Destroy;  Override
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThorium.DoCompilerOutput
\subsection{TThorium.DoCompilerOutput}
\label{thoriumcorepkg:thorium:tthorium:docompileroutput}
\index{TThorium.DoCompilerOutput}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure DoCompilerOutput(const Module: TThoriumModule;
                          const Msg: String);  Virtual
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThorium.DoRequireModule
\subsection{TThorium.DoRequireModule}
\label{thoriumcorepkg:thorium:tthorium:dorequiremodule}
\index{TThorium.DoRequireModule}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function DoRequireModule(const Name: String;NeededHash: PThoriumHash)
                         : TThoriumModule;  Virtual
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThorium.DoOpenModule
\subsection{TThorium.DoOpenModule}
\label{thoriumcorepkg:thorium:tthorium:doopenmodule}
\index{TThorium.DoOpenModule}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function DoOpenModule(const ModuleName: String) : TStream;  Virtual
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThorium.ClearLibraries
\subsection{TThorium.ClearLibraries}
\label{thoriumcorepkg:thorium:tthorium:clearlibraries}
\index{TThorium.ClearLibraries}
\begin{FPCList}
\Synopsis
Unload all loaded libraries.\Declaration 

\begin{verbatim}
procedure ClearLibraries
\end{verbatim}
\Visibility
public
\Description
Unloads all libraries loaded in the current context. Since modules may depend on these libraries they are cleared too.\end{FPCList}
% TThorium.ClearModules
\subsection{TThorium.ClearModules}
\label{thoriumcorepkg:thorium:tthorium:clearmodules}
\index{TThorium.ClearModules}
\begin{FPCList}
\Synopsis
Delete all loaded modules.\Declaration 

\begin{verbatim}
procedure ClearModules
\end{verbatim}
\Visibility
public
\Description
Deletes all modules which are currently loaded in the context. Libraries stay unchanged though.\end{FPCList}
% TThorium.FindLibrary
\subsection{TThorium.FindLibrary}
\label{thoriumcorepkg:thorium:tthorium:findlibrary}
\index{TThorium.FindLibrary}
\begin{FPCList}
\Synopsis
Return a library by name.\Declaration 

\begin{verbatim}
function FindLibrary(const Name: String) : TThoriumLibrary
\end{verbatim}
\Visibility
public
\Description
Looks up the instance of a library whose name is equal to the one passed in \textit{Name} and returns it if any is found. Otherwise returns nil.\end{FPCList}
% TThorium.FindModule
\subsection{TThorium.FindModule}
\label{thoriumcorepkg:thorium:tthorium:findmodule}
\index{TThorium.FindModule}
\begin{FPCList}
\Synopsis
Look up a module by name.\Declaration 

\begin{verbatim}
function FindModule(const Name: String;AllowLoad: Boolean)
                    : TThoriumModule
\end{verbatim}
\Visibility
public
\Description
This method searches for a module in the context which is called like \textit{Name}. If no module is found and \textit{AllowLoad} is true, an attempt to load the module using the LoadModuleFromFile (\pageref{thoriumcorepkg:thorium:tthorium:loadmodulefromfile}) method is started and the loaded module is returned if it is successful. Otherwise nil is returned.\end{FPCList}
% TThorium.InitializeVirtualMachine
\subsection{TThorium.InitializeVirtualMachine}
\label{thoriumcorepkg:thorium:tthorium:initializevirtualmachine}
\index{TThorium.InitializeVirtualMachine}
\begin{FPCList}
\Synopsis
Attach and initialize a virtual machine.\Declaration 

\begin{verbatim}
procedure InitializeVirtualMachine
\end{verbatim}
\Visibility
public
\Description
Makes sure a virtual machine is initialized and attached to the context. This also brings the context in a locked state which disallows loading of modules and libraries to keep the virtual machine in a consistent state.\end{FPCList}
% TThorium.LoadLibrary
\subsection{TThorium.LoadLibrary}
\label{thoriumcorepkg:thorium:tthorium:loadlibrary}
\index{TThorium.LoadLibrary}
\begin{FPCList}
\Synopsis
Load a host library.\Declaration 

\begin{verbatim}
function LoadLibrary(const ALibrary: TThoriumLibraryClass)
                     : TThoriumLibrary
\end{verbatim}
\Visibility
public
\Description
Creates an instance of the library class \textit{ALibrary}, loads it into the context and returns it.\end{FPCList}
% TThorium.LoadModuleFromFile
\subsection{TThorium.LoadModuleFromFile}
\label{thoriumcorepkg:thorium:tthorium:loadmodulefromfile}
\index{TThorium.LoadModuleFromFile}
\begin{FPCList}
\Synopsis
Load a module from file.\Declaration 

\begin{verbatim}
function LoadModuleFromFile(AModuleName: String;
                           NeededHash: PThoriumHash) : TThoriumModule
\end{verbatim}
\Visibility
public
\Description
This method tries to load a module from file using any callbacks assigned to the context. If \textit{NeededHash} is not nil, the hash of the module is compared against it and if they do not match, an EThoriumVerificationException (\pageref{thoriumcorepkg:thorium:ethoriumverificationexception}) exception is thrown.\end{FPCList}
% TThorium.LoadModuleFromStream
\subsection{TThorium.LoadModuleFromStream}
\label{thoriumcorepkg:thorium:tthorium:loadmodulefromstream}
\index{TThorium.LoadModuleFromStream}
\begin{FPCList}
\Synopsis
Load a module from stream.\Declaration 

\begin{verbatim}
function LoadModuleFromStream(AStream: TStream;AName: String;
                             NeededHash: PThoriumHash) : TThoriumModule
\end{verbatim}
\Visibility
public
\Description
This method will attempt to load a module from the stream given. If no name is passed via \textit{AName}, the module will be assigned a generated anonymous name. If a hash is supplied via \textit{NeededHash}, the hash of the loaded module is compared against it and, in case of a mismatch, an EThoriumVerificationException (\pageref{thoriumcorepkg:thorium:ethoriumverificationexception}) is thrown.\end{FPCList}
% TThorium.NewModule
\subsection{TThorium.NewModule}
\label{thoriumcorepkg:thorium:tthorium:newmodule}
\index{TThorium.NewModule}
\begin{FPCList}
\Synopsis
Create a new empty module.\Declaration 

\begin{verbatim}
function NewModule(AName: String) : TThoriumModule
\end{verbatim}
\Visibility
public
\Description
This method creates a new empty module, registers it with the context and returns it. If \textit{AName} is empty, a anonymous name is generated and assigned to the module.\end{FPCList}
% TThorium.ReleaseVirtualMachine
\subsection{TThorium.ReleaseVirtualMachine}
\label{thoriumcorepkg:thorium:tthorium:releasevirtualmachine}
\index{TThorium.ReleaseVirtualMachine}
\begin{FPCList}
\Synopsis
Free the virtual machine.\Declaration 

\begin{verbatim}
procedure ReleaseVirtualMachine
\end{verbatim}
\Visibility
public
\Description
If a virtual machine is attached to the Thorium context, it will get freed by this call. This also reverts the locked state of the context.\end{FPCList}
% TThorium.HostLibrary
\subsection{TThorium.HostLibrary}
\label{thoriumcorepkg:thorium:tthorium:hostlibrary}
\index{TThorium.HostLibrary}
\begin{FPCList}
\Synopsis
Access to loaded libraries\Declaration 

\begin{verbatim}
Property HostLibrary[Index: Integer]: TThoriumLibrary
\end{verbatim}
\Visibility
public
\Access
Read
\Description
This property provides access to the host libraries loaded in the current context.\end{FPCList}
% TThorium.HostLibraryCount
\subsection{TThorium.HostLibraryCount}
\label{thoriumcorepkg:thorium:tthorium:hostlibrarycount}
\index{TThorium.HostLibraryCount}
\begin{FPCList}
\Synopsis
Amount of loaded libraries\Declaration 

\begin{verbatim}
Property HostLibraryCount : Integer
\end{verbatim}
\Visibility
public
\Access
Read
\Description
Property which reflects the amount of libraries loaded into the context.\end{FPCList}
% TThorium.Locked
\subsection{TThorium.Locked}
\label{thoriumcorepkg:thorium:tthorium:locked}
\index{TThorium.Locked}
\begin{FPCList}
\Synopsis
Whether the context is locked.\Declaration 

\begin{verbatim}
Property Locked : Boolean
\end{verbatim}
\Visibility
public
\Access
Read
\Description
Reflects whether the context is locked (i.e. a virtual machine is attached).\end{FPCList}
% TThorium.Module
\subsection{TThorium.Module}
\label{thoriumcorepkg:thorium:tthorium:module}
\index{TThorium.Module}
\begin{FPCList}
\Synopsis
Access to modules in the context.\Declaration 

\begin{verbatim}
Property Module[Index: Integer]: TThoriumModule
\end{verbatim}
\Visibility
public
\Access
Read
\Description
This property provides access to the modules loaded into the current context.\end{FPCList}
% TThorium.ModuleCount
\subsection{TThorium.ModuleCount}
\label{thoriumcorepkg:thorium:tthorium:modulecount}
\index{TThorium.ModuleCount}
\begin{FPCList}
\Synopsis
Count of loaded modules.\Declaration 

\begin{verbatim}
Property ModuleCount : Integer
\end{verbatim}
\Visibility
public
\Access
Read
\Description
This property reflects the amount of loaded modules.\end{FPCList}
% TThorium.OnCompilerOutput
\subsection{TThorium.OnCompilerOutput}
\label{thoriumcorepkg:thorium:tthorium:oncompileroutput}
\index{TThorium.OnCompilerOutput}
\begin{FPCList}
\Synopsis
Event for compiler output.\Declaration 

\begin{verbatim}
Property OnCompilerOutput : TThoriumOnCompilerOutput
\end{verbatim}
\Visibility
public
\Access
Read,Write
\Description
This event is called whenever a module which gets compiled in the context produces compiler output. Useful for logging and keeping track of compilations.\end{FPCList}
% TThorium.OnOpenModule
\subsection{TThorium.OnOpenModule}
\label{thoriumcorepkg:thorium:tthorium:onopenmodule}
\index{TThorium.OnOpenModule}
\begin{FPCList}
\Synopsis
Event when a file needs to be opened.\Declaration 

\begin{verbatim}
Property OnOpenModule : TThoriumOnOpenModule
\end{verbatim}
\Visibility
public
\Access
Read,Write
\Description
This event gets called when the context needs to open a file. If this event is not assigned, the default TFileStream mechanism will be used. Otherwise it is possible to redirect file request into other directories or a virtual file system.\end{FPCList}
% TThorium.OnRequireModule
\subsection{TThorium.OnRequireModule}
\label{thoriumcorepkg:thorium:tthorium:onrequiremodule}
\index{TThorium.OnRequireModule}
\begin{FPCList}
\Synopsis
Event before a module is loaded from file.\Declaration 

\begin{verbatim}
Property OnRequireModule : TThoriumOnRequireModule
\end{verbatim}
\Visibility
public
\Access
Read,Write
\Description
This event is called before a module is loaded from a file. You may hook it and replace it with a module of your choice (which may be already loaded, but which must not be in any context).\end{FPCList}
% TThorium.VirtualMachine
\subsection{TThorium.VirtualMachine}
\label{thoriumcorepkg:thorium:tthorium:virtualmachine}
\index{TThorium.VirtualMachine}
\begin{FPCList}
\Synopsis
Access to the attached virtual machine.\Declaration 

\begin{verbatim}
Property VirtualMachine : TThoriumVirtualMachine
\end{verbatim}
\Visibility
public
\Access
Read
\Description
If a virtual machine is attached, this property provides access. Otherwise it is nil.\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumDebuggingVirtualMachine
\section{TThoriumDebuggingVirtualMachine}
\label{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine}
\index{TThoriumDebuggingVirtualMachine}
% Description
\subsection{Description}
To be implemented and thus to be described later.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine:destroy} & Destroy  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine:execute} & Execute  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine:stepinto} & StepInto  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine:stepover} & StepOver  &  \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine:breakpointinstructions} & BreakpointInstructions & r &  \\
\pageref{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine:breakpointlines} & BreakpointLines & r &  \\
\pageref{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine:registers} & Registers & r &  \\
\pageref{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine:stack} & Stack & r &  \\
\pageref{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine:stepmode} & StepMode & rw &  \\
\hline
\end{tabularx}
% TThoriumDebuggingVirtualMachine.Create
\subsection{TThoriumDebuggingVirtualMachine.Create}
\label{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine:create}
\index{TThoriumDebuggingVirtualMachine.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create(AThorium: TThorium)
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumDebuggingVirtualMachine.Destroy
\subsection{TThoriumDebuggingVirtualMachine.Destroy}
\label{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine:destroy}
\index{TThoriumDebuggingVirtualMachine.Destroy}
\begin{FPCList}
\Declaration 

\begin{verbatim}
destructor Destroy;  Override
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumDebuggingVirtualMachine.Execute
\subsection{TThoriumDebuggingVirtualMachine.Execute}
\label{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine:execute}
\index{TThoriumDebuggingVirtualMachine.Execute}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure Execute(StartModuleIndex: Integer;StartInstruction: Integer;
                 CreateDefaultStackFrame: Boolean);  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumDebuggingVirtualMachine.StepInto
\subsection{TThoriumDebuggingVirtualMachine.StepInto}
\label{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine:stepinto}
\index{TThoriumDebuggingVirtualMachine.StepInto}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure StepInto
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumDebuggingVirtualMachine.StepOver
\subsection{TThoriumDebuggingVirtualMachine.StepOver}
\label{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine:stepover}
\index{TThoriumDebuggingVirtualMachine.StepOver}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure StepOver
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumDebuggingVirtualMachine.BreakpointInstructions
\subsection{TThoriumDebuggingVirtualMachine.BreakpointInstructions}
\label{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine:breakpointinstructions}
\index{TThoriumDebuggingVirtualMachine.BreakpointInstructions}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property BreakpointInstructions : TThoriumIntList
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
% TThoriumDebuggingVirtualMachine.BreakpointLines
\subsection{TThoriumDebuggingVirtualMachine.BreakpointLines}
\label{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine:breakpointlines}
\index{TThoriumDebuggingVirtualMachine.BreakpointLines}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property BreakpointLines : TThoriumIntList
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
% TThoriumDebuggingVirtualMachine.Registers
\subsection{TThoriumDebuggingVirtualMachine.Registers}
\label{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine:registers}
\index{TThoriumDebuggingVirtualMachine.Registers}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property Registers[ARegID: TThoriumRegisterID]: PThoriumValue
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
% TThoriumDebuggingVirtualMachine.Stack
\subsection{TThoriumDebuggingVirtualMachine.Stack}
\label{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine:stack}
\index{TThoriumDebuggingVirtualMachine.Stack}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property Stack : TThoriumStack
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
% TThoriumDebuggingVirtualMachine.StepMode
\subsection{TThoriumDebuggingVirtualMachine.StepMode}
\label{thoriumcorepkg:thorium:tthoriumdebuggingvirtualmachine:stepmode}
\index{TThoriumDebuggingVirtualMachine.StepMode}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property StepMode : TThoriumDebuggerStepMode
\end{verbatim}
\Visibility
public
\Access
Read,Write
\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumFunction
\section{TThoriumFunction}
\label{thoriumcorepkg:thorium:tthoriumfunction}
\index{TThoriumFunction}
% Description
\subsection{Description}
This class represents a function declared in a Thorium script, probably published by a module. It is also used as a temporary object by the compiler to store information about the current function.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumfunction:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumfunction:asevent} & AsEvent  & Not implemented yet. \\
\pageref{thoriumcorepkg:thorium:tthoriumfunction:call} & Call  & Call the function \\
\pageref{thoriumcorepkg:thorium:tthoriumfunction:create} & Create  & Create an instance. \\
\pageref{thoriumcorepkg:thorium:tthoriumfunction:destroy} & Destroy  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumfunction:duplicate} & Duplicate  & Duplicate this instance. \\
\pageref{thoriumcorepkg:thorium:tthoriumfunction:loadfromstream} & LoadFromStream  & Load specification from stream. \\
\pageref{thoriumcorepkg:thorium:tthoriumfunction:safecall} & SafeCall  & Call the function with additional checks \\
\pageref{thoriumcorepkg:thorium:tthoriumfunction:savetostream} & SaveToStream  & Saves the specification to stream. \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthoriumfunction:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumfunction:entrypoint} & EntryPoint & r & Entry point address. \\
\pageref{thoriumcorepkg:thorium:tthoriumfunction:nestinglevel} & NestingLevel & r & Deprecated. \\
\pageref{thoriumcorepkg:thorium:tthoriumfunction:parameters} & Parameters & r & Parameter specification. \\
\pageref{thoriumcorepkg:thorium:tthoriumfunction:prototyped} & Prototyped & r & Whether the function is still prototyped. \\
\pageref{thoriumcorepkg:thorium:tthoriumfunction:returnvalues} & ReturnValues & r & Return value specification. \\
\pageref{thoriumcorepkg:thorium:tthoriumfunction:visibilitylevel} & VisibilityLevel & r & The level of visibility. \\
\hline
\end{tabularx}
% TThoriumFunction.Create
\subsection{TThoriumFunction.Create}
\label{thoriumcorepkg:thorium:tthoriumfunction:create}
\index{TThoriumFunction.Create}
\begin{FPCList}
\Synopsis
Create an instance.\Declaration 

\begin{verbatim}
constructor Create(AModule: TThoriumModule);  Override
\end{verbatim}
\Visibility
default
\Description
This function creates a new function specification. It expects the module which owns this declaration as the first and only parameter. Normally there is no need for you to create an instance of this class, since the compiler does it for you.\SeeAlso
TThoriumFunction.Duplicate (\pageref{thoriumcorepkg:thorium:tthoriumfunction:duplicate})\end{FPCList}
% TThoriumFunction.Destroy
\subsection{TThoriumFunction.Destroy}
\label{thoriumcorepkg:thorium:tthoriumfunction:destroy}
\index{TThoriumFunction.Destroy}
\begin{FPCList}
\Declaration 

\begin{verbatim}
destructor Destroy;  Override
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumFunction.Call
\subsection{TThoriumFunction.Call}
\label{thoriumcorepkg:thorium:tthoriumfunction:call}
\index{TThoriumFunction.Call}
\begin{FPCList}
\Synopsis
Call the function\Declaration 

\begin{verbatim}
function Call(AParameters: Array of TThoriumValue) : TThoriumValue
\end{verbatim}
\Visibility
public
\Description
Calls the function using the virtual machine assigned to the Thorium engine which owns the module owning this function. The contents of the array of TThoriumValue (\pageref{thoriumcorepkg:thorium:tthoriumvalue}) being the first parameter are passed as parameters to the function when calling it. There are no checks made whether the type or amount of parameters is correct for this function. If you need this, use SafeCall (\pageref{thoriumcorepkg:thorium:tthoriumfunction:safecall}) instead. This method returns the value which has been returned by the function. If the function does not supply any return value, the result is unspecified.\Errors
Throws an exception if no module is assigned, the assigned module does not have a Thorium engine assigned or the virtual machine has not been initialized.\SeeAlso
TThoriumFunction.SafeCall (\pageref{thoriumcorepkg:thorium:tthoriumfunction:safecall})\end{FPCList}
% TThoriumFunction.Duplicate
\subsection{TThoriumFunction.Duplicate}
\label{thoriumcorepkg:thorium:tthoriumfunction:duplicate}
\index{TThoriumFunction.Duplicate}
\begin{FPCList}
\Synopsis
Duplicate this instance.\Declaration 

\begin{verbatim}
function Duplicate : TThoriumFunction
\end{verbatim}
\Visibility
public
\Description
Creates a new instance of TThoriumFunction and fills it with the same data this instance has and returns it. This is mostly used by the compiler when publishing functions.\end{FPCList}
% TThoriumFunction.AsEvent
\subsection{TThoriumFunction.AsEvent}
\label{thoriumcorepkg:thorium:tthoriumfunction:asevent}
\index{TThoriumFunction.AsEvent}
\begin{FPCList}
\Synopsis
Not implemented yet.\Declaration 

\begin{verbatim}
function AsEvent(AParameters: Array of TThoriumHostType;
                ReturnType: TThoriumHostType)
                 : TThoriumFunctionCallbackCapsule;  Overload
function AsEvent(AParameters: Array of TThoriumHostType;
                ReturnType: TThoriumHostType;
                ExtParameters: Array of TThoriumHostObjectType;
                ExtReturnType: TThoriumHostObjectType)
                 : TThoriumFunctionCallbackCapsule;  Overload
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumFunction.LoadFromStream
\subsection{TThoriumFunction.LoadFromStream}
\label{thoriumcorepkg:thorium:tthoriumfunction:loadfromstream}
\index{TThoriumFunction.LoadFromStream}
\begin{FPCList}
\Synopsis
Load specification from stream.\Declaration 

\begin{verbatim}
procedure LoadFromStream(Stream: TStream);  Override
\end{verbatim}
\Visibility
public
\Description
Loads the specification of a function from the given stream and assigns it to this instance. There are not many checks made for valid values, so you should make sure the data is not corrupted. Hashes and identifier names are used to check for the validity of identifier references.\SeeAlso
TThoriumFunction.SaveToStream (\pageref{thoriumcorepkg:thorium:tthoriumfunction:savetostream})\end{FPCList}
% TThoriumFunction.SafeCall
\subsection{TThoriumFunction.SafeCall}
\label{thoriumcorepkg:thorium:tthoriumfunction:safecall}
\index{TThoriumFunction.SafeCall}
\begin{FPCList}
\Synopsis
Call the function with additional checks\Declaration 

\begin{verbatim}
function SafeCall(AParameters: Array of TThoriumValue) : TThoriumValue
\end{verbatim}
\Visibility
public
\Description
Other than the Call (\pageref{thoriumcorepkg:thorium:tthoriumfunction:call}) method this checks whether the types of the passed parameters and the parameter count matches those specified in this instance. If this is not the case, an exception is thrown. After that the default Call (\pageref{thoriumcorepkg:thorium:tthoriumfunction:call}) method is called.\Errors
Throws an exception when the types or count of parameters do not match.\SeeAlso
TThoriumFunction.Call (\pageref{thoriumcorepkg:thorium:tthoriumfunction:call})\end{FPCList}
% TThoriumFunction.SaveToStream
\subsection{TThoriumFunction.SaveToStream}
\label{thoriumcorepkg:thorium:tthoriumfunction:savetostream}
\index{TThoriumFunction.SaveToStream}
\begin{FPCList}
\Synopsis
Saves the specification to stream.\Declaration 

\begin{verbatim}
procedure SaveToStream(Stream: TStream);  Override
\end{verbatim}
\Visibility
public
\Description
Saves the specification of this instance to a stream. References to identifiers are encoded as their name and a hash to make sure they can be validated on loading.\SeeAlso
TThoriumFunction.LoadFromStream (\pageref{thoriumcorepkg:thorium:tthoriumfunction:loadfromstream})\end{FPCList}
% TThoriumFunction.EntryPoint
\subsection{TThoriumFunction.EntryPoint}
\label{thoriumcorepkg:thorium:tthoriumfunction:entrypoint}
\index{TThoriumFunction.EntryPoint}
\begin{FPCList}
\Synopsis
Entry point address.\Declaration 

\begin{verbatim}
Property EntryPoint : Integer
\end{verbatim}
\Visibility
public
\Access
Read
\Description
Address in the script byte code where the function begins. This information is crucial to call the method in the virtual machine.\end{FPCList}
% TThoriumFunction.NestingLevel
\subsection{TThoriumFunction.NestingLevel}
\label{thoriumcorepkg:thorium:tthoriumfunction:nestinglevel}
\index{TThoriumFunction.NestingLevel}
\begin{FPCList}
\Synopsis
Deprecated.\Declaration 

\begin{verbatim}
Property NestingLevel : Integer
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
% TThoriumFunction.Parameters
\subsection{TThoriumFunction.Parameters}
\label{thoriumcorepkg:thorium:tthoriumfunction:parameters}
\index{TThoriumFunction.Parameters}
\begin{FPCList}
\Synopsis
Parameter specification.\Declaration 

\begin{verbatim}
Property Parameters : TThoriumParameters
\end{verbatim}
\Visibility
public
\Access
Read
\Description
Pointer to an instance of TThoriumParameters (\pageref{thoriumcorepkg:thorium:tthoriumparameters}) representing the parameter list of the function. The names of the parameters are not saved.\SeeAlso
TThoriumFunction.ReturnValue (\pageref{thoriumcorepkg:thorium:tthoriumfunction})\end{FPCList}
% TThoriumFunction.Prototyped
\subsection{TThoriumFunction.Prototyped}
\label{thoriumcorepkg:thorium:tthoriumfunction:prototyped}
\index{TThoriumFunction.Prototyped}
\begin{FPCList}
\Synopsis
Whether the function is still prototyped.\Declaration 

\begin{verbatim}
Property Prototyped : Boolean
\end{verbatim}
\Visibility
public
\Access
Read
\Description
This is true when the function has not been implemented, only prototyped. You must not call a function which is only prototyped and normally the compiler should post errors about any function being only prototyped after the compilation has been finished.\end{FPCList}
% TThoriumFunction.ReturnValues
\subsection{TThoriumFunction.ReturnValues}
\label{thoriumcorepkg:thorium:tthoriumfunction:returnvalues}
\index{TThoriumFunction.ReturnValues}
\begin{FPCList}
\Synopsis
Return value specification.\Declaration 

\begin{verbatim}
Property ReturnValues : TThoriumParameters
\end{verbatim}
\Visibility
public
\Access
Read
\Description
Originally planned as list, now only the first element of the TThoriumParameters (\pageref{thoriumcorepkg:thorium:tthoriumparameters}) structure is used. This represents the type(s) of the return value the function gives. If this is empty, the function does not have any return value.\SeeAlso
TThoriumFunction.Parameters (\pageref{thoriumcorepkg:thorium:tthoriumfunction:parameters})\end{FPCList}
% TThoriumFunction.VisibilityLevel
\subsection{TThoriumFunction.VisibilityLevel}
\label{thoriumcorepkg:thorium:tthoriumfunction:visibilitylevel}
\index{TThoriumFunction.VisibilityLevel}
\begin{FPCList}
\Synopsis
The level of visibility.\Declaration 

\begin{verbatim}
Property VisibilityLevel : TThoriumVisibilityLevel
\end{verbatim}
\Visibility
public
\Access
Read
\Description
This property represents the visibility of the function. Normally you will only find functions which have this set to vsPublic, since private functions are not shown.\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumFunctionCallbackCapsule
\section{TThoriumFunctionCallbackCapsule}
\label{thoriumcorepkg:thorium:tthoriumfunctioncallbackcapsule}
\index{TThoriumFunctionCallbackCapsule}
% Description
\subsection{Description}
For future use.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumfunctioncallbackcapsule:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumfunctioncallbackcapsule:create} & Create  &  \\
\hline
\end{tabularx}
% TThoriumFunctionCallbackCapsule.Create
\subsection{TThoriumFunctionCallbackCapsule.Create}
\label{thoriumcorepkg:thorium:tthoriumfunctioncallbackcapsule:create}
\index{TThoriumFunctionCallbackCapsule.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create(AFunction: TThoriumFunction;
                  Parameters: Array of TThoriumHostType;
                  ReturnType: TThoriumHostType;
                  ExtParameters: Array of TThoriumHostObjectType;
                  ExtReturnType: TThoriumHostObjectType)
\end{verbatim}
\Visibility
public
\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumHashableObject
\section{TThoriumHashableObject}
\label{thoriumcorepkg:thorium:tthoriumhashableobject}
\index{TThoriumHashableObject}
% Description
\subsection{Description}
This class is used in Thorium as a base class to implement hashing which is used to compare different runtimes while loading modules.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumhashableobject:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumhashableobject:calchash} & CalcHash  & Calculate the hash. \\
\pageref{thoriumcorepkg:thorium:tthoriumhashableobject:create} & Create  & Initialize the class. \\
\pageref{thoriumcorepkg:thorium:tthoriumhashableobject:gethash} & GetHash  & Returns the hash of the object. \\
\pageref{thoriumcorepkg:thorium:tthoriumhashableobject:invalidatehash} & InvalidateHash  & Invalidate any generated hash. \\
\hline
\end{tabularx}
% TThoriumHashableObject.Create
\subsection{TThoriumHashableObject.Create}
\label{thoriumcorepkg:thorium:tthoriumhashableobject:create}
\index{TThoriumHashableObject.Create}
\begin{FPCList}
\Synopsis
Initialize the class.\Declaration 

\begin{verbatim}
constructor Create
\end{verbatim}
\Visibility
public
\Description
Creates the instance and prepares hashing.\end{FPCList}
% TThoriumHashableObject.CalcHash
\subsection{TThoriumHashableObject.CalcHash}
\label{thoriumcorepkg:thorium:tthoriumhashableobject:calchash}
\index{TThoriumHashableObject.CalcHash}
\begin{FPCList}
\Synopsis
Calculate the hash.\Declaration 

\begin{verbatim}
procedure CalcHash;  Virtual;  Abstract
\end{verbatim}
\Visibility
protected
\Description
This method must be overriden by descendant classes. It should generate a 16 byte hash which is "unique" to the contents of the class and save it to FHash.\SeeAlso
TThoriumHashableObject.GetHash (\pageref{thoriumcorepkg:thorium:tthoriumhashableobject:gethash}),
TThoriumHashableObject.InvalidateHash (\pageref{thoriumcorepkg:thorium:tthoriumhashableobject:invalidatehash})\end{FPCList}
% TThoriumHashableObject.InvalidateHash
\subsection{TThoriumHashableObject.InvalidateHash}
\label{thoriumcorepkg:thorium:tthoriumhashableobject:invalidatehash}
\index{TThoriumHashableObject.InvalidateHash}
\begin{FPCList}
\Synopsis
Invalidate any generated hash.\Declaration 

\begin{verbatim}
procedure InvalidateHash
\end{verbatim}
\Visibility
protected
\Description
If an hash has been generated, it is invaildated. This wants to say, if an hash is requested after invalidation, it will be regenerated and stored after that.\SeeAlso
TThoriumHashableObject.GetHash (\pageref{thoriumcorepkg:thorium:tthoriumhashableobject:gethash}),
TThoriumHashableObject.CalcHash (\pageref{thoriumcorepkg:thorium:tthoriumhashableobject:calchash})\end{FPCList}
% TThoriumHashableObject.GetHash
\subsection{TThoriumHashableObject.GetHash}
\label{thoriumcorepkg:thorium:tthoriumhashableobject:gethash}
\index{TThoriumHashableObject.GetHash}
\begin{FPCList}
\Synopsis
Returns the hash of the object.\Declaration 

\begin{verbatim}
function GetHash : TThoriumHash
\end{verbatim}
\Visibility
public
\Description
This function returns the hash of the object. If an hash has been generated before, it will be reused.\SeeAlso
TThoriumHashableObject.CalcHash (\pageref{thoriumcorepkg:thorium:tthoriumhashableobject:calchash}),
TThoriumHashableObject.InvalidateHash (\pageref{thoriumcorepkg:thorium:tthoriumhashableobject:invalidatehash})\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumHostCallableBase
\section{TThoriumHostCallableBase}
\label{thoriumcorepkg:thorium:tthoriumhostcallablebase}
\index{TThoriumHostCallableBase}
% Description
\subsection{Description}
This class is an abstract class whose descendants are used to represent a callable entity placed in the host environment (i.e. functions and methods). This class implements the hashing functionallity and declares some shared properties.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumhostcallablebase:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumhostcallablebase:calchash} & CalcHash  & Calculate callable hash. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostcallablebase:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumhostcallablebase:destroy} & Destroy  &  \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthoriumhostcallablebase:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumhostcallablebase:name} & Name & rw & Identifier of the callable. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostcallablebase:parameters} & Parameters & r & Parameter specification. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostcallablebase:returntype} & ReturnType & rw & Return type of the callable. \\
\hline
\end{tabularx}
% TThoriumHostCallableBase.Create
\subsection{TThoriumHostCallableBase.Create}
\label{thoriumcorepkg:thorium:tthoriumhostcallablebase:create}
\index{TThoriumHostCallableBase.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create;  Virtual
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumHostCallableBase.Destroy
\subsection{TThoriumHostCallableBase.Destroy}
\label{thoriumcorepkg:thorium:tthoriumhostcallablebase:destroy}
\index{TThoriumHostCallableBase.Destroy}
\begin{FPCList}
\Declaration 

\begin{verbatim}
destructor Destroy;  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumHostCallableBase.CalcHash
\subsection{TThoriumHostCallableBase.CalcHash}
\label{thoriumcorepkg:thorium:tthoriumhostcallablebase:calchash}
\index{TThoriumHostCallableBase.CalcHash}
\begin{FPCList}
\Synopsis
Calculate callable hash.\Declaration 

\begin{verbatim}
procedure CalcHash;  Override
\end{verbatim}
\Visibility
protected
\Description
Calculates the hash of this callable instance. It includes the function signature like parameters, name and return value type.\SeeAlso
TThoriumHashableObject (\pageref{thoriumcorepkg:thorium:tthoriumhashableobject})\end{FPCList}
% TThoriumHostCallableBase.Parameters
\subsection{TThoriumHostCallableBase.Parameters}
\label{thoriumcorepkg:thorium:tthoriumhostcallablebase:parameters}
\index{TThoriumHostCallableBase.Parameters}
\begin{FPCList}
\Synopsis
Parameter specification.\Declaration 

\begin{verbatim}
Property Parameters : TThoriumHostFunctionParameterSpec
\end{verbatim}
\Visibility
public
\Access
Read
\Description
Pointing to a TThoriumHostFunctionParameterSpec (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec}) instance representing the parameters of the callable.\end{FPCList}
% TThoriumHostCallableBase.ReturnType
\subsection{TThoriumHostCallableBase.ReturnType}
\label{thoriumcorepkg:thorium:tthoriumhostcallablebase:returntype}
\index{TThoriumHostCallableBase.ReturnType}
\begin{FPCList}
\Synopsis
Return type of the callable.\Declaration 

\begin{verbatim}
Property ReturnType : TThoriumExternalFunctionVarType
\end{verbatim}
\Visibility
public
\Access
Read,Write
\Description
Specifies the return type of the callable.\end{FPCList}
% TThoriumHostCallableBase.Name
\subsection{TThoriumHostCallableBase.Name}
\label{thoriumcorepkg:thorium:tthoriumhostcallablebase:name}
\index{TThoriumHostCallableBase.Name}
\begin{FPCList}
\Synopsis
Identifier of the callable.\Declaration 

\begin{verbatim}
Property Name : String
\end{verbatim}
\Visibility
public
\Access
Read,Write
\Description
Name identifier of the callable.\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumHostFunctionBase
\section{TThoriumHostFunctionBase}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionbase}
\index{TThoriumHostFunctionBase}
% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionbase:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionbase:callfromvirtualmachine} & CallFromVirtualMachine  &  \\
\hline
\end{tabularx}
% TThoriumHostFunctionBase.CallFromVirtualMachine
\subsection{TThoriumHostFunctionBase.CallFromVirtualMachine}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionbase:callfromvirtualmachine}
\index{TThoriumHostFunctionBase.CallFromVirtualMachine}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure CallFromVirtualMachine
                                (AVirtualMachine: TThoriumVirtualMachine)
                                ;  Virtual;  Abstract
\end{verbatim}
\Visibility
protected
\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumHostFunctionNativeCall
\section{TThoriumHostFunctionNativeCall}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionnativecall}
\index{TThoriumHostFunctionNativeCall}
% Description
\subsection{Description}
Implements a host call as native call, meaning that you do not need a wrapper to get the parameters in the format you want. They will be converted and passed in computer native formats to your function, without having you to change anything.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionnativecall:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionnativecall:callfromvirtualmachine} & CallFromVirtualMachine  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionnativecall:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionnativecall:destroy} & Destroy  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionnativecall:precompile} & Precompile  & Precompile the native call subscript. \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionnativecall:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionnativecall:callingconvention} & CallingConvention & rw & Calling convention to be used. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionnativecall:codepointer} & CodePointer & rw & Pointer to the function. \\
\hline
\end{tabularx}
% TThoriumHostFunctionNativeCall.Create
\subsection{TThoriumHostFunctionNativeCall.Create}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionnativecall:create}
\index{TThoriumHostFunctionNativeCall.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create;  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumHostFunctionNativeCall.Destroy
\subsection{TThoriumHostFunctionNativeCall.Destroy}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionnativecall:destroy}
\index{TThoriumHostFunctionNativeCall.Destroy}
\begin{FPCList}
\Declaration 

\begin{verbatim}
destructor Destroy;  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumHostFunctionNativeCall.CallFromVirtualMachine
\subsection{TThoriumHostFunctionNativeCall.CallFromVirtualMachine}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionnativecall:callfromvirtualmachine}
\index{TThoriumHostFunctionNativeCall.CallFromVirtualMachine}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure CallFromVirtualMachine
                                (AVirtualMachine: TThoriumVirtualMachine)
                                ;  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumHostFunctionNativeCall.Precompile
\subsection{TThoriumHostFunctionNativeCall.Precompile}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionnativecall:precompile}
\index{TThoriumHostFunctionNativeCall.Precompile}
\begin{FPCList}
\Synopsis
Precompile the native call subscript.\Declaration 

\begin{verbatim}
procedure Precompile;  Virtual
\end{verbatim}
\Visibility
public
\Description
This method performs precompilation of the NativeCall subscript which is needed to perform the call. You must call this before the first attempt of a native call but after you have configured the parameters.\end{FPCList}
% TThoriumHostFunctionNativeCall.CallingConvention
\subsection{TThoriumHostFunctionNativeCall.CallingConvention}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionnativecall:callingconvention}
\index{TThoriumHostFunctionNativeCall.CallingConvention}
\begin{FPCList}
\Synopsis
Calling convention to be used.\Declaration 

\begin{verbatim}
Property CallingConvention : TThoriumNativeCallingConvention
\end{verbatim}
\Visibility
public
\Access
Read,Write
\Description
This must describe the calling convention the function has you want to be called. The default calling convention of FreePascal is \textit{register}, so you probably want to use ncRegister.\SeeAlso
TThoriumHostFunctionSimpleMethod (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionsimplemethod}),
TThoriumHostFunctionNativeCall (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionnativecall})\end{FPCList}
% TThoriumHostFunctionNativeCall.CodePointer
\subsection{TThoriumHostFunctionNativeCall.CodePointer}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionnativecall:codepointer}
\index{TThoriumHostFunctionNativeCall.CodePointer}
\begin{FPCList}
\Synopsis
Pointer to the function.\Declaration 

\begin{verbatim}
Property CodePointer : Pointer
\end{verbatim}
\Visibility
public
\Access
Read,Write
\Description
This must point to the function you want to call.\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumHostFunctionParameterSpec
\section{TThoriumHostFunctionParameterSpec}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec}
\index{TThoriumHostFunctionParameterSpec}
% Description
\subsection{Description}
This class is able to store and represent the parameter list of a function of the host environment. Types are represented by either a TThoriumHostType (\pageref{thoriumcorepkg:thorium}) or an TThoriumHostObjectType (\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype}), if it is an object/class type.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:addextendedtype} & AddExtendedType  & Adds an host object type to the list. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:addtype} & AddType  & Adds a new basic entry. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:alltypes} & AllTypes  & Access to all elements through a pointer. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:clear} & Clear  & Clears the whole list. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:deletetype} & DeleteType  & Delete a type from the list. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:destroy} & Destroy  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:expand} & Expand  & Enlarge the buffer. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:getcompletetype} & GetCompleteType  & Get a complete type representation. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:getextendedtype} & GetExtendedType  & Get host object type \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:getparamtype} & GetParamType  & Get host type \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:indexoftype} & IndexOfType  & Find an occurence of the given type. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:insertextendedtype} & InsertExtendedType  & Insert an host object type. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:inserttype} & InsertType  & Insert a type. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:setcapacity} & SetCapacity  & Set the capacity of the list. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:setextendedtype} & SetExtendedType  & Set the host object type of an entry. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:setparamtype} & SetParamType  & Set the host type of an entry \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:capacity} & Capacity & rw & Access the capacity of the list. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:completetypes} & CompleteTypes & r & Access to complete specifications. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:count} & Count & r & Access the amount of items. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:extendedtypes} & ExtendedTypes & rw & Access to host object type. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:types} & Types & rw & Access to the host types. \\
\hline
\end{tabularx}
% TThoriumHostFunctionParameterSpec.Create
\subsection{TThoriumHostFunctionParameterSpec.Create}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:create}
\index{TThoriumHostFunctionParameterSpec.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumHostFunctionParameterSpec.Destroy
\subsection{TThoriumHostFunctionParameterSpec.Destroy}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:destroy}
\index{TThoriumHostFunctionParameterSpec.Destroy}
\begin{FPCList}
\Declaration 

\begin{verbatim}
destructor Destroy;  Override
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumHostFunctionParameterSpec.Expand
\subsection{TThoriumHostFunctionParameterSpec.Expand}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:expand}
\index{TThoriumHostFunctionParameterSpec.Expand}
\begin{FPCList}
\Synopsis
Enlarge the buffer.\Declaration 

\begin{verbatim}
procedure Expand
\end{verbatim}
\Visibility
protected
\Description
The list is optimized for best performance. So each time the list grows, multiple elements are allocated. This function automatically grows the list, depending on the already present count of elements.\SeeAlso
TThoriumHostFunctionParameterSpec.SetCapacity (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:setcapacity})\end{FPCList}
% TThoriumHostFunctionParameterSpec.GetCompleteType
\subsection{TThoriumHostFunctionParameterSpec.GetCompleteType}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:getcompletetype}
\index{TThoriumHostFunctionParameterSpec.GetCompleteType}
\begin{FPCList}
\Synopsis
Get a complete type representation.\Declaration 

\begin{verbatim}
function GetCompleteType(AIndex: Integer)
                         : PThoriumExternalFunctionVarType
\end{verbatim}
\Visibility
protected
\Description
Returns a pointer to the complete type representation containing both host type (\pageref{thoriumcorepkg:thorium}) and object type (\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype}) at the location in the list specified by AIndex. This can also used to modify the specification.\SeeAlso
TThoriumHostFunctionParameterSpec.GetExtendedType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:getextendedtype}),
TThoriumHostFunctionParameterSpec.GetParamType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:getparamtype}),
TThoriumHostFunctionParameterSpec.CompleteTypes (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:completetypes})\end{FPCList}
% TThoriumHostFunctionParameterSpec.GetExtendedType
\subsection{TThoriumHostFunctionParameterSpec.GetExtendedType}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:getextendedtype}
\index{TThoriumHostFunctionParameterSpec.GetExtendedType}
\begin{FPCList}
\Synopsis
Get host object type\Declaration 

\begin{verbatim}
function GetExtendedType(AIndex: Integer) : TThoriumHostObjectType
\end{verbatim}
\Visibility
protected
\Description
Returns the host object type (\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype}) of the parameter at AIndex or nil, if it is not an extended type parameter.\SeeAlso
TThoriumHostFunctionParameterSpec.GetCompleteType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:getcompletetype}),
TThoriumHostFunctionParameterSpec.SetExtendedType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:setextendedtype}),
TThoriumHostFunctionParameterSpec.GetParamType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:getparamtype}),
TThoriumHostFunctionParameterSpec.ExtendedTypes (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:extendedtypes})\end{FPCList}
% TThoriumHostFunctionParameterSpec.GetParamType
\subsection{TThoriumHostFunctionParameterSpec.GetParamType}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:getparamtype}
\index{TThoriumHostFunctionParameterSpec.GetParamType}
\begin{FPCList}
\Synopsis
Get host type\Declaration 

\begin{verbatim}
function GetParamType(AIndex: Integer) : TThoriumHostType
\end{verbatim}
\Visibility
protected
\Description
Returns the host type (\pageref{thoriumcorepkg:thorium}) of the parameter at AIndex. \SeeAlso
TThoriumHostFunctionParameterSpec.GetCompleteType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:getcompletetype}),
TThoriumHostFunctionParameterSpec.GetExtendedType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:getextendedtype}),
TThoriumHostFunctionParameterSpec.Types (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:types}),
TThoriumHostFunctionParameterSpec.SetParamType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:setparamtype})\end{FPCList}
% TThoriumHostFunctionParameterSpec.SetCapacity
\subsection{TThoriumHostFunctionParameterSpec.SetCapacity}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:setcapacity}
\index{TThoriumHostFunctionParameterSpec.SetCapacity}
\begin{FPCList}
\Synopsis
Set the capacity of the list.\Declaration 

\begin{verbatim}
procedure SetCapacity(AValue: Integer)
\end{verbatim}
\Visibility
protected
\Description
Sets the capacity to the list to the given value. This does not work if the value is smaller than the amount of elements already in the list. Used to preallocate entries if you add many to the list.\SeeAlso
TThoriumHostFunctionParameterSpec.Expand (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:expand})\end{FPCList}
% TThoriumHostFunctionParameterSpec.SetExtendedType
\subsection{TThoriumHostFunctionParameterSpec.SetExtendedType}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:setextendedtype}
\index{TThoriumHostFunctionParameterSpec.SetExtendedType}
\begin{FPCList}
\Synopsis
Set the host object type of an entry.\Declaration 

\begin{verbatim}
procedure SetExtendedType(AIndex: Integer;
                         AValue: TThoriumHostObjectType)
\end{verbatim}
\Visibility
protected
\Description
Sets the host object type (\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype}) of the parameter at index AIndex.\SeeAlso
TThoriumHostFunctionParameterSpec.SetParamType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:setparamtype}),
TThoriumHostFunctionParameterSpec.ExtendedTypes (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:extendedtypes})\end{FPCList}
% TThoriumHostFunctionParameterSpec.SetParamType
\subsection{TThoriumHostFunctionParameterSpec.SetParamType}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:setparamtype}
\index{TThoriumHostFunctionParameterSpec.SetParamType}
\begin{FPCList}
\Synopsis
Set the host type of an entry\Declaration 

\begin{verbatim}
procedure SetParamType(AIndex: Integer;AValue: TThoriumHostType)
\end{verbatim}
\Visibility
protected
\Description
Sets the host type (\pageref{thoriumcorepkg:thorium}) of the parameter at index AIndex. Make sure you set an host object type (\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype}) too if you set it as an extended type.\end{FPCList}
% TThoriumHostFunctionParameterSpec.AddType
\subsection{TThoriumHostFunctionParameterSpec.AddType}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:addtype}
\index{TThoriumHostFunctionParameterSpec.AddType}
\begin{FPCList}
\Synopsis
Adds a new basic entry.\Declaration 

\begin{verbatim}
function AddType(AType: TThoriumHostType) : Integer
\end{verbatim}
\Visibility
public
\Description
Adds a new parameter to the list as a non-extended type specified by \textit{AType} and returns the index where the new entry is placed.\SeeAlso
TThoriumHostFunctionParameterSpec.AddExtendedType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:addextendedtype}),
TThoriumHostFunctionParameterSpec.InsetType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec})\end{FPCList}
% TThoriumHostFunctionParameterSpec.AddExtendedType
\subsection{TThoriumHostFunctionParameterSpec.AddExtendedType}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:addextendedtype}
\index{TThoriumHostFunctionParameterSpec.AddExtendedType}
\begin{FPCList}
\Synopsis
Adds an host object type to the list.\Declaration 

\begin{verbatim}
function AddExtendedType(AType: TThoriumHostObjectType) : Integer
\end{verbatim}
\Visibility
public
\Description
Adds a new entry which contains an extended type (i.e. host object type) specified by \textit{AType} and returns the index at which the entry is placed.\SeeAlso
TThoriumHostFunctionParameterSpec.AddType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:addtype}),
TThoriumHostFunctionParameterSpec.InsertExtendedType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:insertextendedtype})\end{FPCList}
% TThoriumHostFunctionParameterSpec.AllTypes
\subsection{TThoriumHostFunctionParameterSpec.AllTypes}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:alltypes}
\index{TThoriumHostFunctionParameterSpec.AllTypes}
\begin{FPCList}
\Synopsis
Access to all elements through a pointer.\Declaration 

\begin{verbatim}
function AllTypes : PThoriumExternalFunctionVarType
\end{verbatim}
\Visibility
public
\Description
Returns a pointer to the first element in the list. This allows faster access of any element in the list.\end{FPCList}
% TThoriumHostFunctionParameterSpec.IndexOfType
\subsection{TThoriumHostFunctionParameterSpec.IndexOfType}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:indexoftype}
\index{TThoriumHostFunctionParameterSpec.IndexOfType}
\begin{FPCList}
\Synopsis
Find an occurence of the given type.\Declaration 

\begin{verbatim}
function IndexOfType(AType: TThoriumHostType;Nth: Integer) : Integer
\end{verbatim}
\Visibility
public
\Description
Looks for the given type in the list and returns the index of the Nth occurence.\end{FPCList}
% TThoriumHostFunctionParameterSpec.InsertType
\subsection{TThoriumHostFunctionParameterSpec.InsertType}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:inserttype}
\index{TThoriumHostFunctionParameterSpec.InsertType}
\begin{FPCList}
\Synopsis
Insert a type.\Declaration 

\begin{verbatim}
procedure InsertType(AType: TThoriumHostType;AIndex: Integer)
\end{verbatim}
\Visibility
public
\Description
Inserts the given type in the list so that it has the given index afterwards.\SeeAlso
TThoriumHostFunctionParameterSpec.InsertExtendedType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:insertextendedtype}),
TThoriumHostFunctionParameterSpec.AddType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:addtype})\end{FPCList}
% TThoriumHostFunctionParameterSpec.InsertExtendedType
\subsection{TThoriumHostFunctionParameterSpec.InsertExtendedType}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:insertextendedtype}
\index{TThoriumHostFunctionParameterSpec.InsertExtendedType}
\begin{FPCList}
\Synopsis
Insert an host object type.\Declaration 

\begin{verbatim}
procedure InsertExtendedType(AType: TThoriumHostObjectType;
                            AIndex: Integer)
\end{verbatim}
\Visibility
public
\Description
Inserts the given host objec type into the list so that it has the specified index afterwards.\SeeAlso
TThoriumHostFunctionParameterSpec.InsertType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:inserttype}),
TThoriumHostFunctionParameterSpec.AddExtendedType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:addextendedtype})\end{FPCList}
% TThoriumHostFunctionParameterSpec.DeleteType
\subsection{TThoriumHostFunctionParameterSpec.DeleteType}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:deletetype}
\index{TThoriumHostFunctionParameterSpec.DeleteType}
\begin{FPCList}
\Synopsis
Delete a type from the list.\Declaration 

\begin{verbatim}
procedure DeleteType(AIndex: Integer)
\end{verbatim}
\Visibility
public
\Description
Deletes the type at the specified location from the list.\SeeAlso
TThoriumHostFunctionParameterSpec.Clear (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:clear})\end{FPCList}
% TThoriumHostFunctionParameterSpec.Clear
\subsection{TThoriumHostFunctionParameterSpec.Clear}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:clear}
\index{TThoriumHostFunctionParameterSpec.Clear}
\begin{FPCList}
\Synopsis
Clears the whole list.\Declaration 

\begin{verbatim}
procedure Clear
\end{verbatim}
\Visibility
public
\Description
Deletes all entries from the list.\SeeAlso
TThoriumHostFunctionParameterSpec.DeleteType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:deletetype})\end{FPCList}
% TThoriumHostFunctionParameterSpec.Types
\subsection{TThoriumHostFunctionParameterSpec.Types}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:types}
\index{TThoriumHostFunctionParameterSpec.Types}
\begin{FPCList}
\Synopsis
Access to the host types.\Declaration 

\begin{verbatim}
Property Types[Index: Integer]: TThoriumHostType
\end{verbatim}
\Visibility
public
\Access
Read,Write
\Description
Provides access to the host type (\pageref{thoriumcorepkg:thorium}) part of a parameter.\SeeAlso
TThoriumHostFunctionParameterSpec.GetParamType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:getparamtype}),
TThoriumHostFunctionParameterSpec.SetParamType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:setparamtype}),
TThoriumHostFunctionParameterSpec.ExtendedTypes (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:extendedtypes}),
TThoriumHostFunctionParameterSpec.CompleteTypes (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:completetypes})\end{FPCList}
% TThoriumHostFunctionParameterSpec.ExtendedTypes
\subsection{TThoriumHostFunctionParameterSpec.ExtendedTypes}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:extendedtypes}
\index{TThoriumHostFunctionParameterSpec.ExtendedTypes}
\begin{FPCList}
\Synopsis
Access to host object type.\Declaration 

\begin{verbatim}
Property ExtendedTypes[Index: Integer]: TThoriumHostObjectType
\end{verbatim}
\Visibility
public
\Access
Read,Write
\Description
Provides access to the host object type (\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype}) part of a parameter.\SeeAlso
TThoriumHostFunctionParameterSpec.GetExtendedType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:getextendedtype}),
TThoriumHostFunctionParameterSpec.SetExtendedType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:setextendedtype}),
TThoriumHostFunctionParameterSpec.Types (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:types}),
TThoriumHostFunctionParameterSpec.CompleteTypes (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:completetypes})\end{FPCList}
% TThoriumHostFunctionParameterSpec.CompleteTypes
\subsection{TThoriumHostFunctionParameterSpec.CompleteTypes}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:completetypes}
\index{TThoriumHostFunctionParameterSpec.CompleteTypes}
\begin{FPCList}
\Synopsis
Access to complete specifications.\Declaration 

\begin{verbatim}
Property CompleteTypes[Index: Integer]: PThoriumExternalFunctionVarType
\end{verbatim}
\Visibility
public
\Access
Read
\Description
Provides access to the complete specification of a parameter.\SeeAlso
TThoriumHostFunctionParameterSpec.GetCompleteType (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:getcompletetype}),
TThoriumHostFunctionParameterSpec.Types (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:types}),
TThoriumHostFunctionParameterSpec.ExtendedTypes (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:extendedtypes})\end{FPCList}
% TThoriumHostFunctionParameterSpec.Capacity
\subsection{TThoriumHostFunctionParameterSpec.Capacity}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:capacity}
\index{TThoriumHostFunctionParameterSpec.Capacity}
\begin{FPCList}
\Synopsis
Access the capacity of the list.\Declaration 

\begin{verbatim}
Property Capacity : Integer
\end{verbatim}
\Visibility
public
\Access
Read,Write
\Description
Provides read-write access to the capacity of the list. The constraints of the SetCapacity (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:setcapacity}) method apply here too.\SeeAlso
TThoriumHostFunctionParameterSpec.SetCapacity (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:setcapacity})\end{FPCList}
% TThoriumHostFunctionParameterSpec.Count
\subsection{TThoriumHostFunctionParameterSpec.Count}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionparameterspec:count}
\index{TThoriumHostFunctionParameterSpec.Count}
\begin{FPCList}
\Synopsis
Access the amount of items.\Declaration 

\begin{verbatim}
Property Count : Integer
\end{verbatim}
\Visibility
public
\Access
Read
\Description
Provides read access to the amount of items placed in the list.\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumHostFunctionSimpleMethod
\section{TThoriumHostFunctionSimpleMethod}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionsimplemethod}
\index{TThoriumHostFunctionSimpleMethod}
% Description
\subsection{Description}
This class implements a simple call to a function of the host environment. Parameters are passed to a specific signatured function, as well as a pointer where to put the return value, all in TThoriumValue (\pageref{thoriumcorepkg:thorium:tthoriumvalue}) format. For more info see TThoriumSimpleMethod (\pageref{thoriumcorepkg:thorium:tthoriumsimplemethod}).% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionsimplemethod:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionsimplemethod:callfromvirtualmachine} & CallFromVirtualMachine  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionsimplemethod:create} & Create  &  \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionsimplemethod:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionsimplemethod:method} & Method & rw & Method pointer to be called. \\
\hline
\end{tabularx}
% TThoriumHostFunctionSimpleMethod.Create
\subsection{TThoriumHostFunctionSimpleMethod.Create}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionsimplemethod:create}
\index{TThoriumHostFunctionSimpleMethod.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create;  Override
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumHostFunctionSimpleMethod.CallFromVirtualMachine
\subsection{TThoriumHostFunctionSimpleMethod.CallFromVirtualMachine}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionsimplemethod:callfromvirtualmachine}
\index{TThoriumHostFunctionSimpleMethod.CallFromVirtualMachine}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure CallFromVirtualMachine
                                (AVirtualMachine: TThoriumVirtualMachine)
                                ;  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumHostFunctionSimpleMethod.Method
\subsection{TThoriumHostFunctionSimpleMethod.Method}
\label{thoriumcorepkg:thorium:tthoriumhostfunctionsimplemethod:method}
\index{TThoriumHostFunctionSimpleMethod.Method}
\begin{FPCList}
\Synopsis
Method pointer to be called.\Declaration 

\begin{verbatim}
Property Method : TThoriumSimpleMethod
\end{verbatim}
\Visibility
public
\Access
Read,Write
\Description
The pointer to the method which will be called.\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumHostMethodAsFunctionNativeCall
\section{TThoriumHostMethodAsFunctionNativeCall}
\label{thoriumcorepkg:thorium:tthoriumhostmethodasfunctionnativecall}
\index{TThoriumHostMethodAsFunctionNativeCall}
% Description
\subsection{Description}
Works like TThoriumHostFunctionNativeCall (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionnativecall}), except that a constant is passed as the first parameter, which is assumed to be a Pointer and which must not be specified in the parameter array. If the function is a method, the constant parameter will come out as Self in the method and does not need to be declared in the function signature.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumhostmethodasfunctionnativecall:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumhostmethodasfunctionnativecall:callfromvirtualmachine} & CallFromVirtualMachine  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumhostmethodasfunctionnativecall:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumhostmethodasfunctionnativecall:precompile} & Precompile  &  \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthoriumhostmethodasfunctionnativecall:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumhostmethodasfunctionnativecall:datapointer} & DataPointer & rw &  \\
\hline
\end{tabularx}
% TThoriumHostMethodAsFunctionNativeCall.Create
\subsection{TThoriumHostMethodAsFunctionNativeCall.Create}
\label{thoriumcorepkg:thorium:tthoriumhostmethodasfunctionnativecall:create}
\index{TThoriumHostMethodAsFunctionNativeCall.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create;  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumHostMethodAsFunctionNativeCall.CallFromVirtualMachine
\subsection{TThoriumHostMethodAsFunctionNativeCall.CallFromVirtualMachine}
\label{thoriumcorepkg:thorium:tthoriumhostmethodasfunctionnativecall:callfromvirtualmachine}
\index{TThoriumHostMethodAsFunctionNativeCall.CallFromVirtualMachine}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure CallFromVirtualMachine
                                (AVirtualMachine: TThoriumVirtualMachine)
                                ;  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumHostMethodAsFunctionNativeCall.Precompile
\subsection{TThoriumHostMethodAsFunctionNativeCall.Precompile}
\label{thoriumcorepkg:thorium:tthoriumhostmethodasfunctionnativecall:precompile}
\index{TThoriumHostMethodAsFunctionNativeCall.Precompile}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure Precompile;  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumHostMethodAsFunctionNativeCall.DataPointer
\subsection{TThoriumHostMethodAsFunctionNativeCall.DataPointer}
\label{thoriumcorepkg:thorium:tthoriumhostmethodasfunctionnativecall:datapointer}
\index{TThoriumHostMethodAsFunctionNativeCall.DataPointer}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property DataPointer : Pointer
\end{verbatim}
\Visibility
public
\Access
Read,Write
\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumHostMethodBase
\section{TThoriumHostMethodBase}
\label{thoriumcorepkg:thorium:tthoriumhostmethodbase}
\index{TThoriumHostMethodBase}
% Description
\subsection{Description}
Abstract base class to call methods of the host environment.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumhostmethodbase:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumhostmethodbase:callfromvirtualmachine} & CallFromVirtualMachine  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumhostmethodbase:create} & Create  &  \\
\hline
\end{tabularx}
% TThoriumHostMethodBase.Create
\subsection{TThoriumHostMethodBase.Create}
\label{thoriumcorepkg:thorium:tthoriumhostmethodbase:create}
\index{TThoriumHostMethodBase.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create;  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumHostMethodBase.CallFromVirtualMachine
\subsection{TThoriumHostMethodBase.CallFromVirtualMachine}
\label{thoriumcorepkg:thorium:tthoriumhostmethodbase:callfromvirtualmachine}
\index{TThoriumHostMethodBase.CallFromVirtualMachine}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure CallFromVirtualMachine(OfObject: TObject;
                                AVirtualMachine: TThoriumVirtualMachine)
                                ;  Virtual;  Abstract
\end{verbatim}
\Visibility
protected
\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumHostMethodNativeCall
\section{TThoriumHostMethodNativeCall}
\label{thoriumcorepkg:thorium:tthoriumhostmethodnativecall}
\index{TThoriumHostMethodNativeCall}
% Description
\subsection{Description}
Similar to TThoriumHostFunctionNativeCall (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionnativecall}), except that the Self pointer is adjusted according to the calling context like in TThoriumHostMethodSimple (\pageref{thoriumcorepkg:thorium:tthoriumhostmethodsimple}).% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumhostmethodnativecall:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumhostmethodnativecall:callfromvirtualmachine} & CallFromVirtualMachine  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumhostmethodnativecall:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumhostmethodnativecall:destroy} & Destroy  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumhostmethodnativecall:precompile} & Precompile  & Precompile NativeCall subscript. \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthoriumhostmethodnativecall:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumhostmethodnativecall:callingconvention} & CallingConvention & rw & Calling convention \\
\pageref{thoriumcorepkg:thorium:tthoriumhostmethodnativecall:codepointer} & CodePointer & rw & Pointer to the method. \\
\hline
\end{tabularx}
% TThoriumHostMethodNativeCall.Create
\subsection{TThoriumHostMethodNativeCall.Create}
\label{thoriumcorepkg:thorium:tthoriumhostmethodnativecall:create}
\index{TThoriumHostMethodNativeCall.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create;  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumHostMethodNativeCall.Destroy
\subsection{TThoriumHostMethodNativeCall.Destroy}
\label{thoriumcorepkg:thorium:tthoriumhostmethodnativecall:destroy}
\index{TThoriumHostMethodNativeCall.Destroy}
\begin{FPCList}
\Declaration 

\begin{verbatim}
destructor Destroy;  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumHostMethodNativeCall.CallFromVirtualMachine
\subsection{TThoriumHostMethodNativeCall.CallFromVirtualMachine}
\label{thoriumcorepkg:thorium:tthoriumhostmethodnativecall:callfromvirtualmachine}
\index{TThoriumHostMethodNativeCall.CallFromVirtualMachine}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure CallFromVirtualMachine(OfObject: TObject;
                                AVirtualMachine: TThoriumVirtualMachine)
                                ;  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumHostMethodNativeCall.Precompile
\subsection{TThoriumHostMethodNativeCall.Precompile}
\label{thoriumcorepkg:thorium:tthoriumhostmethodnativecall:precompile}
\index{TThoriumHostMethodNativeCall.Precompile}
\begin{FPCList}
\Synopsis
Precompile NativeCall subscript.\Declaration 

\begin{verbatim}
procedure Precompile
\end{verbatim}
\Visibility
public
\Description
This method performs precompilation of the NativeCall subscript which is needed to perform the call. You must call this before the first attempt of a native call but after you have configured the parameters.\end{FPCList}
% TThoriumHostMethodNativeCall.CallingConvention
\subsection{TThoriumHostMethodNativeCall.CallingConvention}
\label{thoriumcorepkg:thorium:tthoriumhostmethodnativecall:callingconvention}
\index{TThoriumHostMethodNativeCall.CallingConvention}
\begin{FPCList}
\Synopsis
Calling convention\Declaration 

\begin{verbatim}
Property CallingConvention : TThoriumNativeCallingConvention
\end{verbatim}
\Visibility
public
\Access
Read,Write
\Description
Describes the calling convention of the method. See TThoriumHostFunctionNativeCall.CallingConvention (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionnativecall:callingconvention}) for more information.\end{FPCList}
% TThoriumHostMethodNativeCall.CodePointer
\subsection{TThoriumHostMethodNativeCall.CodePointer}
\label{thoriumcorepkg:thorium:tthoriumhostmethodnativecall:codepointer}
\index{TThoriumHostMethodNativeCall.CodePointer}
\begin{FPCList}
\Synopsis
Pointer to the method.\Declaration 

\begin{verbatim}
Property CodePointer : Pointer
\end{verbatim}
\Visibility
public
\Access
Read,Write
\Description
This must be the pointer to the method to be called.\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumHostMethodSimple
\section{TThoriumHostMethodSimple}
\label{thoriumcorepkg:thorium:tthoriumhostmethodsimple}
\index{TThoriumHostMethodSimple}
% Description
\subsection{Description}
Similar to TThoriumHostFunctionSimpleMethod (\pageref{thoriumcorepkg:thorium:tthoriumhostfunctionsimplemethod}), except that the Self pointer of the function is modified to whatever matches the context (i.e. which host object type variable the method belongs to - gets dereferred up to the pointer so that you can use it like a normal method).% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumhostmethodsimple:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumhostmethodsimple:callfromvirtualmachine} & CallFromVirtualMachine  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumhostmethodsimple:create} & Create  &  \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthoriumhostmethodsimple:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumhostmethodsimple:classmethod} & ClassMethod & rw &  \\
\hline
\end{tabularx}
% TThoriumHostMethodSimple.Create
\subsection{TThoriumHostMethodSimple.Create}
\label{thoriumcorepkg:thorium:tthoriumhostmethodsimple:create}
\index{TThoriumHostMethodSimple.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create;  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumHostMethodSimple.CallFromVirtualMachine
\subsection{TThoriumHostMethodSimple.CallFromVirtualMachine}
\label{thoriumcorepkg:thorium:tthoriumhostmethodsimple:callfromvirtualmachine}
\index{TThoriumHostMethodSimple.CallFromVirtualMachine}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure CallFromVirtualMachine(OfObject: TObject;
                                AVirtualMachine: TThoriumVirtualMachine)
                                ;  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumHostMethodSimple.ClassMethod
\subsection{TThoriumHostMethodSimple.ClassMethod}
\label{thoriumcorepkg:thorium:tthoriumhostmethodsimple:classmethod}
\index{TThoriumHostMethodSimple.ClassMethod}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property ClassMethod : TThoriumClassMethod
\end{verbatim}
\Visibility
public
\Access
Read,Write
\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumHostObjectType
\section{TThoriumHostObjectType}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype}
\index{TThoriumHostObjectType}
% Description
\subsection{Description}
This class is the base class to publish any class-alike type to Thorium. You will need to override the virtual methods to make it represent the type you want.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:assignvalue} & AssignValue  & Perform assignment - deprecated? \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:destroy} & Destroy  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:disposevalue} & DisposeValue  & Release an instance \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:duplicatevalue} & DuplicateValue  & Duplicate the given value \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:fieldid} & FieldID  & Get the ID of a field. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:fieldtype} & FieldType  & Get the type of a field. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:findmethod} & FindMethod  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:getfield} & GetField  & Perform read-access to a field. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:getindex} & GetIndex  & Perform read access using an index. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:getneededmemoryamount} & GetNeededMemoryAmount  & Get the memory amount needed for one instance. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:getpropertystoring} & GetPropertyStoring  & Determine whether a field is storing. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:getstaticfield} & GetStaticField  & Perform read access to a static field. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:hasfields} & HasFields  & Determine whether a type has any fields. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:hasindicies} & HasIndicies  & Determine whether your type can be accessed via indicies. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:hasstaticfields} & HasStaticFields  & Determine whether your type has any static fields. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:indextype} & IndexType  & Get the type of value returned at indexed access. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:istypecompatible} & IsTypeCompatible  & Determine whether a two-operand operation is possible. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:istypeoperationavailable} & IsTypeOperationAvailable  & Determine whether an unary operation is possible. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:performevaluation} & PerformEvaluation  & Evaluate as integer. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:performnegation} & PerformNegation  & Negate the value \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:performnot} & PerformNot  & Invert the value. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:performoperation} & PerformOperation  & Perform the given operation on a value. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:setfield} & SetField  & Perform write access to a field. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:setindex} & SetIndex  & Perform write access using an index. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:setstaticfield} & SetStaticField  & Perform write access to a static field. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:staticfieldid} & StaticFieldID  & Get a static field ID. \\
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:staticfieldtype} & StaticFieldType  & Get the type of a static field. \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:name} & Name & r & Published name \\
\hline
\end{tabularx}
% TThoriumHostObjectType.Create
\subsection{TThoriumHostObjectType.Create}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:create}
\index{TThoriumHostObjectType.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create(ALibrary: TThoriumLibrary);  Virtual
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumHostObjectType.Destroy
\subsection{TThoriumHostObjectType.Destroy}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:destroy}
\index{TThoriumHostObjectType.Destroy}
\begin{FPCList}
\Declaration 

\begin{verbatim}
destructor Destroy;  Override
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumHostObjectType.GetNeededMemoryAmount
\subsection{TThoriumHostObjectType.GetNeededMemoryAmount}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:getneededmemoryamount}
\index{TThoriumHostObjectType.GetNeededMemoryAmount}
\begin{FPCList}
\Synopsis
Get the memory amount needed for one instance.\Declaration 

\begin{verbatim}
function GetNeededMemoryAmount : TThoriumSizeInt;  Virtual;  Abstract
\end{verbatim}
\Visibility
protected
\Description
This function must return the amount of memory needed for one instance of this type. If you do not need to allocate any memory but you want to assign the value yourself, you should return 0. This will leave the pointer field uninitialized so you can assign anything you want.\end{FPCList}
% TThoriumHostObjectType.DuplicateValue
\subsection{TThoriumHostObjectType.DuplicateValue}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:duplicatevalue}
\index{TThoriumHostObjectType.DuplicateValue}
\begin{FPCList}
\Synopsis
Duplicate the given value\Declaration 

\begin{verbatim}
function DuplicateValue(const AValue: TThoriumHostObjectTypeValue)
                        : TThoriumValue;  Virtual;  Abstract
\end{verbatim}
\Visibility
protected
\Description
This function is supposed to duplicate the Value which is passed as a parameter and return it. This means, that this value should be able to be independently freed by Thorium without destroying the other instance. If you use reference counting, it will be enough to copy the value given and increase the reference by one. It is guaranteed that the input value is of the type this class reflects.\end{FPCList}
% TThoriumHostObjectType.AssignValue
\subsection{TThoriumHostObjectType.AssignValue}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:assignvalue}
\index{TThoriumHostObjectType.AssignValue}
\begin{FPCList}
\Synopsis
Perform assignment - deprecated?\Declaration 

\begin{verbatim}
procedure AssignValue(const ASource: TThoriumValue;
                     var ADest: TThoriumValue);  Virtual;  Abstract
\end{verbatim}
\Visibility
protected
\Description
Deprecated?\end{FPCList}
% TThoriumHostObjectType.PerformOperation
\subsection{TThoriumHostObjectType.PerformOperation}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:performoperation}
\index{TThoriumHostObjectType.PerformOperation}
\begin{FPCList}
\Synopsis
Perform the given operation on a value.\Declaration 

\begin{verbatim}
function PerformOperation(const AValue1: TThoriumValue;
                         const AValue2: TThoriumValue;
                         const Op: TThoriumOperator) : TThoriumValue
                         ;  Virtual;  Abstract
\end{verbatim}
\Visibility
protected
\Description
This should perform the given operation on the given values and return the result (if any). There is no need to override this method if your type does not support this.\end{FPCList}
% TThoriumHostObjectType.PerformEvaluation
\subsection{TThoriumHostObjectType.PerformEvaluation}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:performevaluation}
\index{TThoriumHostObjectType.PerformEvaluation}
\begin{FPCList}
\Synopsis
Evaluate as integer.\Declaration 

\begin{verbatim}
function PerformEvaluation(const AValue: TThoriumHostObjectTypeValue)
                           : Integer;  Virtual;  Abstract
\end{verbatim}
\Visibility
protected
\Description
Evaluate the value given as integer (i.e. for boolean evaluations, 0 for false, anything else for true). It is guaranteed that the input value is of the type this class represents.\end{FPCList}
% TThoriumHostObjectType.PerformNegation
\subsection{TThoriumHostObjectType.PerformNegation}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:performnegation}
\index{TThoriumHostObjectType.PerformNegation}
\begin{FPCList}
\Synopsis
Negate the value\Declaration 

\begin{verbatim}
function PerformNegation(const AValue: TThoriumHostObjectTypeValue)
                         : TThoriumValue;  Virtual;  Abstract
\end{verbatim}
\Visibility
protected
\Description
Negate the value given (if possible at all) and return the result. There is no need to override this method if your type does not support this.\end{FPCList}
% TThoriumHostObjectType.PerformNot
\subsection{TThoriumHostObjectType.PerformNot}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:performnot}
\index{TThoriumHostObjectType.PerformNot}
\begin{FPCList}
\Synopsis
Invert the value.\Declaration 

\begin{verbatim}
function PerformNot(const AValue: TThoriumHostObjectTypeValue)
                    : TThoriumValue;  Virtual;  Abstract
\end{verbatim}
\Visibility
protected
\Description
This is called to execute the not-operator. There is no need to override this method if your type does not support this.\end{FPCList}
% TThoriumHostObjectType.DisposeValue
\subsection{TThoriumHostObjectType.DisposeValue}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:disposevalue}
\index{TThoriumHostObjectType.DisposeValue}
\begin{FPCList}
\Synopsis
Release an instance\Declaration 

\begin{verbatim}
procedure DisposeValue(var AValue: TThoriumHostObjectTypeValue)
                      ;  Virtual;  Abstract
\end{verbatim}
\Visibility
protected
\Description
Release the given instance of your type. If you use reference counting, it will be sufficient if you just decrease the reference by one (and free if no references are left).\end{FPCList}
% TThoriumHostObjectType.IsTypeCompatible
\subsection{TThoriumHostObjectType.IsTypeCompatible}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:istypecompatible}
\index{TThoriumHostObjectType.IsTypeCompatible}
\begin{FPCList}
\Synopsis
Determine whether a two-operand operation is possible.\Declaration 

\begin{verbatim}
function IsTypeCompatible(const Value1: TThoriumType;
                         const Value2: TThoriumType;
                         const Operation: TThoriumOperation;
                         out ResultType: TThoriumType) : Boolean
                         ;  Virtual;  Abstract
\end{verbatim}
\Visibility
protected
\Description
This method is supposed to return whether the given operation is possible. In explicit, this determines which operations the compiler will translate into code and where it will throw an error. Make sure you set \textit{ResultType} to notify the compiler about any type changes (e.g., multiplication of float and integer produce a float).\end{FPCList}
% TThoriumHostObjectType.IsTypeOperationAvailable
\subsection{TThoriumHostObjectType.IsTypeOperationAvailable}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:istypeoperationavailable}
\index{TThoriumHostObjectType.IsTypeOperationAvailable}
\begin{FPCList}
\Synopsis
Determine whether an unary operation is possible.\Declaration 

\begin{verbatim}
function IsTypeOperationAvailable(const Value: TThoriumType;
                                 const Operation: TThoriumOperation;
                                 out ResultType: TThoriumType) : Boolean
                                 ;  Virtual;  Abstract
\end{verbatim}
\Visibility
protected
\Description
Return whether the given operation is possible on any value of your type. Make sure to set \textit{ResultType} accordingly to any change in the type.\end{FPCList}
% TThoriumHostObjectType.HasFields
\subsection{TThoriumHostObjectType.HasFields}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:hasfields}
\index{TThoriumHostObjectType.HasFields}
\begin{FPCList}
\Synopsis
Determine whether a type has any fields.\Declaration 

\begin{verbatim}
function HasFields : Boolean;  Virtual;  Abstract
\end{verbatim}
\Visibility
protected
\Description
Tell the compiler whether your type has any fields. Fields are what properties are in FreePascal, i.e. they are accessed without any parameter handling just like public variables. However, fields may be of an method- or function-type (and in that case of course read-only) so that they can be called. In fact, that is the way to publish methods to Thorium.\end{FPCList}
% TThoriumHostObjectType.HasStaticFields
\subsection{TThoriumHostObjectType.HasStaticFields}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:hasstaticfields}
\index{TThoriumHostObjectType.HasStaticFields}
\begin{FPCList}
\Synopsis
Determine whether your type has any static fields.\Declaration 

\begin{verbatim}
function HasStaticFields : Boolean;  Virtual;  Abstract
\end{verbatim}
\Visibility
protected
\Description
Return true if your type has any static fields. Static fields are, other than normal fields, accessed like static methods are in FreePascal, using the type instead of the instance. So if your type is published as "TTestType" to Thorium, a static field will be accessed via "TTestType.staticFieldName", assuming you have a static field called "staticFieldName".\end{FPCList}
% TThoriumHostObjectType.HasIndicies
\subsection{TThoriumHostObjectType.HasIndicies}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:hasindicies}
\index{TThoriumHostObjectType.HasIndicies}
\begin{FPCList}
\Synopsis
Determine whether your type can be accessed via indicies.\Declaration 

\begin{verbatim}
function HasIndicies : Boolean;  Virtual;  Abstract
\end{verbatim}
\Visibility
protected
\Description
If your type supports array-like access (i.e. "Instance[10]" or alike), you must return true.\end{FPCList}
% TThoriumHostObjectType.FindMethod
\subsection{TThoriumHostObjectType.FindMethod}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:findmethod}
\index{TThoriumHostObjectType.FindMethod}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function FindMethod(const AMethodName: String) : TThoriumHostMethodBase
                   ;  Virtual
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumHostObjectType.FieldID
\subsection{TThoriumHostObjectType.FieldID}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:fieldid}
\index{TThoriumHostObjectType.FieldID}
\begin{FPCList}
\Synopsis
Get the ID of a field.\Declaration 

\begin{verbatim}
function FieldID(const FieldIdent: String;out ID: QWord) : Boolean
                ;  Virtual;  Abstract
\end{verbatim}
\Visibility
public
\Description
This method is supposed to return an ID which is unique to the field identified by \textit{FieldIdent}. If that field does not exist, you must return false instead of an invalid ID. There is no need to implement this method if your implementation of HasFields (\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:hasfields}) returns false.\end{FPCList}
% TThoriumHostObjectType.StaticFieldID
\subsection{TThoriumHostObjectType.StaticFieldID}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:staticfieldid}
\index{TThoriumHostObjectType.StaticFieldID}
\begin{FPCList}
\Synopsis
Get a static field ID.\Declaration 

\begin{verbatim}
function StaticFieldID(const FieldIdent: String;out ID: QWord) : Boolean
                      ;  Virtual;  Abstract
\end{verbatim}
\Visibility
public
\Description
Similar to TThoriumHostObjectType.FieldID (\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:fieldid}), but for static fields. There is no need to override this method if your implementation of HasStaticFields (\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:hasstaticfields}) returns false.\end{FPCList}
% TThoriumHostObjectType.IndexType
\subsection{TThoriumHostObjectType.IndexType}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:indextype}
\index{TThoriumHostObjectType.IndexType}
\begin{FPCList}
\Synopsis
Get the type of value returned at indexed access.\Declaration 

\begin{verbatim}
function IndexType(const InputType: TThoriumType;
                  out ResultType: TThoriumTableEntry) : Boolean
                  ;  Virtual;  Abstract
\end{verbatim}
\Visibility
public
\Description
Implement this if your type supports indicies. If your type supports the given \textit{InputType} as index type, you must return true and write the type the result of the index operation will have to \textit{ResultType}. Otherwise return false.\end{FPCList}
% TThoriumHostObjectType.StaticFieldType
\subsection{TThoriumHostObjectType.StaticFieldType}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:staticfieldtype}
\index{TThoriumHostObjectType.StaticFieldType}
\begin{FPCList}
\Synopsis
Get the type of a static field.\Declaration 

\begin{verbatim}
function StaticFieldType(const AFieldID: QWord;
                        out ResultType: TThoriumTableEntry) : Boolean
                        ;  Virtual;  Abstract
\end{verbatim}
\Visibility
public
\Description
This method must return the type of the static field identified by \textit{ID} in \textit{ResultType}. It is guaranteed that the ID has been fetched using StaticFieldID (\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:staticfieldid}). If the type is for some reason not able to return a valid type (e.g. invalid ID or something), the method must return false. The compiler will throw an error about that.\end{FPCList}
% TThoriumHostObjectType.FieldType
\subsection{TThoriumHostObjectType.FieldType}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:fieldtype}
\index{TThoriumHostObjectType.FieldType}
\begin{FPCList}
\Synopsis
Get the type of a field.\Declaration 

\begin{verbatim}
function FieldType(const AFieldID: QWord;
                  out ResultType: TThoriumTableEntry) : Boolean
                  ;  Virtual;  Abstract
\end{verbatim}
\Visibility
public
\Description
This method must return the type of the field identified by \textit{ID} in \textit{ResultType}. It is guaranteed that the ID has been fetched using FieldID (\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:fieldid}). If the type is for some reason not able to return a valid type (e.g. invalid ID or something), the method must return false. The compiler will throw an error about that.\end{FPCList}
% TThoriumHostObjectType.GetIndex
\subsection{TThoriumHostObjectType.GetIndex}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:getindex}
\index{TThoriumHostObjectType.GetIndex}
\begin{FPCList}
\Synopsis
Perform read access using an index.\Declaration 

\begin{verbatim}
function GetIndex(const AInstance: TThoriumValue;
                 const AIndex: TThoriumValue) : TThoriumValue;  Virtual
                 ;  Abstract
\end{verbatim}
\Visibility
public
\Description
This method is called by the virtual machine whenever an instance of the type is read-accessed via indicies. The instance as well as the used index are passed as parameters and the method must return the value at that location or may throw an exception (although this is discouraged). The returned value must have the type which has been announced to the compiler before using IndexType (\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:indextype}).\end{FPCList}
% TThoriumHostObjectType.SetIndex
\subsection{TThoriumHostObjectType.SetIndex}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:setindex}
\index{TThoriumHostObjectType.SetIndex}
\begin{FPCList}
\Synopsis
Perform write access using an index.\Declaration 

\begin{verbatim}
procedure SetIndex(const AInstance: TThoriumValue;
                  const AIndex: TThoriumValue;
                  const NewValue: TThoriumValue);  Virtual;  Abstract
\end{verbatim}
\Visibility
public
\Description
This method is called by the virtual machine whenever an instance of the type is write-accessed via indicies. The instance, the index used to access as well as the value assigned are passed as parameters. If anything is wrong, the method may throw an exception.\end{FPCList}
% TThoriumHostObjectType.GetField
\subsection{TThoriumHostObjectType.GetField}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:getfield}
\index{TThoriumHostObjectType.GetField}
\begin{FPCList}
\Synopsis
Perform read-access to a field.\Declaration 

\begin{verbatim}
function GetField(const AInstance: TThoriumValue;const AFieldID: QWord)
                  : TThoriumValue;  Virtual;  Abstract
\end{verbatim}
\Visibility
public
\Description
This gets called by the virtual machine whenever a field of your type is read-accessed. This does not match for methods and functions since these references are considered to be static and thus solved at compile time. The instance which is subject to the access as well as the ID of the field are passed as parameters and the function is expected to return the current value of the field.\end{FPCList}
% TThoriumHostObjectType.GetStaticField
\subsection{TThoriumHostObjectType.GetStaticField}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:getstaticfield}
\index{TThoriumHostObjectType.GetStaticField}
\begin{FPCList}
\Synopsis
Perform read access to a static field.\Declaration 

\begin{verbatim}
function GetStaticField(const AInstance: TThoriumValue;
                       const AFieldID: QWord) : TThoriumValue;  Virtual
                       ;  Abstract
\end{verbatim}
\Visibility
public
\Description
This is similar to GetField (\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:getfield}), but for static fields. Note that static fields are not solved at compile time and thus the value is allowed to change during the runtime of the script.\end{FPCList}
% TThoriumHostObjectType.SetField
\subsection{TThoriumHostObjectType.SetField}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:setfield}
\index{TThoriumHostObjectType.SetField}
\begin{FPCList}
\Synopsis
Perform write access to a field.\Declaration 

\begin{verbatim}
procedure SetField(const AInstance: TThoriumValue;const AFieldID: QWord;
                  const NewValue: TThoriumValue);  Virtual;  Abstract
\end{verbatim}
\Visibility
public
\Description
The virtual machine calls this method whenever a field of the type is write accessed. This is only called, when the FieldType (\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:fieldtype}) call subject to this field ID has not set the Static bit in the type. The method is expected to change the value of the field identified by the given ID in the given instance to the given value.\end{FPCList}
% TThoriumHostObjectType.SetStaticField
\subsection{TThoriumHostObjectType.SetStaticField}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:setstaticfield}
\index{TThoriumHostObjectType.SetStaticField}
\begin{FPCList}
\Synopsis
Perform write access to a static field.\Declaration 

\begin{verbatim}
procedure SetStaticField(const AInstance: TThoriumValue;
                        const AFieldID: QWord;
                        const NewValue: TThoriumValue);  Virtual
                        ;  Abstract
\end{verbatim}
\Visibility
public
\Description
The virtual machine calls this method whenever a static field of the type is write accessed. This is only called, when the FieldType (\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:fieldtype}) call subject to this field ID has not set the Static bit in the type. The method is expected to change the value of the static field identified by the given ID to the given value.\end{FPCList}
% TThoriumHostObjectType.GetPropertyStoring
\subsection{TThoriumHostObjectType.GetPropertyStoring}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:getpropertystoring}
\index{TThoriumHostObjectType.GetPropertyStoring}
\begin{FPCList}
\Synopsis
Determine whether a field is storing.\Declaration 

\begin{verbatim}
function GetPropertyStoring(const AFieldID: QWord) : Boolean;  Virtual
                           ;  Abstract
\end{verbatim}
\Visibility
public
\Description
Return true if the property is "storing".  Storing has only relevancy when a RTTI based host object value is passed to a property or a parameter. If the storing bit is set, the object will be marked as "host controlled" (i.e., the according method is called) and will not be freed by reference counting unless the countermethod is called afterwards.\end{FPCList}
% TThoriumHostObjectType.Name
\subsection{TThoriumHostObjectType.Name}
\label{thoriumcorepkg:thorium:tthoriumhostobjecttype:name}
\index{TThoriumHostObjectType.Name}
\begin{FPCList}
\Synopsis
Published name\Declaration 

\begin{verbatim}
Property Name : String
\end{verbatim}
\Visibility
public
\Access
Read
\Description
This is the name which can be used in Thorium to access this type.\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumIdentifierTable
\section{TThoriumIdentifierTable}
\label{thoriumcorepkg:thorium:tthoriumidentifiertable}
\index{TThoriumIdentifierTable}
% Description
\subsection{Description}
Class for internal use - to be described later.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumidentifiertable:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumidentifiertable:addconstantidentifier} & AddConstantIdentifier  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumidentifiertable:addfunctionidentifier} & AddFunctionIdentifier  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumidentifiertable:addregistervariableidentifier} & AddRegisterVariableIdentifier  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumidentifiertable:addvariableidentifier} & AddVariableIdentifier  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumidentifiertable:cleartable} & ClearTable  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumidentifiertable:cleartableto} & ClearTableTo  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumidentifiertable:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumidentifiertable:destroy} & Destroy  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumidentifiertable:findidentifier} & FindIdentifier  &  \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthoriumidentifiertable:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumidentifiertable:count} & Count & r &  \\
\hline
\end{tabularx}
% TThoriumIdentifierTable.Create
\subsection{TThoriumIdentifierTable.Create}
\label{thoriumcorepkg:thorium:tthoriumidentifiertable:create}
\index{TThoriumIdentifierTable.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumIdentifierTable.Destroy
\subsection{TThoriumIdentifierTable.Destroy}
\label{thoriumcorepkg:thorium:tthoriumidentifiertable:destroy}
\index{TThoriumIdentifierTable.Destroy}
\begin{FPCList}
\Declaration 

\begin{verbatim}
destructor Destroy;  Override
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumIdentifierTable.AddConstantIdentifier
\subsection{TThoriumIdentifierTable.AddConstantIdentifier}
\label{thoriumcorepkg:thorium:tthoriumidentifiertable:addconstantidentifier}
\index{TThoriumIdentifierTable.AddConstantIdentifier}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure AddConstantIdentifier(Name: String;Scope: Integer;
                               Offset: Integer;TypeSpec: TThoriumType;
                               Value: TThoriumValue)
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumIdentifierTable.AddVariableIdentifier
\subsection{TThoriumIdentifierTable.AddVariableIdentifier}
\label{thoriumcorepkg:thorium:tthoriumidentifiertable:addvariableidentifier}
\index{TThoriumIdentifierTable.AddVariableIdentifier}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure AddVariableIdentifier(Name: String;Scope: Integer;
                               Offset: Integer;TypeSpec: TThoriumType)
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumIdentifierTable.AddRegisterVariableIdentifier
\subsection{TThoriumIdentifierTable.AddRegisterVariableIdentifier}
\label{thoriumcorepkg:thorium:tthoriumidentifiertable:addregistervariableidentifier}
\index{TThoriumIdentifierTable.AddRegisterVariableIdentifier}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure AddRegisterVariableIdentifier(Name: String;
                                       RegisterID: TThoriumRegisterID;
                                       TypeSpec: TThoriumType)
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumIdentifierTable.AddFunctionIdentifier
\subsection{TThoriumIdentifierTable.AddFunctionIdentifier}
\label{thoriumcorepkg:thorium:tthoriumidentifiertable:addfunctionidentifier}
\index{TThoriumIdentifierTable.AddFunctionIdentifier}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure AddFunctionIdentifier(Name: String;Func: TThoriumFunction)
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumIdentifierTable.ClearTable
\subsection{TThoriumIdentifierTable.ClearTable}
\label{thoriumcorepkg:thorium:tthoriumidentifiertable:cleartable}
\index{TThoriumIdentifierTable.ClearTable}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure ClearTable
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumIdentifierTable.ClearTableTo
\subsection{TThoriumIdentifierTable.ClearTableTo}
\label{thoriumcorepkg:thorium:tthoriumidentifiertable:cleartableto}
\index{TThoriumIdentifierTable.ClearTableTo}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function ClearTableTo(NewCount: Integer) : Integer
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumIdentifierTable.FindIdentifier
\subsection{TThoriumIdentifierTable.FindIdentifier}
\label{thoriumcorepkg:thorium:tthoriumidentifiertable:findidentifier}
\index{TThoriumIdentifierTable.FindIdentifier}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function FindIdentifier(Name: String;out Ident: TThoriumTableEntry)
                        : Boolean
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumIdentifierTable.Count
\subsection{TThoriumIdentifierTable.Count}
\label{thoriumcorepkg:thorium:tthoriumidentifiertable:count}
\index{TThoriumIdentifierTable.Count}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property Count : Integer
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumInstructions
\section{TThoriumInstructions}
\label{thoriumcorepkg:thorium:tthoriuminstructions}
\index{TThoriumInstructions}
% Description
\subsection{Description}
Class for internal use - to be fully described later.  This class is a container for Thorium instructions with some extra methods for easier handling, such as keeping track in address lists of inserted instructions (and thus changed indicies) and more.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriuminstructions:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriuminstructions:addinstructionpointer} & AddInstructionPointer  &  \\
\pageref{thoriumcorepkg:thorium:tthoriuminstructions:appendcode} & AppendCode  &  \\
\pageref{thoriumcorepkg:thorium:tthoriuminstructions:clearcode} & ClearCode  &  \\
\pageref{thoriumcorepkg:thorium:tthoriuminstructions:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthoriuminstructions:deleteinstructions} & DeleteInstructions  &  \\
\pageref{thoriumcorepkg:thorium:tthoriuminstructions:destroy} & Destroy  &  \\
\pageref{thoriumcorepkg:thorium:tthoriuminstructions:dumpcodebin} & DumpCodeBin  &  \\
\pageref{thoriumcorepkg:thorium:tthoriuminstructions:dumpcodestr} & DumpCodeStr  &  \\
\pageref{thoriumcorepkg:thorium:tthoriuminstructions:finish} & Finish  &  \\
\pageref{thoriumcorepkg:thorium:tthoriuminstructions:loadfromstream} & LoadFromStream  &  \\
\pageref{thoriumcorepkg:thorium:tthoriuminstructions:registeraddresslist} & RegisterAddressList  &  \\
\pageref{thoriumcorepkg:thorium:tthoriuminstructions:removeinstructionpointer} & RemoveInstructionPointer  &  \\
\pageref{thoriumcorepkg:thorium:tthoriuminstructions:savetostream} & SaveToStream  &  \\
\pageref{thoriumcorepkg:thorium:tthoriuminstructions:unregisteraddresslist} & UnRegisterAddressList  &  \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthoriuminstructions:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriuminstructions:capacity} & Capacity & rw &  \\
\pageref{thoriumcorepkg:thorium:tthoriuminstructions:count} & Count & r &  \\
\pageref{thoriumcorepkg:thorium:tthoriuminstructions:instruction} & Instruction & r &  \\
\pageref{thoriumcorepkg:thorium:tthoriuminstructions:position} & Position & rw &  \\
\hline
\end{tabularx}
% TThoriumInstructions.Create
\subsection{TThoriumInstructions.Create}
\label{thoriumcorepkg:thorium:tthoriuminstructions:create}
\index{TThoriumInstructions.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumInstructions.Destroy
\subsection{TThoriumInstructions.Destroy}
\label{thoriumcorepkg:thorium:tthoriuminstructions:destroy}
\index{TThoriumInstructions.Destroy}
\begin{FPCList}
\Declaration 

\begin{verbatim}
destructor Destroy;  Override
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumInstructions.AppendCode
\subsection{TThoriumInstructions.AppendCode}
\label{thoriumcorepkg:thorium:tthoriuminstructions:appendcode}
\index{TThoriumInstructions.AppendCode}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function AppendCode(AInstruction: TThoriumInstruction) : Integer
function AppendCode(Code: TThoriumInstructionArray) : Integer
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumInstructions.DeleteInstructions
\subsection{TThoriumInstructions.DeleteInstructions}
\label{thoriumcorepkg:thorium:tthoriuminstructions:deleteinstructions}
\index{TThoriumInstructions.DeleteInstructions}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure DeleteInstructions(AIndex: Integer;ACount: Integer)
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumInstructions.Finish
\subsection{TThoriumInstructions.Finish}
\label{thoriumcorepkg:thorium:tthoriuminstructions:finish}
\index{TThoriumInstructions.Finish}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure Finish
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumInstructions.ClearCode
\subsection{TThoriumInstructions.ClearCode}
\label{thoriumcorepkg:thorium:tthoriuminstructions:clearcode}
\index{TThoriumInstructions.ClearCode}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure ClearCode
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumInstructions.RegisterAddressList
\subsection{TThoriumInstructions.RegisterAddressList}
\label{thoriumcorepkg:thorium:tthoriuminstructions:registeraddresslist}
\index{TThoriumInstructions.RegisterAddressList}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure RegisterAddressList(AList: TThoriumIntList)
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumInstructions.UnRegisterAddressList
\subsection{TThoriumInstructions.UnRegisterAddressList}
\label{thoriumcorepkg:thorium:tthoriuminstructions:unregisteraddresslist}
\index{TThoriumInstructions.UnRegisterAddressList}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure UnRegisterAddressList(AList: TThoriumIntList)
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumInstructions.AddInstructionPointer
\subsection{TThoriumInstructions.AddInstructionPointer}
\label{thoriumcorepkg:thorium:tthoriuminstructions:addinstructionpointer}
\index{TThoriumInstructions.AddInstructionPointer}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure AddInstructionPointer(APointer: PThoriumInstructionAddress)
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumInstructions.RemoveInstructionPointer
\subsection{TThoriumInstructions.RemoveInstructionPointer}
\label{thoriumcorepkg:thorium:tthoriuminstructions:removeinstructionpointer}
\index{TThoriumInstructions.RemoveInstructionPointer}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure RemoveInstructionPointer(APointer: PThoriumInstructionAddress)
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumInstructions.DumpCodeBin
\subsection{TThoriumInstructions.DumpCodeBin}
\label{thoriumcorepkg:thorium:tthoriuminstructions:dumpcodebin}
\index{TThoriumInstructions.DumpCodeBin}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure DumpCodeBin(DestStream: TStream)
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumInstructions.DumpCodeStr
\subsection{TThoriumInstructions.DumpCodeStr}
\label{thoriumcorepkg:thorium:tthoriuminstructions:dumpcodestr}
\index{TThoriumInstructions.DumpCodeStr}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function DumpCodeStr : String
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumInstructions.LoadFromStream
\subsection{TThoriumInstructions.LoadFromStream}
\label{thoriumcorepkg:thorium:tthoriuminstructions:loadfromstream}
\index{TThoriumInstructions.LoadFromStream}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure LoadFromStream(Stream: TStream)
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumInstructions.SaveToStream
\subsection{TThoriumInstructions.SaveToStream}
\label{thoriumcorepkg:thorium:tthoriuminstructions:savetostream}
\index{TThoriumInstructions.SaveToStream}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure SaveToStream(Stream: TStream)
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumInstructions.Count
\subsection{TThoriumInstructions.Count}
\label{thoriumcorepkg:thorium:tthoriuminstructions:count}
\index{TThoriumInstructions.Count}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property Count : Integer
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
% TThoriumInstructions.Capacity
\subsection{TThoriumInstructions.Capacity}
\label{thoriumcorepkg:thorium:tthoriuminstructions:capacity}
\index{TThoriumInstructions.Capacity}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property Capacity : Integer
\end{verbatim}
\Visibility
public
\Access
Read,Write
\end{FPCList}
% TThoriumInstructions.Instruction
\subsection{TThoriumInstructions.Instruction}
\label{thoriumcorepkg:thorium:tthoriuminstructions:instruction}
\index{TThoriumInstructions.Instruction}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property Instruction[Index: Integer]: PThoriumInstruction; default
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
% TThoriumInstructions.Position
\subsection{TThoriumInstructions.Position}
\label{thoriumcorepkg:thorium:tthoriuminstructions:position}
\index{TThoriumInstructions.Position}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property Position : TThoriumInstructionAddress
\end{verbatim}
\Visibility
public
\Access
Read,Write
\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumIntList
\section{TThoriumIntList}
\label{thoriumcorepkg:thorium:tthoriumintlist}
\index{TThoriumIntList}
% Description
\subsection{Description}
Class for internal use - to be described later.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumintlist:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumintlist:addentry} & AddEntry  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumintlist:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumintlist:deleteentry} & DeleteEntry  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumintlist:destroy} & Destroy  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumintlist:findvalue} & FindValue  &  \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthoriumintlist:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumintlist:capacity} & Capacity & rw &  \\
\pageref{thoriumcorepkg:thorium:tthoriumintlist:count} & Count & rw &  \\
\pageref{thoriumcorepkg:thorium:tthoriumintlist:items} & Items & rw &  \\
\hline
\end{tabularx}
% TThoriumIntList.Create
\subsection{TThoriumIntList.Create}
\label{thoriumcorepkg:thorium:tthoriumintlist:create}
\index{TThoriumIntList.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumIntList.Destroy
\subsection{TThoriumIntList.Destroy}
\label{thoriumcorepkg:thorium:tthoriumintlist:destroy}
\index{TThoriumIntList.Destroy}
\begin{FPCList}
\Declaration 

\begin{verbatim}
destructor Destroy;  Override
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumIntList.AddEntry
\subsection{TThoriumIntList.AddEntry}
\label{thoriumcorepkg:thorium:tthoriumintlist:addentry}
\index{TThoriumIntList.AddEntry}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function AddEntry(Value: Integer) : Integer
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumIntList.FindValue
\subsection{TThoriumIntList.FindValue}
\label{thoriumcorepkg:thorium:tthoriumintlist:findvalue}
\index{TThoriumIntList.FindValue}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function FindValue(AValue: Integer) : Integer
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumIntList.DeleteEntry
\subsection{TThoriumIntList.DeleteEntry}
\label{thoriumcorepkg:thorium:tthoriumintlist:deleteentry}
\index{TThoriumIntList.DeleteEntry}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure DeleteEntry(AIndex: Integer)
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumIntList.Items
\subsection{TThoriumIntList.Items}
\label{thoriumcorepkg:thorium:tthoriumintlist:items}
\index{TThoriumIntList.Items}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property Items[Index: Integer]: Integer; default
\end{verbatim}
\Visibility
public
\Access
Read,Write
\end{FPCList}
% TThoriumIntList.Count
\subsection{TThoriumIntList.Count}
\label{thoriumcorepkg:thorium:tthoriumintlist:count}
\index{TThoriumIntList.Count}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property Count : Integer
\end{verbatim}
\Visibility
public
\Access
Read,Write
\end{FPCList}
% TThoriumIntList.Capacity
\subsection{TThoriumIntList.Capacity}
\label{thoriumcorepkg:thorium:tthoriumintlist:capacity}
\index{TThoriumIntList.Capacity}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property Capacity : Integer
\end{verbatim}
\Visibility
public
\Access
Read,Write
\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumIntStack
\section{TThoriumIntStack}
\label{thoriumcorepkg:thorium:tthoriumintstack}
\index{TThoriumIntStack}
% Description
\subsection{Description}
Class for internal use - to be described later.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumintstack:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumintstack:pop} & Pop  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumintstack:push} & Push  &  \\
\hline
\end{tabularx}
% TThoriumIntStack.Push
\subsection{TThoriumIntStack.Push}
\label{thoriumcorepkg:thorium:tthoriumintstack:push}
\index{TThoriumIntStack.Push}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure Push(Value: Integer)
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumIntStack.Pop
\subsection{TThoriumIntStack.Pop}
\label{thoriumcorepkg:thorium:tthoriumintstack:pop}
\index{TThoriumIntStack.Pop}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function Pop : Integer
\end{verbatim}
\Visibility
public
\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumJumpList
\section{TThoriumJumpList}
\label{thoriumcorepkg:thorium:tthoriumjumplist}
\index{TThoriumJumpList}
% Description
\subsection{Description}
Class for internal use - to be described later.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumjumplist:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumjumplist:changeaddresses} & ChangeAddresses  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumjumplist:filladdresses} & FillAddresses  &  \\
\hline
\end{tabularx}
% TThoriumJumpList.FillAddresses
\subsection{TThoriumJumpList.FillAddresses}
\label{thoriumcorepkg:thorium:tthoriumjumplist:filladdresses}
\index{TThoriumJumpList.FillAddresses}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure FillAddresses(DownToCount: Integer;
                       Address: TThoriumInstructionAddress;
                       Instructions: TThoriumInstructions)
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumJumpList.ChangeAddresses
\subsection{TThoriumJumpList.ChangeAddresses}
\label{thoriumcorepkg:thorium:tthoriumjumplist:changeaddresses}
\index{TThoriumJumpList.ChangeAddresses}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure ChangeAddresses(Offset: Integer;
                         AfterAddress: TThoriumInstructionAddress;
                         Instructions: TThoriumInstructions)
\end{verbatim}
\Visibility
public
\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumLibrary
\section{TThoriumLibrary}
\label{thoriumcorepkg:thorium:tthoriumlibrary}
\index{TThoriumLibrary}
% Description
\subsection{Description}
The base class for any library the host environment may want to publish to Thorium. To build a library, you need to override the GetName and InitializeLibrary methods. For an example see the thoriumlibpkg and the customlib example.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumlibrary:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:adddependency} & AddDependency  & Add a dependency \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:clearall} & ClearAll  & Clear the whole library \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:clearfunctions} & ClearFunctions  & Clear all functions \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:cleartypes} & ClearTypes  & Clear all types \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:deepfindhosttype} & DeepFindHostType  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:deepfindrttitype} & DeepFindRTTIType  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:deepfindrttitypebyclass} & DeepFindRTTITypeByClass  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:deletehostfunction} & DeleteHostFunction  & Delete a function \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:deletehosttype} & DeleteHostType  & Delete a type \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:destroy} & Destroy  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:findconstant} & FindConstant  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:findhostfunction} & FindHostFunction  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:findhosttype} & FindHostType  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:findproperty} & FindProperty  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:findrttitype} & FindRTTIType  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:findrttitypebyclass} & FindRTTITypeByClass  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:getconstant} & GetConstant  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:getconstantcount} & GetConstantCount  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:gethostfunction} & GetHostFunction  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:gethostfunctioncount} & GetHostFunctionCount  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:gethosttype} & GetHostType  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:gethosttypecount} & GetHostTypeCount  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:getlibraryproperty} & GetLibraryProperty  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:getlibrarypropertycount} & GetLibraryPropertyCount  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:getname} & GetName  & Get the library name \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:getrttitype} & GetRTTIType  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:getrttitypecount} & GetRTTITypeCount  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:indexofconstant} & IndexOfConstant  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:indexofhostfunction} & IndexOfHostFunction  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:indexofhosttype} & IndexOfHostType  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:indexofproperty} & IndexOfProperty  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:indexofrttitype} & IndexOfRTTIType  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:initializelibrary} & InitializeLibrary  & Initialize the library \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:precompilefunctions} & PrecompileFunctions  & Precompile all known NativeCall functions. \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:registerconstant} & RegisterConstant  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:registernativecallfunction} & RegisterNativeCallFunction  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:registernativecallmethodasfunction} & RegisterNativeCallMethodAsFunction  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:registerobjecttype} & RegisterObjectType  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:registerpropertycallback} & RegisterPropertyCallback  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:registerpropertycustom} & RegisterPropertyCustom  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:registerpropertydirect} & RegisterPropertyDirect  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:registerpropertydirectcallback} & RegisterPropertyDirectCallback  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:registerrttitype} & RegisterRTTIType  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:registersimplemethod} & RegisterSimpleMethod  &  \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthoriumlibrary:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:constant} & Constant & r &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:constantcount} & ConstantCount & r &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:hostfunction} & HostFunction & r &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:hostfunctioncount} & HostFunctionCount & r &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:hosttype} & HostType & r &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:hosttypecount} & HostTypeCount & r &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:libraryproperty} & LibraryProperty & r &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:librarypropertycount} & LibraryPropertyCount & r &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:rttitype} & RTTIType & r &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrary:rttitypecount} & RTTITypeCount & r &  \\
\hline
\end{tabularx}
% TThoriumLibrary.Create
\subsection{TThoriumLibrary.Create}
\label{thoriumcorepkg:thorium:tthoriumlibrary:create}
\index{TThoriumLibrary.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create(AThorium: TThorium)
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumLibrary.Destroy
\subsection{TThoriumLibrary.Destroy}
\label{thoriumcorepkg:thorium:tthoriumlibrary:destroy}
\index{TThoriumLibrary.Destroy}
\begin{FPCList}
\Declaration 

\begin{verbatim}
destructor Destroy;  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumLibrary.GetConstant
\subsection{TThoriumLibrary.GetConstant}
\label{thoriumcorepkg:thorium:tthoriumlibrary:getconstant}
\index{TThoriumLibrary.GetConstant}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function GetConstant(AIndex: Integer) : TThoriumLibraryConstant
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibrary.GetConstantCount
\subsection{TThoriumLibrary.GetConstantCount}
\label{thoriumcorepkg:thorium:tthoriumlibrary:getconstantcount}
\index{TThoriumLibrary.GetConstantCount}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function GetConstantCount : Integer
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibrary.GetHostFunction
\subsection{TThoriumLibrary.GetHostFunction}
\label{thoriumcorepkg:thorium:tthoriumlibrary:gethostfunction}
\index{TThoriumLibrary.GetHostFunction}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function GetHostFunction(AIndex: Integer) : TThoriumHostFunctionBase
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibrary.GetHostFunctionCount
\subsection{TThoriumLibrary.GetHostFunctionCount}
\label{thoriumcorepkg:thorium:tthoriumlibrary:gethostfunctioncount}
\index{TThoriumLibrary.GetHostFunctionCount}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function GetHostFunctionCount : Integer
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibrary.GetHostType
\subsection{TThoriumLibrary.GetHostType}
\label{thoriumcorepkg:thorium:tthoriumlibrary:gethosttype}
\index{TThoriumLibrary.GetHostType}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function GetHostType(AIndex: Integer) : TThoriumHostObjectType
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibrary.GetHostTypeCount
\subsection{TThoriumLibrary.GetHostTypeCount}
\label{thoriumcorepkg:thorium:tthoriumlibrary:gethosttypecount}
\index{TThoriumLibrary.GetHostTypeCount}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function GetHostTypeCount : Integer
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibrary.GetLibraryProperty
\subsection{TThoriumLibrary.GetLibraryProperty}
\label{thoriumcorepkg:thorium:tthoriumlibrary:getlibraryproperty}
\index{TThoriumLibrary.GetLibraryProperty}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function GetLibraryProperty(AIndex: Integer) : TThoriumLibraryProperty
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibrary.GetLibraryPropertyCount
\subsection{TThoriumLibrary.GetLibraryPropertyCount}
\label{thoriumcorepkg:thorium:tthoriumlibrary:getlibrarypropertycount}
\index{TThoriumLibrary.GetLibraryPropertyCount}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function GetLibraryPropertyCount : Integer
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibrary.GetRTTIType
\subsection{TThoriumLibrary.GetRTTIType}
\label{thoriumcorepkg:thorium:tthoriumlibrary:getrttitype}
\index{TThoriumLibrary.GetRTTIType}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function GetRTTIType(AIndex: Integer) : TThoriumRTTIObjectType
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibrary.GetRTTITypeCount
\subsection{TThoriumLibrary.GetRTTITypeCount}
\label{thoriumcorepkg:thorium:tthoriumlibrary:getrttitypecount}
\index{TThoriumLibrary.GetRTTITypeCount}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function GetRTTITypeCount : Integer
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibrary.PrecompileFunctions
\subsection{TThoriumLibrary.PrecompileFunctions}
\label{thoriumcorepkg:thorium:tthoriumlibrary:precompilefunctions}
\index{TThoriumLibrary.PrecompileFunctions}
\begin{FPCList}
\Synopsis
Precompile all known NativeCall functions.\Declaration 

\begin{verbatim}
procedure PrecompileFunctions
\end{verbatim}
\Visibility
protected
\Description
This will precompile any function which derives from TThoriumFunctionNativeCall (\pageref{thoriumcorepkg:thorium}) or TThoriumMethodNativeCall (\pageref{thoriumcorepkg:thorium}) and which is in the host function list of the library. This method is automatically called by the constructor after calling InitializeLibrary (\pageref{thoriumcorepkg:thorium:tthoriumlibrary:initializelibrary}).\end{FPCList}
% TThoriumLibrary.AddDependency
\subsection{TThoriumLibrary.AddDependency}
\label{thoriumcorepkg:thorium:tthoriumlibrary:adddependency}
\index{TThoriumLibrary.AddDependency}
\begin{FPCList}
\Synopsis
Add a dependency\Declaration 

\begin{verbatim}
procedure AddDependency(const ALibName: String)
procedure AddDependency(const ALib: TThoriumLibrary)
\end{verbatim}
\Visibility
protected
\Description
This method adds a dependency to the library and throws an exception if the dependency cannot be fulfilled.\end{FPCList}
% TThoriumLibrary.ClearAll
\subsection{TThoriumLibrary.ClearAll}
\label{thoriumcorepkg:thorium:tthoriumlibrary:clearall}
\index{TThoriumLibrary.ClearAll}
\begin{FPCList}
\Synopsis
Clear the whole library\Declaration 

\begin{verbatim}
procedure ClearAll
\end{verbatim}
\Visibility
protected
\Description
Deletes anything related to this library. Properties, functions, types, anything I said, did you hear me? Anything!!\end{FPCList}
% TThoriumLibrary.ClearFunctions
\subsection{TThoriumLibrary.ClearFunctions}
\label{thoriumcorepkg:thorium:tthoriumlibrary:clearfunctions}
\index{TThoriumLibrary.ClearFunctions}
\begin{FPCList}
\Synopsis
Clear all functions\Declaration 

\begin{verbatim}
procedure ClearFunctions
\end{verbatim}
\Visibility
protected
\Description
Delete any functions registered with this library.\end{FPCList}
% TThoriumLibrary.ClearTypes
\subsection{TThoriumLibrary.ClearTypes}
\label{thoriumcorepkg:thorium:tthoriumlibrary:cleartypes}
\index{TThoriumLibrary.ClearTypes}
\begin{FPCList}
\Synopsis
Clear all types\Declaration 

\begin{verbatim}
procedure ClearTypes
\end{verbatim}
\Visibility
protected
\Description
Deletes all types associated with this library.\end{FPCList}
% TThoriumLibrary.DeleteHostFunction
\subsection{TThoriumLibrary.DeleteHostFunction}
\label{thoriumcorepkg:thorium:tthoriumlibrary:deletehostfunction}
\index{TThoriumLibrary.DeleteHostFunction}
\begin{FPCList}
\Synopsis
Delete a function\Declaration 

\begin{verbatim}
procedure DeleteHostFunction(AIndex: Integer)
\end{verbatim}
\Visibility
protected
\Description
This removes the function at index \textit{AIndex} from the library.\end{FPCList}
% TThoriumLibrary.DeleteHostType
\subsection{TThoriumLibrary.DeleteHostType}
\label{thoriumcorepkg:thorium:tthoriumlibrary:deletehosttype}
\index{TThoriumLibrary.DeleteHostType}
\begin{FPCList}
\Synopsis
Delete a type\Declaration 

\begin{verbatim}
procedure DeleteHostType(AIndex: Integer)
\end{verbatim}
\Visibility
protected
\Description
This removes the type at index \textit{AIndex} from the library.\end{FPCList}
% TThoriumLibrary.GetName
\subsection{TThoriumLibrary.GetName}
\label{thoriumcorepkg:thorium:tthoriumlibrary:getname}
\index{TThoriumLibrary.GetName}
\begin{FPCList}
\Synopsis
Get the library name\Declaration 

\begin{verbatim}
function GetName : String;  Virtual;  Abstract
\end{verbatim}
\Visibility
protected
\Description
This class method must return the name of the library, that is the one under which the library should be able to be loaded in Thorium.\end{FPCList}
% TThoriumLibrary.InitializeLibrary
\subsection{TThoriumLibrary.InitializeLibrary}
\label{thoriumcorepkg:thorium:tthoriumlibrary:initializelibrary}
\index{TThoriumLibrary.InitializeLibrary}
\begin{FPCList}
\Synopsis
Initialize the library\Declaration 

\begin{verbatim}
procedure InitializeLibrary;  Virtual
\end{verbatim}
\Visibility
protected
\Description
This function should probably be overriden by any descendant class. It is called by the constructor to let the library initialize itself. That is adding host functions and types as well as library properties.\end{FPCList}
% TThoriumLibrary.RegisterConstant
\subsection{TThoriumLibrary.RegisterConstant}
\label{thoriumcorepkg:thorium:tthoriumlibrary:registerconstant}
\index{TThoriumLibrary.RegisterConstant}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function RegisterConstant(const AName: String;
                         const AValue: TThoriumValue) : PThoriumValue
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibrary.RegisterNativeCallFunction
\subsection{TThoriumLibrary.RegisterNativeCallFunction}
\label{thoriumcorepkg:thorium:tthoriumlibrary:registernativecallfunction}
\index{TThoriumLibrary.RegisterNativeCallFunction}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function RegisterNativeCallFunction(const AName: String;
                                   const ACodePointer: Pointer;
                                   const AParameters: Array of TThoriumHostType;
                                   const AReturnType: TThoriumHostType;
                                   const ACallingConvention: TThoriumNativeCallingConvention)
                                    : TThoriumHostFunctionNativeCall
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibrary.RegisterNativeCallMethodAsFunction
\subsection{TThoriumLibrary.RegisterNativeCallMethodAsFunction}
\label{thoriumcorepkg:thorium:tthoriumlibrary:registernativecallmethodasfunction}
\index{TThoriumLibrary.RegisterNativeCallMethodAsFunction}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function RegisterNativeCallMethodAsFunction(const AName: String;
                                           const ACodePointer: Pointer;
                                           const ADataPointer: Pointer;
                                           const AParameters: Array of TThoriumHostType;
                                           const AReturnType: TThoriumHostType;
                                           const ACallingConvention: TThoriumNativeCallingConvention)
                                            : TThoriumHostMethodAsFunctionNativeCall
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibrary.RegisterObjectType
\subsection{TThoriumLibrary.RegisterObjectType}
\label{thoriumcorepkg:thorium:tthoriumlibrary:registerobjecttype}
\index{TThoriumLibrary.RegisterObjectType}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function RegisterObjectType(const AName: String;
                           const ATypeClass: TThoriumHostObjectTypeClass)
                            : TThoriumHostObjectType
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibrary.RegisterPropertyCallback
\subsection{TThoriumLibrary.RegisterPropertyCallback}
\label{thoriumcorepkg:thorium:tthoriumlibrary:registerpropertycallback}
\index{TThoriumLibrary.RegisterPropertyCallback}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function RegisterPropertyCallback(const AName: String;
                                 const ATypeSpec: TThoriumType;
                                 Static: Boolean;
                                 const AGetCallback: TThoriumOnPropertyGet;
                                 const ASetCallback: TThoriumOnPropertySet)
                                  : TThoriumLibraryPropertyCallback
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibrary.RegisterPropertyCustom
\subsection{TThoriumLibrary.RegisterPropertyCustom}
\label{thoriumcorepkg:thorium:tthoriumlibrary:registerpropertycustom}
\index{TThoriumLibrary.RegisterPropertyCustom}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function RegisterPropertyCustom(const AName: String;
                               const AClass: TThoriumLibraryPropertyClass)
                                : TThoriumLibraryProperty
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibrary.RegisterPropertyDirect
\subsection{TThoriumLibrary.RegisterPropertyDirect}
\label{thoriumcorepkg:thorium:tthoriumlibrary:registerpropertydirect}
\index{TThoriumLibrary.RegisterPropertyDirect}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function RegisterPropertyDirect(const AName: String;
                               const ATypeSpec: TThoriumType;
                               Static: Boolean)
                                : TThoriumLibraryPropertyDirect
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibrary.RegisterPropertyDirectCallback
\subsection{TThoriumLibrary.RegisterPropertyDirectCallback}
\label{thoriumcorepkg:thorium:tthoriumlibrary:registerpropertydirectcallback}
\index{TThoriumLibrary.RegisterPropertyDirectCallback}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function RegisterPropertyDirectCallback(const AName: String;
                                       const ATypeSpec: TThoriumType;
                                       Static: Boolean;
                                       Callback: TThoriumOnPropertySetCallback)
                                        : TThoriumLibraryPropertyDirectSetCallback
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibrary.RegisterRTTIType
\subsection{TThoriumLibrary.RegisterRTTIType}
\label{thoriumcorepkg:thorium:tthoriumlibrary:registerrttitype}
\index{TThoriumLibrary.RegisterRTTIType}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function RegisterRTTIType(const AClass: TThoriumPersistentClass;
                         AbstractClass: Boolean)
                          : TThoriumRTTIObjectType
function RegisterRTTIType(const AClass: TClass;
                         AMethodsCallback: TThoriumRTTIMethodsCallback;
                         AStaticMethodsCallback: TThoriumRTTIStaticMethodsCallback;
                         AbstractClass: Boolean)
                          : TThoriumRTTIObjectType
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibrary.RegisterSimpleMethod
\subsection{TThoriumLibrary.RegisterSimpleMethod}
\label{thoriumcorepkg:thorium:tthoriumlibrary:registersimplemethod}
\index{TThoriumLibrary.RegisterSimpleMethod}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function RegisterSimpleMethod(const AName: String;
                             const AFunction: TThoriumSimpleMethod;
                             const AParameters: Array of TThoriumHostType;
                             const AReturnType: TThoriumHostType)
                              : TThoriumHostFunctionSimpleMethod
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibrary.DeepFindHostType
\subsection{TThoriumLibrary.DeepFindHostType}
\label{thoriumcorepkg:thorium:tthoriumlibrary:deepfindhosttype}
\index{TThoriumLibrary.DeepFindHostType}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function DeepFindHostType(const AName: String) : TThoriumHostObjectType
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumLibrary.DeepFindRTTIType
\subsection{TThoriumLibrary.DeepFindRTTIType}
\label{thoriumcorepkg:thorium:tthoriumlibrary:deepfindrttitype}
\index{TThoriumLibrary.DeepFindRTTIType}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function DeepFindRTTIType(const AName: String) : TThoriumRTTIObjectType
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumLibrary.DeepFindRTTITypeByClass
\subsection{TThoriumLibrary.DeepFindRTTITypeByClass}
\label{thoriumcorepkg:thorium:tthoriumlibrary:deepfindrttitypebyclass}
\index{TThoriumLibrary.DeepFindRTTITypeByClass}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function DeepFindRTTITypeByClass(const AClass: TClass)
                                 : TThoriumRTTIObjectType
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumLibrary.FindConstant
\subsection{TThoriumLibrary.FindConstant}
\label{thoriumcorepkg:thorium:tthoriumlibrary:findconstant}
\index{TThoriumLibrary.FindConstant}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function FindConstant(const AName: String) : TThoriumLibraryConstant
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumLibrary.FindHostFunction
\subsection{TThoriumLibrary.FindHostFunction}
\label{thoriumcorepkg:thorium:tthoriumlibrary:findhostfunction}
\index{TThoriumLibrary.FindHostFunction}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function FindHostFunction(const AName: String)
                          : TThoriumHostFunctionBase
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumLibrary.FindHostType
\subsection{TThoriumLibrary.FindHostType}
\label{thoriumcorepkg:thorium:tthoriumlibrary:findhosttype}
\index{TThoriumLibrary.FindHostType}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function FindHostType(const AName: String) : TThoriumHostObjectType
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumLibrary.FindProperty
\subsection{TThoriumLibrary.FindProperty}
\label{thoriumcorepkg:thorium:tthoriumlibrary:findproperty}
\index{TThoriumLibrary.FindProperty}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function FindProperty(const AName: String) : TThoriumLibraryProperty
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumLibrary.FindRTTIType
\subsection{TThoriumLibrary.FindRTTIType}
\label{thoriumcorepkg:thorium:tthoriumlibrary:findrttitype}
\index{TThoriumLibrary.FindRTTIType}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function FindRTTIType(const AName: String) : TThoriumRTTIObjectType
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumLibrary.FindRTTITypeByClass
\subsection{TThoriumLibrary.FindRTTITypeByClass}
\label{thoriumcorepkg:thorium:tthoriumlibrary:findrttitypebyclass}
\index{TThoriumLibrary.FindRTTITypeByClass}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function FindRTTITypeByClass(const AClass: TClass)
                             : TThoriumRTTIObjectType
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumLibrary.IndexOfConstant
\subsection{TThoriumLibrary.IndexOfConstant}
\label{thoriumcorepkg:thorium:tthoriumlibrary:indexofconstant}
\index{TThoriumLibrary.IndexOfConstant}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function IndexOfConstant(const AName: String) : Integer
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumLibrary.IndexOfHostFunction
\subsection{TThoriumLibrary.IndexOfHostFunction}
\label{thoriumcorepkg:thorium:tthoriumlibrary:indexofhostfunction}
\index{TThoriumLibrary.IndexOfHostFunction}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function IndexOfHostFunction(const AName: String) : Integer
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumLibrary.IndexOfHostType
\subsection{TThoriumLibrary.IndexOfHostType}
\label{thoriumcorepkg:thorium:tthoriumlibrary:indexofhosttype}
\index{TThoriumLibrary.IndexOfHostType}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function IndexOfHostType(const AName: String) : Integer
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumLibrary.IndexOfProperty
\subsection{TThoriumLibrary.IndexOfProperty}
\label{thoriumcorepkg:thorium:tthoriumlibrary:indexofproperty}
\index{TThoriumLibrary.IndexOfProperty}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function IndexOfProperty(const AName: String) : Integer
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumLibrary.IndexOfRTTIType
\subsection{TThoriumLibrary.IndexOfRTTIType}
\label{thoriumcorepkg:thorium:tthoriumlibrary:indexofrttitype}
\index{TThoriumLibrary.IndexOfRTTIType}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function IndexOfRTTIType(const AName: String) : Integer
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumLibrary.Constant
\subsection{TThoriumLibrary.Constant}
\label{thoriumcorepkg:thorium:tthoriumlibrary:constant}
\index{TThoriumLibrary.Constant}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property Constant[AIndex: Integer]: TThoriumLibraryConstant
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
% TThoriumLibrary.ConstantCount
\subsection{TThoriumLibrary.ConstantCount}
\label{thoriumcorepkg:thorium:tthoriumlibrary:constantcount}
\index{TThoriumLibrary.ConstantCount}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property ConstantCount : Integer
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
% TThoriumLibrary.HostFunction
\subsection{TThoriumLibrary.HostFunction}
\label{thoriumcorepkg:thorium:tthoriumlibrary:hostfunction}
\index{TThoriumLibrary.HostFunction}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property HostFunction[AIndex: Integer]: TThoriumHostFunctionBase
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
% TThoriumLibrary.HostFunctionCount
\subsection{TThoriumLibrary.HostFunctionCount}
\label{thoriumcorepkg:thorium:tthoriumlibrary:hostfunctioncount}
\index{TThoriumLibrary.HostFunctionCount}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property HostFunctionCount : Integer
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
% TThoriumLibrary.HostType
\subsection{TThoriumLibrary.HostType}
\label{thoriumcorepkg:thorium:tthoriumlibrary:hosttype}
\index{TThoriumLibrary.HostType}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property HostType[AIndex: Integer]: TThoriumHostObjectType
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
% TThoriumLibrary.HostTypeCount
\subsection{TThoriumLibrary.HostTypeCount}
\label{thoriumcorepkg:thorium:tthoriumlibrary:hosttypecount}
\index{TThoriumLibrary.HostTypeCount}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property HostTypeCount : Integer
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
% TThoriumLibrary.LibraryProperty
\subsection{TThoriumLibrary.LibraryProperty}
\label{thoriumcorepkg:thorium:tthoriumlibrary:libraryproperty}
\index{TThoriumLibrary.LibraryProperty}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property LibraryProperty[AIndex: Integer]: TThoriumLibraryProperty
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
% TThoriumLibrary.LibraryPropertyCount
\subsection{TThoriumLibrary.LibraryPropertyCount}
\label{thoriumcorepkg:thorium:tthoriumlibrary:librarypropertycount}
\index{TThoriumLibrary.LibraryPropertyCount}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property LibraryPropertyCount : Integer
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
% TThoriumLibrary.RTTIType
\subsection{TThoriumLibrary.RTTIType}
\label{thoriumcorepkg:thorium:tthoriumlibrary:rttitype}
\index{TThoriumLibrary.RTTIType}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property RTTIType[AIndex: Integer]: TThoriumRTTIObjectType
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
% TThoriumLibrary.RTTITypeCount
\subsection{TThoriumLibrary.RTTITypeCount}
\label{thoriumcorepkg:thorium:tthoriumlibrary:rttitypecount}
\index{TThoriumLibrary.RTTITypeCount}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property RTTITypeCount : Integer
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumLibraryConstant
\section{TThoriumLibraryConstant}
\label{thoriumcorepkg:thorium:tthoriumlibraryconstant}
\index{TThoriumLibraryConstant}
% Description
\subsection{Description}
This class implements a constant to be exported by a library.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumLibraryProperty
\section{TThoriumLibraryProperty}
\label{thoriumcorepkg:thorium:tthoriumlibraryproperty}
\index{TThoriumLibraryProperty}
% Description
\subsection{Description}
Like a public variable in a Thorium module, a library can export properties which may even be changed by modules.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumlibraryproperty:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumlibraryproperty:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibraryproperty:getstatic} & GetStatic  & Determine whether the property is readonly. \\
\pageref{thoriumcorepkg:thorium:tthoriumlibraryproperty:gettype} & GetType  & Get the type of the value. \\
\pageref{thoriumcorepkg:thorium:tthoriumlibraryproperty:getvalue} & GetValue  & Get the value of the property. \\
\pageref{thoriumcorepkg:thorium:tthoriumlibraryproperty:setvalue} & SetValue  & Set the value of the property. \\
\hline
\end{tabularx}
% TThoriumLibraryProperty.Create
\subsection{TThoriumLibraryProperty.Create}
\label{thoriumcorepkg:thorium:tthoriumlibraryproperty:create}
\index{TThoriumLibraryProperty.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create;  Virtual
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumLibraryProperty.GetValue
\subsection{TThoriumLibraryProperty.GetValue}
\label{thoriumcorepkg:thorium:tthoriumlibraryproperty:getvalue}
\index{TThoriumLibraryProperty.GetValue}
\begin{FPCList}
\Synopsis
Get the value of the property.\Declaration 

\begin{verbatim}
procedure GetValue(const AThoriumValue: PThoriumValue);  Virtual
                  ;  Abstract
\end{verbatim}
\Visibility
protected
\Description
This function is supposed to write the value of the property to value pointed to by \textit{AThoriumValue}.\end{FPCList}
% TThoriumLibraryProperty.GetStatic
\subsection{TThoriumLibraryProperty.GetStatic}
\label{thoriumcorepkg:thorium:tthoriumlibraryproperty:getstatic}
\index{TThoriumLibraryProperty.GetStatic}
\begin{FPCList}
\Synopsis
Determine whether the property is readonly.\Declaration 

\begin{verbatim}
function GetStatic : Boolean;  Virtual;  Abstract
\end{verbatim}
\Visibility
protected
\Description
Must return true when the value is read only.\end{FPCList}
% TThoriumLibraryProperty.GetType
\subsection{TThoriumLibraryProperty.GetType}
\label{thoriumcorepkg:thorium:tthoriumlibraryproperty:gettype}
\index{TThoriumLibraryProperty.GetType}
\begin{FPCList}
\Synopsis
Get the type of the value.\Declaration 

\begin{verbatim}
function GetType : TThoriumType;  Virtual;  Abstract
\end{verbatim}
\Visibility
protected
\Description
Return the type of the value. This must not change during the whole program runtime.\end{FPCList}
% TThoriumLibraryProperty.SetValue
\subsection{TThoriumLibraryProperty.SetValue}
\label{thoriumcorepkg:thorium:tthoriumlibraryproperty:setvalue}
\index{TThoriumLibraryProperty.SetValue}
\begin{FPCList}
\Synopsis
Set the value of the property.\Declaration 

\begin{verbatim}
procedure SetValue(const AThoriumValue: PThoriumValue);  Virtual
                  ;  Abstract
\end{verbatim}
\Visibility
protected
\Description
This method should read the given value and assign it to the property.\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumLibraryPropertyCallback
\section{TThoriumLibraryPropertyCallback}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertycallback}
\index{TThoriumLibraryPropertyCallback}
% Description
\subsection{Description}
This implementation is a virtual property. Any read or write from or to the property is redirected to callbacks allowing the owner to get the value from elsewhere.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertycallback:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumlibrarypropertycallback:calchash} & CalcHash  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrarypropertycallback:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrarypropertycallback:getstatic} & GetStatic  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrarypropertycallback:gettype} & GetType  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrarypropertycallback:getvalue} & GetValue  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrarypropertycallback:setvalue} & SetValue  &  \\
\hline
\end{tabularx}
% TThoriumLibraryPropertyCallback.Create
\subsection{TThoriumLibraryPropertyCallback.Create}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertycallback:create}
\index{TThoriumLibraryPropertyCallback.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create;  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumLibraryPropertyCallback.CalcHash
\subsection{TThoriumLibraryPropertyCallback.CalcHash}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertycallback:calchash}
\index{TThoriumLibraryPropertyCallback.CalcHash}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure CalcHash;  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibraryPropertyCallback.GetValue
\subsection{TThoriumLibraryPropertyCallback.GetValue}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertycallback:getvalue}
\index{TThoriumLibraryPropertyCallback.GetValue}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure GetValue(const AThoriumValue: PThoriumValue);  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibraryPropertyCallback.GetStatic
\subsection{TThoriumLibraryPropertyCallback.GetStatic}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertycallback:getstatic}
\index{TThoriumLibraryPropertyCallback.GetStatic}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function GetStatic : Boolean;  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibraryPropertyCallback.GetType
\subsection{TThoriumLibraryPropertyCallback.GetType}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertycallback:gettype}
\index{TThoriumLibraryPropertyCallback.GetType}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function GetType : TThoriumType;  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibraryPropertyCallback.SetValue
\subsection{TThoriumLibraryPropertyCallback.SetValue}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertycallback:setvalue}
\index{TThoriumLibraryPropertyCallback.SetValue}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure SetValue(const AThoriumValue: PThoriumValue);  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumLibraryPropertyDirect
\section{TThoriumLibraryPropertyDirect}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertydirect}
\index{TThoriumLibraryPropertyDirect}
% Description
\subsection{Description}
This class implements a library property using a private variable as storage without any control over the values assigned to it.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertydirect:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumlibrarypropertydirect:calchash} & CalcHash  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrarypropertydirect:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrarypropertydirect:destroy} & Destroy  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrarypropertydirect:getstatic} & GetStatic  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrarypropertydirect:gettype} & GetType  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrarypropertydirect:getvalue} & GetValue  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrarypropertydirect:setvalue} & SetValue  &  \\
\hline
\end{tabularx}
% TThoriumLibraryPropertyDirect.Create
\subsection{TThoriumLibraryPropertyDirect.Create}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertydirect:create}
\index{TThoriumLibraryPropertyDirect.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create;  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumLibraryPropertyDirect.Destroy
\subsection{TThoriumLibraryPropertyDirect.Destroy}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertydirect:destroy}
\index{TThoriumLibraryPropertyDirect.Destroy}
\begin{FPCList}
\Declaration 

\begin{verbatim}
destructor Destroy;  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumLibraryPropertyDirect.CalcHash
\subsection{TThoriumLibraryPropertyDirect.CalcHash}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertydirect:calchash}
\index{TThoriumLibraryPropertyDirect.CalcHash}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure CalcHash;  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibraryPropertyDirect.GetValue
\subsection{TThoriumLibraryPropertyDirect.GetValue}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertydirect:getvalue}
\index{TThoriumLibraryPropertyDirect.GetValue}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure GetValue(const AThoriumValue: PThoriumValue);  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibraryPropertyDirect.GetStatic
\subsection{TThoriumLibraryPropertyDirect.GetStatic}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertydirect:getstatic}
\index{TThoriumLibraryPropertyDirect.GetStatic}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function GetStatic : Boolean;  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibraryPropertyDirect.GetType
\subsection{TThoriumLibraryPropertyDirect.GetType}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertydirect:gettype}
\index{TThoriumLibraryPropertyDirect.GetType}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function GetType : TThoriumType;  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibraryPropertyDirect.SetValue
\subsection{TThoriumLibraryPropertyDirect.SetValue}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertydirect:setvalue}
\index{TThoriumLibraryPropertyDirect.SetValue}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure SetValue(const AThoriumValue: PThoriumValue);  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumLibraryPropertyDirectSetCallback
\section{TThoriumLibraryPropertyDirectSetCallback}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertydirectsetcallback}
\index{TThoriumLibraryPropertyDirectSetCallback}
% Description
\subsection{Description}
This class implements a library property using a private variable but providing also a callback which is called when a value is assigned to the property with the possibility to abort the assignment.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertydirectsetcallback:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumlibrarypropertydirectsetcallback:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumlibrarypropertydirectsetcallback:setvalue} & SetValue  &  \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertydirectsetcallback:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumlibrarypropertydirectsetcallback:onpropertyset} & OnPropertySet & rw &  \\
\hline
\end{tabularx}
% TThoriumLibraryPropertyDirectSetCallback.Create
\subsection{TThoriumLibraryPropertyDirectSetCallback.Create}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertydirectsetcallback:create}
\index{TThoriumLibraryPropertyDirectSetCallback.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create;  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumLibraryPropertyDirectSetCallback.SetValue
\subsection{TThoriumLibraryPropertyDirectSetCallback.SetValue}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertydirectsetcallback:setvalue}
\index{TThoriumLibraryPropertyDirectSetCallback.SetValue}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure SetValue(const AThoriumValue: PThoriumValue);  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumLibraryPropertyDirectSetCallback.OnPropertySet
\subsection{TThoriumLibraryPropertyDirectSetCallback.OnPropertySet}
\label{thoriumcorepkg:thorium:tthoriumlibrarypropertydirectsetcallback:onpropertyset}
\index{TThoriumLibraryPropertyDirectSetCallback.OnPropertySet}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property OnPropertySet : TThoriumOnPropertySetCallback
\end{verbatim}
\Visibility
public
\Access
Read,Write
\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumModule
\section{TThoriumModule}
\label{thoriumcorepkg:thorium:tthoriummodule}
\index{TThoriumModule}
% Description
\subsection{Description}
TThoriumModule represents one Thorium module. This class is capable of compiling a module from source and loading/saving it from/to a binary stream. It manages dependencies on other modules and libraries as well as the functions and variables published by the module.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriummodule:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriummodule:calchash} & CalcHash  &  \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:compilefromstream} & CompileFromStream  & Compile Thorium script source code. \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:destroy} & Destroy  &  \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:dump} & Dump  & Dump information to console \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:dumpcodestr} & DumpCodeStr  & Format instructions and return string. \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:dumplibstr} & DumpLibStr  & Format library and return string. \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:executemain} & ExecuteMain  & Deprecated? \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:fillheader} & FillHeader  &  \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:findhostfunction} & FindHostFunction  &  \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:findhostobjecttype} & FindHostObjectType  &  \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:findhostrttitype} & FindHostRTTIType  &  \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:findlibraryconstant} & FindLibraryConstant  &  \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:findlibraryproperty} & FindLibraryProperty  &  \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:findpublicfunction} & FindPublicFunction  & Return public function. \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:indexofpublicfunction} & IndexOfPublicFunction  & Return index of public function. \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:internalloadfromstream} & InternalLoadFromStream  &  \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:internalsavetostream} & InternalSaveToStream  &  \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:istypecompatible} & IsTypeCompatible  & Move to private? \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:istypeoperationavailable} & IsTypeOperationAvailable  & Move to private? \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:loadfromstream} & LoadFromStream  & Load module from stream \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:savetostream} & SaveToStream  & Save module in a binary format. \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthoriummodule:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriummodule:compiled} & Compiled & r & Whether the module is ready for use. \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:compress} & Compress & rw & Whether to compress the data. \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:instructioncount} & InstructionCount & r & Amount of instructions. \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:lastcompilererror} & LastCompilerError & r & Last compiler error. \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:librarystring} & LibraryString & r & Access to library strings. \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:librarystringcount} & LibraryStringCount & r & Amount of library'd strings \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:name} & Name & r & Name of the module. \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:optimizedinstructions} & OptimizedInstructions & r & Amount of removed instructions. \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:publicfunction} & PublicFunction & r & Access to public functions. \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:publicfunctioncount} & PublicFunctionCount & r & Amount of public functions. \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:publicvariable} & PublicVariable & r & Access to public variables \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:publicvariablecount} & PublicVariableCount & r & Amount of public variables. \\
\pageref{thoriumcorepkg:thorium:tthoriummodule:thorium} & Thorium & r & Owning thorium engine. \\
\hline
\end{tabularx}
% TThoriumModule.Create
\subsection{TThoriumModule.Create}
\label{thoriumcorepkg:thorium:tthoriummodule:create}
\index{TThoriumModule.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create(AThorium: TThorium);  Virtual
constructor Create(AThorium: TThorium;AName: String)
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumModule.Destroy
\subsection{TThoriumModule.Destroy}
\label{thoriumcorepkg:thorium:tthoriummodule:destroy}
\index{TThoriumModule.Destroy}
\begin{FPCList}
\Declaration 

\begin{verbatim}
destructor Destroy;  Override
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumModule.CalcHash
\subsection{TThoriumModule.CalcHash}
\label{thoriumcorepkg:thorium:tthoriummodule:calchash}
\index{TThoriumModule.CalcHash}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure CalcHash;  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumModule.FillHeader
\subsection{TThoriumModule.FillHeader}
\label{thoriumcorepkg:thorium:tthoriummodule:fillheader}
\index{TThoriumModule.FillHeader}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure FillHeader(out Header: TThoriumModuleHeader);  Virtual
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumModule.FindHostFunction
\subsection{TThoriumModule.FindHostFunction}
\label{thoriumcorepkg:thorium:tthoriummodule:findhostfunction}
\index{TThoriumModule.FindHostFunction}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function FindHostFunction(const AName: String)
                          : TThoriumHostFunctionBase
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumModule.FindHostObjectType
\subsection{TThoriumModule.FindHostObjectType}
\label{thoriumcorepkg:thorium:tthoriummodule:findhostobjecttype}
\index{TThoriumModule.FindHostObjectType}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function FindHostObjectType(const AName: String)
                            : TThoriumHostObjectType
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumModule.FindHostRTTIType
\subsection{TThoriumModule.FindHostRTTIType}
\label{thoriumcorepkg:thorium:tthoriummodule:findhostrttitype}
\index{TThoriumModule.FindHostRTTIType}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function FindHostRTTIType(const AName: String) : TThoriumRTTIObjectType
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumModule.FindLibraryConstant
\subsection{TThoriumModule.FindLibraryConstant}
\label{thoriumcorepkg:thorium:tthoriummodule:findlibraryconstant}
\index{TThoriumModule.FindLibraryConstant}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function FindLibraryConstant(const AName: String)
                             : TThoriumLibraryConstant
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumModule.FindLibraryProperty
\subsection{TThoriumModule.FindLibraryProperty}
\label{thoriumcorepkg:thorium:tthoriummodule:findlibraryproperty}
\index{TThoriumModule.FindLibraryProperty}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function FindLibraryProperty(const AName: String)
                             : TThoriumLibraryProperty
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumModule.InternalLoadFromStream
\subsection{TThoriumModule.InternalLoadFromStream}
\label{thoriumcorepkg:thorium:tthoriummodule:internalloadfromstream}
\index{TThoriumModule.InternalLoadFromStream}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure InternalLoadFromStream(Stream: TStream;
                                const Header: TThoriumModuleHeader)
                                ;  Virtual
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumModule.InternalSaveToStream
\subsection{TThoriumModule.InternalSaveToStream}
\label{thoriumcorepkg:thorium:tthoriummodule:internalsavetostream}
\index{TThoriumModule.InternalSaveToStream}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure InternalSaveToStream(Stream: TStream;
                              const Header: TThoriumModuleHeader)
                              ;  Virtual
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumModule.CompileFromStream
\subsection{TThoriumModule.CompileFromStream}
\label{thoriumcorepkg:thorium:tthoriummodule:compilefromstream}
\index{TThoriumModule.CompileFromStream}
\begin{FPCList}
\Synopsis
Compile Thorium script source code.\Declaration 

\begin{verbatim}
function CompileFromStream(SourceStream: TStream;
                          Flags: TThoriumCompilerFlags) : Boolean
\end{verbatim}
\Visibility
public
\Description
This method clears the whole module and tries to compile the code delivered with SourceStream using the Flags passed as second parameter. It returns whether the compilation was successful or not. In the latter case, the module is cleared again to bring it in a stable state. \end{FPCList}
% TThoriumModule.Dump
\subsection{TThoriumModule.Dump}
\label{thoriumcorepkg:thorium:tthoriummodule:dump}
\index{TThoriumModule.Dump}
\begin{FPCList}
\Synopsis
Dump information to console\Declaration 

\begin{verbatim}
procedure Dump
\end{verbatim}
\Visibility
public
\Description
This dumps a lot of information about the module to stdout, like the whole instruction array, exports and dependencies.\end{FPCList}
% TThoriumModule.DumpCodeStr
\subsection{TThoriumModule.DumpCodeStr}
\label{thoriumcorepkg:thorium:tthoriummodule:dumpcodestr}
\index{TThoriumModule.DumpCodeStr}
\begin{FPCList}
\Synopsis
Format instructions and return string.\Declaration 

\begin{verbatim}
function DumpCodeStr : String
\end{verbatim}
\Visibility
public
\Description
This puts the instructions of the module in a more or less human readable form and returns them as a string predestined to be printed to a console.\end{FPCList}
% TThoriumModule.DumpLibStr
\subsection{TThoriumModule.DumpLibStr}
\label{thoriumcorepkg:thorium:tthoriummodule:dumplibstr}
\index{TThoriumModule.DumpLibStr}
\begin{FPCList}
\Synopsis
Format library and return string.\Declaration 

\begin{verbatim}
function DumpLibStr : String
\end{verbatim}
\Visibility
public
\Description
This formats the string library in a human readable format and returns it as a string.\end{FPCList}
% TThoriumModule.ExecuteMain
\subsection{TThoriumModule.ExecuteMain}
\label{thoriumcorepkg:thorium:tthoriummodule:executemain}
\index{TThoriumModule.ExecuteMain}
\begin{FPCList}
\Synopsis
Deprecated?\Declaration 

\begin{verbatim}
procedure ExecuteMain
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumModule.FindPublicFunction
\subsection{TThoriumModule.FindPublicFunction}
\label{thoriumcorepkg:thorium:tthoriummodule:findpublicfunction}
\index{TThoriumModule.FindPublicFunction}
\begin{FPCList}
\Synopsis
Return public function.\Declaration 

\begin{verbatim}
function FindPublicFunction(const AName: String) : TThoriumFunction
\end{verbatim}
\Visibility
public
\Description
Searches for a public function with the given name in the module and returns it if found or nil if not.\end{FPCList}
% TThoriumModule.IndexOfPublicFunction
\subsection{TThoriumModule.IndexOfPublicFunction}
\label{thoriumcorepkg:thorium:tthoriummodule:indexofpublicfunction}
\index{TThoriumModule.IndexOfPublicFunction}
\begin{FPCList}
\Synopsis
Return index of public function.\Declaration 

\begin{verbatim}
function IndexOfPublicFunction(const AName: String) : Integer
\end{verbatim}
\Visibility
public
\Description
Searches for a public function with the given name in the module and returns its index if found or -1 if not.\end{FPCList}
% TThoriumModule.IsTypeCompatible
\subsection{TThoriumModule.IsTypeCompatible}
\label{thoriumcorepkg:thorium:tthoriummodule:istypecompatible}
\index{TThoriumModule.IsTypeCompatible}
\begin{FPCList}
\Synopsis
Move to private?\Declaration 

\begin{verbatim}
function IsTypeCompatible(Value1: TThoriumType;Value2: TThoriumType;
                         Operation: TThoriumOperation;
                         out ResultType: TThoriumType) : Boolean
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumModule.IsTypeOperationAvailable
\subsection{TThoriumModule.IsTypeOperationAvailable}
\label{thoriumcorepkg:thorium:tthoriummodule:istypeoperationavailable}
\index{TThoriumModule.IsTypeOperationAvailable}
\begin{FPCList}
\Synopsis
Move to private?\Declaration 

\begin{verbatim}
function IsTypeOperationAvailable(Value: TThoriumType;
                                 Operation: TThoriumOperation;
                                 out ResultType: TThoriumType) : Boolean
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumModule.LoadFromStream
\subsection{TThoriumModule.LoadFromStream}
\label{thoriumcorepkg:thorium:tthoriummodule:loadfromstream}
\index{TThoriumModule.LoadFromStream}
\begin{FPCList}
\Synopsis
Load module from stream\Declaration 

\begin{verbatim}
procedure LoadFromStream(Stream: TStream)
\end{verbatim}
\Visibility
public
\Description
This method loads a whole module from a stream. It is assumed that the module is in the binary format SaveToStream generates. References to other modules, libraries, types, methods or functions have been encoded and are decoded by this method and verified. If any verification fails, this method throws an exception and leaves the module in an empty state.\end{FPCList}
% TThoriumModule.SaveToStream
\subsection{TThoriumModule.SaveToStream}
\label{thoriumcorepkg:thorium:tthoriummodule:savetostream}
\index{TThoriumModule.SaveToStream}
\begin{FPCList}
\Synopsis
Save module in a binary format.\Declaration 

\begin{verbatim}
procedure SaveToStream(Stream: TStream)
\end{verbatim}
\Visibility
public
\Description
This method saves the complete module in a binary format. References to other modules, libraries, functions and types are encoded so that they can be verifiered when loading the module again. If compression is enabled and supported, the module instructions will be compressed using the zlib library.\end{FPCList}
% TThoriumModule.Compiled
\subsection{TThoriumModule.Compiled}
\label{thoriumcorepkg:thorium:tthoriummodule:compiled}
\index{TThoriumModule.Compiled}
\begin{FPCList}
\Synopsis
Whether the module is ready for use.\Declaration 

\begin{verbatim}
Property Compiled : Boolean
\end{verbatim}
\Visibility
public
\Access
Read
\Description
This property shows whether the module is ready for use - i.e. has been compiled or loaded from a binary.\end{FPCList}
% TThoriumModule.Compress
\subsection{TThoriumModule.Compress}
\label{thoriumcorepkg:thorium:tthoriummodule:compress}
\index{TThoriumModule.Compress}
\begin{FPCList}
\Synopsis
Whether to compress the data.\Declaration 

\begin{verbatim}
Property Compress : Boolean
\end{verbatim}
\Visibility
public
\Access
Read,Write
\Description
This switch defines whether the module will be compressed when it gets saved to a stream. Since the Thorium instructions are optimized for speed rather than size they contain a lot of unused space and zeros, which can be very good compressed by the zlib algorithm.\end{FPCList}
% TThoriumModule.InstructionCount
\subsection{TThoriumModule.InstructionCount}
\label{thoriumcorepkg:thorium:tthoriummodule:instructioncount}
\index{TThoriumModule.InstructionCount}
\begin{FPCList}
\Synopsis
Amount of instructions.\Declaration 

\begin{verbatim}
Property InstructionCount : Integer
\end{verbatim}
\Visibility
public
\Access
Read
\Description
The amount of instructions in this module.\end{FPCList}
% TThoriumModule.LastCompilerError
\subsection{TThoriumModule.LastCompilerError}
\label{thoriumcorepkg:thorium:tthoriummodule:lastcompilererror}
\index{TThoriumModule.LastCompilerError}
\begin{FPCList}
\Synopsis
Last compiler error.\Declaration 

\begin{verbatim}
Property LastCompilerError : String
\end{verbatim}
\Visibility
public
\Access
Read
\Description
This is the last error thrown by the compiler. Only set to anything else than an empty string if compilation failed at least once.\end{FPCList}
% TThoriumModule.LibraryString
\subsection{TThoriumModule.LibraryString}
\label{thoriumcorepkg:thorium:tthoriummodule:librarystring}
\index{TThoriumModule.LibraryString}
\begin{FPCList}
\Synopsis
Access to library strings.\Declaration 

\begin{verbatim}
Property LibraryString[Index: Integer]: String
\end{verbatim}
\Visibility
public
\Access
Read
\Description
Constant strings which occur in the source code of Thorium scripts are saved in a so called library. Access to those from the instructions is then only handled by indicies to speed things up. You can access the strings stored in the library using this property.\end{FPCList}
% TThoriumModule.LibraryStringCount
\subsection{TThoriumModule.LibraryStringCount}
\label{thoriumcorepkg:thorium:tthoriummodule:librarystringcount}
\index{TThoriumModule.LibraryStringCount}
\begin{FPCList}
\Synopsis
Amount of library'd strings\Declaration 

\begin{verbatim}
Property LibraryStringCount : Integer
\end{verbatim}
\Visibility
public
\Access
Read
\Description
This is the amount of strings contained in the module library. See TThoriumModule.LibraryString (\pageref{thoriumcorepkg:thorium:tthoriummodule:librarystring})LibraryString\end{FPCList}
% TThoriumModule.Name
\subsection{TThoriumModule.Name}
\label{thoriumcorepkg:thorium:tthoriummodule:name}
\index{TThoriumModule.Name}
\begin{FPCList}
\Synopsis
Name of the module.\Declaration 

\begin{verbatim}
Property Name : String
\end{verbatim}
\Visibility
public
\Access
Read
\Description
The name of the module under which it can also be referenced in other modules.\end{FPCList}
% TThoriumModule.OptimizedInstructions
\subsection{TThoriumModule.OptimizedInstructions}
\label{thoriumcorepkg:thorium:tthoriummodule:optimizedinstructions}
\index{TThoriumModule.OptimizedInstructions}
\begin{FPCList}
\Synopsis
Amount of removed instructions.\Declaration 

\begin{verbatim}
Property OptimizedInstructions : LongInt
\end{verbatim}
\Visibility
public
\Access
Read
\Description
This is the amount of instructions which have been removed by the internal optimizer of Thorium. The optimizer makes patterns which are known to be created by the compiler or certain code phrases more performant (and sometimes, it even breaks the whole code :) ).\end{FPCList}
% TThoriumModule.PublicFunction
\subsection{TThoriumModule.PublicFunction}
\label{thoriumcorepkg:thorium:tthoriummodule:publicfunction}
\index{TThoriumModule.PublicFunction}
\begin{FPCList}
\Synopsis
Access to public functions.\Declaration 

\begin{verbatim}
Property PublicFunction[Index: Integer]: TThoriumFunction
\end{verbatim}
\Visibility
public
\Access
Read
\Description
Using this property one can access the public functions declared in the module. The amount of published functions can be queried using TThoriumModule.PublicFunctionCount (\pageref{thoriumcorepkg:thorium:tthoriummodule:publicfunctioncount})PublicFunctionCount\end{FPCList}
% TThoriumModule.PublicFunctionCount
\subsection{TThoriumModule.PublicFunctionCount}
\label{thoriumcorepkg:thorium:tthoriummodule:publicfunctioncount}
\index{TThoriumModule.PublicFunctionCount}
\begin{FPCList}
\Synopsis
Amount of public functions.\Declaration 

\begin{verbatim}
Property PublicFunctionCount : Integer
\end{verbatim}
\Visibility
public
\Access
Read
\Description
This is the amount of public functions declared in this module.\end{FPCList}
% TThoriumModule.PublicVariable
\subsection{TThoriumModule.PublicVariable}
\label{thoriumcorepkg:thorium:tthoriummodule:publicvariable}
\index{TThoriumModule.PublicVariable}
\begin{FPCList}
\Synopsis
Access to public variables\Declaration 

\begin{verbatim}
Property PublicVariable[Index: Integer]: TThoriumVariable
\end{verbatim}
\Visibility
public
\Access
Read
\Description
This property provides access to variables made public by the module.\end{FPCList}
% TThoriumModule.PublicVariableCount
\subsection{TThoriumModule.PublicVariableCount}
\label{thoriumcorepkg:thorium:tthoriummodule:publicvariablecount}
\index{TThoriumModule.PublicVariableCount}
\begin{FPCList}
\Synopsis
Amount of public variables.\Declaration 

\begin{verbatim}
Property PublicVariableCount : Integer
\end{verbatim}
\Visibility
public
\Access
Read
\Description
This property reflects the amount of variables which have been made public by the module.\end{FPCList}
% TThoriumModule.Thorium
\subsection{TThoriumModule.Thorium}
\label{thoriumcorepkg:thorium:tthoriummodule:thorium}
\index{TThoriumModule.Thorium}
\begin{FPCList}
\Synopsis
Owning thorium engine.\Declaration 

\begin{verbatim}
Property Thorium : TThorium
\end{verbatim}
\Visibility
public
\Access
Read
\Description
The Thorium engine which owns the module.\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumParameters
\section{TThoriumParameters}
\label{thoriumcorepkg:thorium:tthoriumparameters}
\index{TThoriumParameters}
% Description
\subsection{Description}
This class is a container class to hold a list of Thorium types. It is used as parameter list in function specifications of Thorium functions. For host environment functions there is a separate class.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumparameters:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumparameters:addparameter} & AddParameter  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumparameters:clear} & Clear  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumparameters:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumparameters:destroy} & Destroy  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumparameters:duplicate} & Duplicate  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumparameters:getparameterspec} & GetParameterSpec  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumparameters:loadfromstream} & LoadFromStream  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumparameters:removeparameter} & RemoveParameter  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumparameters:savetostream} & SaveToStream  &  \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthoriumparameters:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumparameters:count} & Count & r &  \\
\hline
\end{tabularx}
% TThoriumParameters.Create
\subsection{TThoriumParameters.Create}
\label{thoriumcorepkg:thorium:tthoriumparameters:create}
\index{TThoriumParameters.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumParameters.Destroy
\subsection{TThoriumParameters.Destroy}
\label{thoriumcorepkg:thorium:tthoriumparameters:destroy}
\index{TThoriumParameters.Destroy}
\begin{FPCList}
\Declaration 

\begin{verbatim}
destructor Destroy;  Override
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumParameters.AddParameter
\subsection{TThoriumParameters.AddParameter}
\label{thoriumcorepkg:thorium:tthoriumparameters:addparameter}
\index{TThoriumParameters.AddParameter}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function AddParameter : PThoriumType
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumParameters.Clear
\subsection{TThoriumParameters.Clear}
\label{thoriumcorepkg:thorium:tthoriumparameters:clear}
\index{TThoriumParameters.Clear}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure Clear
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumParameters.RemoveParameter
\subsection{TThoriumParameters.RemoveParameter}
\label{thoriumcorepkg:thorium:tthoriumparameters:removeparameter}
\index{TThoriumParameters.RemoveParameter}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure RemoveParameter(const Index: Integer)
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumParameters.Duplicate
\subsection{TThoriumParameters.Duplicate}
\label{thoriumcorepkg:thorium:tthoriumparameters:duplicate}
\index{TThoriumParameters.Duplicate}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function Duplicate : TThoriumParameters
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumParameters.GetParameterSpec
\subsection{TThoriumParameters.GetParameterSpec}
\label{thoriumcorepkg:thorium:tthoriumparameters:getparameterspec}
\index{TThoriumParameters.GetParameterSpec}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure GetParameterSpec(const Index: Integer;
                          out ParamSpec: TThoriumType)
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumParameters.LoadFromStream
\subsection{TThoriumParameters.LoadFromStream}
\label{thoriumcorepkg:thorium:tthoriumparameters:loadfromstream}
\index{TThoriumParameters.LoadFromStream}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure LoadFromStream(Stream: TStream)
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumParameters.SaveToStream
\subsection{TThoriumParameters.SaveToStream}
\label{thoriumcorepkg:thorium:tthoriumparameters:savetostream}
\index{TThoriumParameters.SaveToStream}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure SaveToStream(Stream: TStream)
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumParameters.Count
\subsection{TThoriumParameters.Count}
\label{thoriumcorepkg:thorium:tthoriumparameters:count}
\index{TThoriumParameters.Count}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property Count : Integer
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumPersistent
\section{TThoriumPersistent}
\label{thoriumcorepkg:thorium:tthoriumpersistent}
\index{TThoriumPersistent}
% Description
\subsection{Description}
The easiest way to publish a class to Thorium is deriving it from TThoriumPersistent. This keeps you from building your own implementation of the methods specified in the IThoriumPersistent (\pageref{thoriumcorepkg:thorium:ithoriumpersistent}) interface. % Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumpersistent:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumpersistent:addref} & $\backslash$\_AddRef  & Increase reference count. \\
\pageref{thoriumcorepkg:thorium:tthoriumpersistent:release} & $\backslash$\_Release  & Decrease reference count. \\
\pageref{thoriumcorepkg:thorium:tthoriumpersistent:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumpersistent:disablehostcontrol} & DisableHostControl  & Unset the host controlled flag. \\
\pageref{thoriumcorepkg:thorium:tthoriumpersistent:enablehostcontrol} & EnableHostControl  & Set the host controlled flag \\
\pageref{thoriumcorepkg:thorium:tthoriumpersistent:freereference} & FreeReference  & Release a reference. \\
\pageref{thoriumcorepkg:thorium:tthoriumpersistent:getmethodlist} & GetMethodList  & Determine method list. \\
\pageref{thoriumcorepkg:thorium:tthoriumpersistent:getreference} & GetReference  & Increase the reference counter and return the instance. \\
\pageref{thoriumcorepkg:thorium:tthoriumpersistent:getreferencecount} & GetReferenceCount  & Get the amount of references. \\
\pageref{thoriumcorepkg:thorium:tthoriumpersistent:getstaticmethodlist} & GetStaticMethodList  & Determine the list of static methods. \\
\pageref{thoriumcorepkg:thorium:tthoriumpersistent:queryinterface} & QueryInterface  & Query for an interface. \\
\hline
\end{tabularx}
% TThoriumPersistent.Create
\subsection{TThoriumPersistent.Create}
\label{thoriumcorepkg:thorium:tthoriumpersistent:create}
\index{TThoriumPersistent.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumPersistent.FreeReference
\subsection{TThoriumPersistent.FreeReference}
\label{thoriumcorepkg:thorium:tthoriumpersistent:freereference}
\index{TThoriumPersistent.FreeReference}
\begin{FPCList}
\Synopsis
Release a reference.\Declaration 

\begin{verbatim}
procedure FreeReference
\end{verbatim}
\Visibility
public
\Description
Decreases the reference counter by one and, if applicable, frees the instance.\SeeAlso
TThoriumPersistent.GetReference (\pageref{thoriumcorepkg:thorium:tthoriumpersistent:getreference}),
TThoriumPersistent.\_Release (\pageref{thoriumcorepkg:thorium:tthoriumpersistent:release})\end{FPCList}
% TThoriumPersistent._AddRef
\subsection{TThoriumPersistent.\_AddRef}
\label{thoriumcorepkg:thorium:tthoriumpersistent:addref}
\index{TThoriumPersistent.\_AddRef}
\begin{FPCList}
\Synopsis
Increase reference count.\Declaration 

\begin{verbatim}
function _AddRef : LongInt
\end{verbatim}
\Visibility
protected
\Description
IUnknown implementation to increase the reference counter of the instance.\SeeAlso
TThoriumPersistent.GetReference (\pageref{thoriumcorepkg:thorium:tthoriumpersistent:getreference}),
TThoriumPersistent.\_Release (\pageref{thoriumcorepkg:thorium:tthoriumpersistent:release})\end{FPCList}
% TThoriumPersistent._Release
\subsection{TThoriumPersistent.\_Release}
\label{thoriumcorepkg:thorium:tthoriumpersistent:release}
\index{TThoriumPersistent.\_Release}
\begin{FPCList}
\Synopsis
Decrease reference count.\Declaration 

\begin{verbatim}
function _Release : LongInt
\end{verbatim}
\Visibility
protected
\Description
IUnknown implementation to decrease the reference counter.\SeeAlso
TThoriumPersistent.FreeReference (\pageref{thoriumcorepkg:thorium:tthoriumpersistent:freereference}),
TThoriumPersistent.\_AddRef (\pageref{thoriumcorepkg:thorium:tthoriumpersistent:addref})\end{FPCList}
% TThoriumPersistent.QueryInterface
\subsection{TThoriumPersistent.QueryInterface}
\label{thoriumcorepkg:thorium:tthoriumpersistent:queryinterface}
\index{TThoriumPersistent.QueryInterface}
\begin{FPCList}
\Synopsis
Query for an interface.\Declaration 

\begin{verbatim}
function QueryInterface(const IID: TGuid;out Obj) : LongInt
\end{verbatim}
\Visibility
protected
\Description
Default implementation of QueryInterface from IUnknown.\end{FPCList}
% TThoriumPersistent.GetStaticMethodList
\subsection{TThoriumPersistent.GetStaticMethodList}
\label{thoriumcorepkg:thorium:tthoriumpersistent:getstaticmethodlist}
\index{TThoriumPersistent.GetStaticMethodList}
\begin{FPCList}
\Synopsis
Determine the list of static methods.\Declaration 

\begin{verbatim}
procedure GetStaticMethodList(Sender: TThoriumRTTIObjectType;
                             var Methods: TThoriumRTTIStaticMethods)
                             ;  Virtual
\end{verbatim}
\Visibility
protected
\Description
This is called by the constructor of an TThoriumRTTIObjectType (\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype}) instance to fetch the list of static methods a class type supports. You should pass the entries in the array given.\SeeAlso
TThoriumPersistent.GetMethodList (\pageref{thoriumcorepkg:thorium:tthoriumpersistent:getmethodlist}),
TThoriumRTTIObjectType (\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype})\end{FPCList}
% TThoriumPersistent.GetMethodList
\subsection{TThoriumPersistent.GetMethodList}
\label{thoriumcorepkg:thorium:tthoriumpersistent:getmethodlist}
\index{TThoriumPersistent.GetMethodList}
\begin{FPCList}
\Synopsis
Determine method list.\Declaration 

\begin{verbatim}
procedure GetMethodList(Sender: TThoriumRTTIObjectType;
                       var Methods: TThoriumRTTIMethods);  Virtual
\end{verbatim}
\Visibility
protected
\Description
This method is called by the constructor of a TThoriumRTTIObjectType (\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype}) instance to determine which methods are to be published by the class. The methods are to be written to the dynamic array passed.\SeeAlso
TThoriumPersistent.GetStaticMethodList (\pageref{thoriumcorepkg:thorium:tthoriumpersistent:getstaticmethodlist}),
TThoriumRTTIObjectType (\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype})\end{FPCList}
% TThoriumPersistent.EnableHostControl
\subsection{TThoriumPersistent.EnableHostControl}
\label{thoriumcorepkg:thorium:tthoriumpersistent:enablehostcontrol}
\index{TThoriumPersistent.EnableHostControl}
\begin{FPCList}
\Synopsis
Set the host controlled flag\Declaration 

\begin{verbatim}
procedure EnableHostControl
\end{verbatim}
\Visibility
public
\Description
Sets the instance to be host controlled. This wants to say that it will never be freed when the reference counter reaches zero. This is for example called when the instance is assigned to a parameter or property which has been flagged as storing.\SeeAlso
TThoriumPersistent.DisableHostControl (\pageref{thoriumcorepkg:thorium:tthoriumpersistent:disablehostcontrol}),
TThoriumHostObjectType.GetPropertyStoring (\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:getpropertystoring})\end{FPCList}
% TThoriumPersistent.DisableHostControl
\subsection{TThoriumPersistent.DisableHostControl}
\label{thoriumcorepkg:thorium:tthoriumpersistent:disablehostcontrol}
\index{TThoriumPersistent.DisableHostControl}
\begin{FPCList}
\Synopsis
Unset the host controlled flag.\Declaration 

\begin{verbatim}
procedure DisableHostControl
\end{verbatim}
\Visibility
public
\Description
Removes the host controlled flag from the instance and thus let it free if the reference counter reaches zero.\SeeAlso
TThoriumPersistent.EnableHostControl (\pageref{thoriumcorepkg:thorium:tthoriumpersistent:enablehostcontrol})\end{FPCList}
% TThoriumPersistent.GetReference
\subsection{TThoriumPersistent.GetReference}
\label{thoriumcorepkg:thorium:tthoriumpersistent:getreference}
\index{TThoriumPersistent.GetReference}
\begin{FPCList}
\Synopsis
Increase the reference counter and return the instance.\Declaration 

\begin{verbatim}
function GetReference : TObject
\end{verbatim}
\Visibility
public
\Description
The method increases the reference counter for this instance and returns the instance too.\SeeAlso
TThoriumPersistent.\_Add (\pageref{thoriumcorepkg:thorium:tthoriumpersistent})\end{FPCList}
% TThoriumPersistent.GetReferenceCount
\subsection{TThoriumPersistent.GetReferenceCount}
\label{thoriumcorepkg:thorium:tthoriumpersistent:getreferencecount}
\index{TThoriumPersistent.GetReferenceCount}
\begin{FPCList}
\Synopsis
Get the amount of references.\Declaration 

\begin{verbatim}
function GetReferenceCount : LongInt
\end{verbatim}
\Visibility
public
\Description
Return the amount of known references to this instance. The virtual reference created by the host controlled flag is not counted.\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumPublicValue
\section{TThoriumPublicValue}
\label{thoriumcorepkg:thorium:tthoriumpublicvalue}
\index{TThoriumPublicValue}
% Description
\subsection{Description}
This is an abstract baseclass to describe identifiers (mostly public) like variables and functions which are declared in a Thorium script.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumpublicvalue:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumpublicvalue:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumpublicvalue:loadfromstream} & LoadFromStream  & Load specification from stream. \\
\pageref{thoriumcorepkg:thorium:tthoriumpublicvalue:savetostream} & SaveToStream  & Save specification to stream. \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthoriumpublicvalue:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumpublicvalue:module} & Module & r & Owning module. \\
\pageref{thoriumcorepkg:thorium:tthoriumpublicvalue:name} & Name & r & Identifier name. \\
\hline
\end{tabularx}
% TThoriumPublicValue.Create
\subsection{TThoriumPublicValue.Create}
\label{thoriumcorepkg:thorium:tthoriumpublicvalue:create}
\index{TThoriumPublicValue.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create(AModule: TThoriumModule);  Virtual
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumPublicValue.LoadFromStream
\subsection{TThoriumPublicValue.LoadFromStream}
\label{thoriumcorepkg:thorium:tthoriumpublicvalue:loadfromstream}
\index{TThoriumPublicValue.LoadFromStream}
\begin{FPCList}
\Synopsis
Load specification from stream.\Declaration 

\begin{verbatim}
procedure LoadFromStream(Stream: TStream);  Virtual
\end{verbatim}
\Visibility
public
\Description
Loads the specification of this identifier from a given stream.\SeeAlso
TThoriumPublicValue.SaveToStream (\pageref{thoriumcorepkg:thorium:tthoriumpublicvalue:savetostream})\end{FPCList}
% TThoriumPublicValue.SaveToStream
\subsection{TThoriumPublicValue.SaveToStream}
\label{thoriumcorepkg:thorium:tthoriumpublicvalue:savetostream}
\index{TThoriumPublicValue.SaveToStream}
\begin{FPCList}
\Synopsis
Save specification to stream.\Declaration 

\begin{verbatim}
procedure SaveToStream(Stream: TStream);  Virtual
\end{verbatim}
\Visibility
public
\Description
Saves the specification of this identifier to a stream. References to other identifiers are declared by using their name and their hash to identify them uniquely.\SeeAlso
TThoriumPublicValue.LoadFromStream (\pageref{thoriumcorepkg:thorium:tthoriumpublicvalue:loadfromstream})\end{FPCList}
% TThoriumPublicValue.Module
\subsection{TThoriumPublicValue.Module}
\label{thoriumcorepkg:thorium:tthoriumpublicvalue:module}
\index{TThoriumPublicValue.Module}
\begin{FPCList}
\Synopsis
Owning module.\Declaration 

\begin{verbatim}
Property Module : TThoriumModule
\end{verbatim}
\Visibility
public
\Access
Read
\Description
The module which owns this identifier.\end{FPCList}
% TThoriumPublicValue.Name
\subsection{TThoriumPublicValue.Name}
\label{thoriumcorepkg:thorium:tthoriumpublicvalue:name}
\index{TThoriumPublicValue.Name}
\begin{FPCList}
\Synopsis
Identifier name.\Declaration 

\begin{verbatim}
Property Name : String
\end{verbatim}
\Visibility
public
\Access
Read
\Description
The name of this identifier.\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumRTTIObjectType
\section{TThoriumRTTIObjectType}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype}
\index{TThoriumRTTIObjectType}
% Description
\subsection{Description}
This uses TThoriumHostObjectType (\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype}) as ancestor class and implements a generic host object type which is used to represent Pascal classes using all available RTTI information. This speciality of the class is hard coded and there are many places in Thorium where special code is used for type instances of this class to assure you do not need to derive a class from this one for each type you want to publish to Thorium.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:calchash} & CalcHash  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:create} & Create  & Create an instance. \\
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:destroy} & Destroy  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:disposevalue} & DisposeValue  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:duplicatevalue} & DuplicateValue  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:fieldid} & FieldID  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:fieldtype} & FieldType  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:findmethod} & FindMethod  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:getfield} & GetField  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:getneededmemoryamount} & GetNeededMemoryAmount  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:getpropertystoring} & GetPropertyStoring  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:hasfields} & HasFields  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:hasindicies} & HasIndicies  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:hasstaticfields} & HasStaticFields  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:istypecompatible} & IsTypeCompatible  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:istypeoperationavailable} & IsTypeOperationAvailable  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:newnativecallmethod} & NewNativeCallMethod  & Helper function. \\
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:newnativecallstaticfunction} & NewNativeCallStaticFunction  & Helper function. \\
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:newnativecallstaticmethod} & NewNativeCallStaticMethod  & Helper function. \\
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:setfield} & SetField  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:setpropertystoring} & SetPropertyStoring  & Set whether a property is storing. \\
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:staticfieldid} & StaticFieldID  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:staticfieldtype} & StaticFieldType  &  \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumrttiobjecttype:baseclass} & BaseClass & r & Class represented by this type. \\
\hline
\end{tabularx}
% TThoriumRTTIObjectType.Create
\subsection{TThoriumRTTIObjectType.Create}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:create}
\index{TThoriumRTTIObjectType.Create}
\begin{FPCList}
\Synopsis
Create an instance.\Declaration 

\begin{verbatim}
constructor Create(ALibrary: TThoriumLibrary);  Override
constructor Create(ALibrary: TThoriumLibrary;
                  ABaseClass: TThoriumPersistentClass;
                  AbstractClass: Boolean)
constructor Create(ALibrary: TThoriumLibrary;ABaseClass: TClass;
                  MethodCallback: TThoriumRTTIMethodsCallback;
                  StaticMethodCallback: TThoriumRTTIStaticMethodsCallback;
                  AbstractClass: Boolean)
\end{verbatim}
\Visibility
default
\Description
You must not use the constructor inherited from the parent class type to create an instance of this class.  To publish a class type to Thorium, you may either derive it from TThoriumPersistent (\pageref{thoriumcorepkg:thorium:tthoriumpersistent}) or implement IThoriumPersistent (\pageref{thoriumcorepkg:thorium:ithoriumpersistent}) interface in it. Depending on which method you choose, you have to choose a different constructor. If you use TThoriumPersistent directly, you should use the first variant of the constructor which expects the class type as its second parameter. Otherwise you must use the second variant and specify the wanted methods accordingly. The first constructor internally calls the second one.  To specify a base class which is unable to be ever instanciated (e.g. when you publish the TStream-class tree, you cannot alter TStream to implement IThoriumPersistent. You would derive a class from those streams you want to have published to Thorium implementing IThoriumPersistent and specify TStream as an abstract class).\end{FPCList}
% TThoriumRTTIObjectType.Destroy
\subsection{TThoriumRTTIObjectType.Destroy}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:destroy}
\index{TThoriumRTTIObjectType.Destroy}
\begin{FPCList}
\Declaration 

\begin{verbatim}
destructor Destroy;  Override
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumRTTIObjectType.GetNeededMemoryAmount
\subsection{TThoriumRTTIObjectType.GetNeededMemoryAmount}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:getneededmemoryamount}
\index{TThoriumRTTIObjectType.GetNeededMemoryAmount}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function GetNeededMemoryAmount : TThoriumSizeInt;  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumRTTIObjectType.DuplicateValue
\subsection{TThoriumRTTIObjectType.DuplicateValue}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:duplicatevalue}
\index{TThoriumRTTIObjectType.DuplicateValue}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function DuplicateValue(const AValue: TThoriumHostObjectTypeValue)
                        : TThoriumValue;  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumRTTIObjectType.DisposeValue
\subsection{TThoriumRTTIObjectType.DisposeValue}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:disposevalue}
\index{TThoriumRTTIObjectType.DisposeValue}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure DisposeValue(var AValue: TThoriumHostObjectTypeValue)
                      ;  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumRTTIObjectType.IsTypeCompatible
\subsection{TThoriumRTTIObjectType.IsTypeCompatible}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:istypecompatible}
\index{TThoriumRTTIObjectType.IsTypeCompatible}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function IsTypeCompatible(const Value1: TThoriumType;
                         const Value2: TThoriumType;
                         const Operation: TThoriumOperation;
                         out ResultType: TThoriumType) : Boolean
                         ;  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumRTTIObjectType.IsTypeOperationAvailable
\subsection{TThoriumRTTIObjectType.IsTypeOperationAvailable}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:istypeoperationavailable}
\index{TThoriumRTTIObjectType.IsTypeOperationAvailable}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function IsTypeOperationAvailable(const Value: TThoriumType;
                                 const Operation: TThoriumOperation;
                                 out ResultType: TThoriumType) : Boolean
                                 ;  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumRTTIObjectType.HasFields
\subsection{TThoriumRTTIObjectType.HasFields}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:hasfields}
\index{TThoriumRTTIObjectType.HasFields}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function HasFields : Boolean;  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumRTTIObjectType.HasStaticFields
\subsection{TThoriumRTTIObjectType.HasStaticFields}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:hasstaticfields}
\index{TThoriumRTTIObjectType.HasStaticFields}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function HasStaticFields : Boolean;  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumRTTIObjectType.HasIndicies
\subsection{TThoriumRTTIObjectType.HasIndicies}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:hasindicies}
\index{TThoriumRTTIObjectType.HasIndicies}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function HasIndicies : Boolean;  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumRTTIObjectType.FindMethod
\subsection{TThoriumRTTIObjectType.FindMethod}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:findmethod}
\index{TThoriumRTTIObjectType.FindMethod}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function FindMethod(const AMethodName: String) : TThoriumHostMethodBase
                   ;  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumRTTIObjectType.CalcHash
\subsection{TThoriumRTTIObjectType.CalcHash}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:calchash}
\index{TThoriumRTTIObjectType.CalcHash}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure CalcHash;  Override
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumRTTIObjectType.FieldID
\subsection{TThoriumRTTIObjectType.FieldID}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:fieldid}
\index{TThoriumRTTIObjectType.FieldID}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function FieldID(const FieldIdent: String;out ID: QWord) : Boolean
                ;  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumRTTIObjectType.StaticFieldID
\subsection{TThoriumRTTIObjectType.StaticFieldID}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:staticfieldid}
\index{TThoriumRTTIObjectType.StaticFieldID}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function StaticFieldID(const FieldIdent: String;out ID: QWord) : Boolean
                      ;  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumRTTIObjectType.FieldType
\subsection{TThoriumRTTIObjectType.FieldType}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:fieldtype}
\index{TThoriumRTTIObjectType.FieldType}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function FieldType(const AFieldID: QWord;
                  out ResultType: TThoriumTableEntry) : Boolean
                  ;  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumRTTIObjectType.StaticFieldType
\subsection{TThoriumRTTIObjectType.StaticFieldType}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:staticfieldtype}
\index{TThoriumRTTIObjectType.StaticFieldType}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function StaticFieldType(const AFieldID: QWord;
                        out ResultType: TThoriumTableEntry) : Boolean
                        ;  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumRTTIObjectType.GetField
\subsection{TThoriumRTTIObjectType.GetField}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:getfield}
\index{TThoriumRTTIObjectType.GetField}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function GetField(const AInstance: TThoriumValue;const AFieldID: QWord)
                  : TThoriumValue;  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumRTTIObjectType.SetField
\subsection{TThoriumRTTIObjectType.SetField}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:setfield}
\index{TThoriumRTTIObjectType.SetField}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure SetField(const AInstance: TThoriumValue;const AFieldID: QWord;
                  const NewValue: TThoriumValue);  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumRTTIObjectType.GetPropertyStoring
\subsection{TThoriumRTTIObjectType.GetPropertyStoring}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:getpropertystoring}
\index{TThoriumRTTIObjectType.GetPropertyStoring}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function GetPropertyStoring(const PropertyName: String) : Boolean
function GetPropertyStoring(const PropInfo: PPropInfo) : Boolean
function GetPropertyStoring(const AFieldID: QWord) : Boolean;  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumRTTIObjectType.SetPropertyStoring
\subsection{TThoriumRTTIObjectType.SetPropertyStoring}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:setpropertystoring}
\index{TThoriumRTTIObjectType.SetPropertyStoring}
\begin{FPCList}
\Synopsis
Set whether a property is storing.\Declaration 

\begin{verbatim}
procedure SetPropertyStoring(const PropertyName: String;
                            IsStoring: Boolean)
procedure SetPropertyStoring(const PropInfo: PPropInfo;
                            IsStoring: Boolean)
\end{verbatim}
\Visibility
public
\Description
Using these methods you can set the storing bit of any property of the class represented by this type implementation. For more infos about the storing bit see TThoriumHostObjectType.GetPropertyStoring (\pageref{thoriumcorepkg:thorium:tthoriumhostobjecttype:getpropertystoring}).\end{FPCList}
% TThoriumRTTIObjectType.NewNativeCallMethod
\subsection{TThoriumRTTIObjectType.NewNativeCallMethod}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:newnativecallmethod}
\index{TThoriumRTTIObjectType.NewNativeCallMethod}
\begin{FPCList}
\Synopsis
Helper function.\Declaration 

\begin{verbatim}
function NewNativeCallMethod(const AName: String;
                            const ACodePointer: Pointer;
                            const AParameters: Array of TThoriumHostType;
                            const AReturnType: TThoriumHostType;
                            const ACallingConvention: TThoriumNativeCallingConvention)
                             : TThoriumHostMethodNativeCall
\end{verbatim}
\Visibility
public
\Description
This is an helper function which creates a new instance of a native call method. The instance is returned, but not registered with the type. This is to be used in the callbacks given to the constructor or in the methods which determine the methods published by a type in TThoriumPersistent (\pageref{thoriumcorepkg:thorium:tthoriumpersistent}).\end{FPCList}
% TThoriumRTTIObjectType.NewNativeCallStaticMethod
\subsection{TThoriumRTTIObjectType.NewNativeCallStaticMethod}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:newnativecallstaticmethod}
\index{TThoriumRTTIObjectType.NewNativeCallStaticMethod}
\begin{FPCList}
\Synopsis
Helper function.\Declaration 

\begin{verbatim}
function NewNativeCallStaticMethod(const AName: String;
                                  const ACodePointer: Pointer;
                                  const ADataPointer: Pointer;
                                  const AParameters: Array of TThoriumHostType;
                                  const AReturnType: TThoriumHostType;
                                  const ACallingConvention: TThoriumNativeCallingConvention)
                                   : TThoriumHostMethodAsFunctionNativeCall
\end{verbatim}
\Visibility
public
\Description
This is an helper function which creates a new instance of a native call static (= class) method. The instance is returned, but not registered with the type. This is to be used in the callbacks given to the constructor or in the methods which determine the methods published by a type in TThoriumPersistent (\pageref{thoriumcorepkg:thorium:tthoriumpersistent}).\end{FPCList}
% TThoriumRTTIObjectType.NewNativeCallStaticFunction
\subsection{TThoriumRTTIObjectType.NewNativeCallStaticFunction}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:newnativecallstaticfunction}
\index{TThoriumRTTIObjectType.NewNativeCallStaticFunction}
\begin{FPCList}
\Synopsis
Helper function.\Declaration 

\begin{verbatim}
function NewNativeCallStaticFunction(const AName: String;
                                    const ACodePointer: Pointer;
                                    const AParameters: Array of TThoriumHostType;
                                    const AReturnType: TThoriumHostType;
                                    const ACallingConvention: TThoriumNativeCallingConvention)
                                     : TThoriumHostFunctionNativeCall
\end{verbatim}
\Visibility
public
\Description
This is an helper function which creates a new instance of a native call function. The instance is returned, but not registered with the type. This is to be used in the callbacks given to the constructor or in the methods which determine the methods published by a type in TThoriumPersistent (\pageref{thoriumcorepkg:thorium:tthoriumpersistent}).\end{FPCList}
% TThoriumRTTIObjectType.BaseClass
\subsection{TThoriumRTTIObjectType.BaseClass}
\label{thoriumcorepkg:thorium:tthoriumrttiobjecttype:baseclass}
\index{TThoriumRTTIObjectType.BaseClass}
\begin{FPCList}
\Synopsis
Class represented by this type.\Declaration 

\begin{verbatim}
Property BaseClass : TClass
\end{verbatim}
\Visibility
public
\Access
Read
\Description
This is the class which is represented by this type.\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumScanner
\section{TThoriumScanner}
\label{thoriumcorepkg:thorium:tthoriumscanner}
\index{TThoriumScanner}
% Description
\subsection{Description}
Class for internal use - to be described later.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumscanner:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumscanner:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumscanner:destroy} & Destroy  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumscanner:scanforsymbol} & ScanForSymbol  &  \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthoriumscanner:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumscanner:currentline} & CurrentLine & r &  \\
\pageref{thoriumcorepkg:thorium:tthoriumscanner:currentstr} & CurrentStr & r &  \\
\pageref{thoriumcorepkg:thorium:tthoriumscanner:currentsym} & CurrentSym & r &  \\
\hline
\end{tabularx}
% TThoriumScanner.Create
\subsection{TThoriumScanner.Create}
\label{thoriumcorepkg:thorium:tthoriumscanner:create}
\index{TThoriumScanner.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create(AInputString: String)
constructor Create(AInputStream: TStream)
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumScanner.Destroy
\subsection{TThoriumScanner.Destroy}
\label{thoriumcorepkg:thorium:tthoriumscanner:destroy}
\index{TThoriumScanner.Destroy}
\begin{FPCList}
\Declaration 

\begin{verbatim}
destructor Destroy;  Override
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumScanner.ScanForSymbol
\subsection{TThoriumScanner.ScanForSymbol}
\label{thoriumcorepkg:thorium:tthoriumscanner:scanforsymbol}
\index{TThoriumScanner.ScanForSymbol}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure ScanForSymbol(var Sym: TThoriumSymbol;var Str: String)
\end{verbatim}
\Visibility
protected
\end{FPCList}
% TThoriumScanner.CurrentSym
\subsection{TThoriumScanner.CurrentSym}
\label{thoriumcorepkg:thorium:tthoriumscanner:currentsym}
\index{TThoriumScanner.CurrentSym}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property CurrentSym : TThoriumSymbol
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
% TThoriumScanner.CurrentStr
\subsection{TThoriumScanner.CurrentStr}
\label{thoriumcorepkg:thorium:tthoriumscanner:currentstr}
\index{TThoriumScanner.CurrentStr}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property CurrentStr : String
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
% TThoriumScanner.CurrentLine
\subsection{TThoriumScanner.CurrentLine}
\label{thoriumcorepkg:thorium:tthoriumscanner:currentline}
\index{TThoriumScanner.CurrentLine}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property CurrentLine : Integer
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumStack
\section{TThoriumStack}
\label{thoriumcorepkg:thorium:tthoriumstack}
\index{TThoriumStack}
% Description
\subsection{Description}
Class for internal use - to be described later.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumstack:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumstack:clearstack} & ClearStack  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumstack:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumstack:destroy} & Destroy  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumstack:fastgetstackentry} & FastGetStackEntry  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumstack:gettop} & GetTop  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumstack:gettopstackentry} & GetTopStackEntry  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumstack:pop} & Pop  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumstack:poptop} & PopTop  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumstack:prealloc} & Prealloc  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumstack:push} & Push  &  \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthoriumstack:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumstack:capacity} & Capacity & rw &  \\
\pageref{thoriumcorepkg:thorium:tthoriumstack:entrycount} & EntryCount & r &  \\
\pageref{thoriumcorepkg:thorium:tthoriumstack:stackentry} & StackEntry & r &  \\
\hline
\end{tabularx}
% TThoriumStack.Create
\subsection{TThoriumStack.Create}
\label{thoriumcorepkg:thorium:tthoriumstack:create}
\index{TThoriumStack.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumStack.Destroy
\subsection{TThoriumStack.Destroy}
\label{thoriumcorepkg:thorium:tthoriumstack:destroy}
\index{TThoriumStack.Destroy}
\begin{FPCList}
\Declaration 

\begin{verbatim}
destructor Destroy;  Override
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumStack.FastGetStackEntry
\subsection{TThoriumStack.FastGetStackEntry}
\label{thoriumcorepkg:thorium:tthoriumstack:fastgetstackentry}
\index{TThoriumStack.FastGetStackEntry}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function FastGetStackEntry(ScopeRoot: Integer;Index: Integer)
                           : PThoriumStackEntry
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumStack.GetTopStackEntry
\subsection{TThoriumStack.GetTopStackEntry}
\label{thoriumcorepkg:thorium:tthoriumstack:gettopstackentry}
\index{TThoriumStack.GetTopStackEntry}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function GetTopStackEntry : PThoriumStackEntry
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumStack.GetTop
\subsection{TThoriumStack.GetTop}
\label{thoriumcorepkg:thorium:tthoriumstack:gettop}
\index{TThoriumStack.GetTop}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function GetTop(Offset: Integer) : PThoriumStackEntry
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumStack.Prealloc
\subsection{TThoriumStack.Prealloc}
\label{thoriumcorepkg:thorium:tthoriumstack:prealloc}
\index{TThoriumStack.Prealloc}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function Prealloc : PThoriumStackEntry
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumStack.Push
\subsection{TThoriumStack.Push}
\label{thoriumcorepkg:thorium:tthoriumstack:push}
\index{TThoriumStack.Push}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function Push : PThoriumStackEntry
procedure Push(AEntry: PThoriumStackEntry)
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumStack.Pop
\subsection{TThoriumStack.Pop}
\label{thoriumcorepkg:thorium:tthoriumstack:pop}
\index{TThoriumStack.Pop}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure Pop(Amount: Integer;FreeValues: Boolean)
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumStack.PopTop
\subsection{TThoriumStack.PopTop}
\label{thoriumcorepkg:thorium:tthoriumstack:poptop}
\index{TThoriumStack.PopTop}
\begin{FPCList}
\Declaration 

\begin{verbatim}
function PopTop : PThoriumStackEntry
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumStack.ClearStack
\subsection{TThoriumStack.ClearStack}
\label{thoriumcorepkg:thorium:tthoriumstack:clearstack}
\index{TThoriumStack.ClearStack}
\begin{FPCList}
\Declaration 

\begin{verbatim}
procedure ClearStack
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumStack.StackEntry
\subsection{TThoriumStack.StackEntry}
\label{thoriumcorepkg:thorium:tthoriumstack:stackentry}
\index{TThoriumStack.StackEntry}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property StackEntry[ScopeRoot: Integer;Index: Integer]: PThoriumStackEntry
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
% TThoriumStack.EntryCount
\subsection{TThoriumStack.EntryCount}
\label{thoriumcorepkg:thorium:tthoriumstack:entrycount}
\index{TThoriumStack.EntryCount}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property EntryCount : Integer
\end{verbatim}
\Visibility
public
\Access
Read
\end{FPCList}
% TThoriumStack.Capacity
\subsection{TThoriumStack.Capacity}
\label{thoriumcorepkg:thorium:tthoriumstack:capacity}
\index{TThoriumStack.Capacity}
\begin{FPCList}
\Declaration 

\begin{verbatim}
Property Capacity : Integer
\end{verbatim}
\Visibility
public
\Access
Read,Write
\end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumVariable
\section{TThoriumVariable}
\label{thoriumcorepkg:thorium:tthoriumvariable}
\index{TThoriumVariable}
% Description
\subsection{Description}
This class represents a (probably public) variable declared in a Thorium script.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumvariable:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumvariable:create} & Create  & Creates an instance. \\
\pageref{thoriumcorepkg:thorium:tthoriumvariable:loadfromstream} & LoadFromStream  & Loads specification from stream. \\
\pageref{thoriumcorepkg:thorium:tthoriumvariable:savetostream} & SaveToStream  & Saves specification to stream. \\
\hline
\end{tabularx}
% Property overview
\subsection{Property overview}
\label{thoriumcorepkg:thorium:tthoriumvariable:properties}
\begin{tabularx}{\textwidth}{lllX}
Page & Property & Access & Description \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumvariable:isstatic} & IsStatic & r & Whether the value is static. \\
\pageref{thoriumcorepkg:thorium:tthoriumvariable:stackposition} & StackPosition & r & Position of the variable on the stack. \\
\pageref{thoriumcorepkg:thorium:tthoriumvariable:typespec} & TypeSpec & r & Type of the variable. \\
\hline
\end{tabularx}
% TThoriumVariable.Create
\subsection{TThoriumVariable.Create}
\label{thoriumcorepkg:thorium:tthoriumvariable:create}
\index{TThoriumVariable.Create}
\begin{FPCList}
\Synopsis
Creates an instance.\Declaration 

\begin{verbatim}
constructor Create(AModule: TThoriumModule);  Override
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumVariable.LoadFromStream
\subsection{TThoriumVariable.LoadFromStream}
\label{thoriumcorepkg:thorium:tthoriumvariable:loadfromstream}
\index{TThoriumVariable.LoadFromStream}
\begin{FPCList}
\Synopsis
Loads specification from stream.\Declaration 

\begin{verbatim}
procedure LoadFromStream(Stream: TStream);  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumVariable.SaveToStream
\subsection{TThoriumVariable.SaveToStream}
\label{thoriumcorepkg:thorium:tthoriumvariable:savetostream}
\index{TThoriumVariable.SaveToStream}
\begin{FPCList}
\Synopsis
Saves specification to stream.\Declaration 

\begin{verbatim}
procedure SaveToStream(Stream: TStream);  Override
\end{verbatim}
\Visibility
public
\end{FPCList}
% TThoriumVariable.IsStatic
\subsection{TThoriumVariable.IsStatic}
\label{thoriumcorepkg:thorium:tthoriumvariable:isstatic}
\index{TThoriumVariable.IsStatic}
\begin{FPCList}
\Synopsis
Whether the value is static.\Declaration 

\begin{verbatim}
Property IsStatic : Boolean
\end{verbatim}
\Visibility
public
\Access
Read
\Description
If this is true, no changes can be made to the value of this variable. It has been declared as static and most references have been replaced by the compiler with the actual value to optimize the code.\end{FPCList}
% TThoriumVariable.StackPosition
\subsection{TThoriumVariable.StackPosition}
\label{thoriumcorepkg:thorium:tthoriumvariable:stackposition}
\index{TThoriumVariable.StackPosition}
\begin{FPCList}
\Synopsis
Position of the variable on the stack.\Declaration 

\begin{verbatim}
Property StackPosition : Integer
\end{verbatim}
\Visibility
public
\Access
Read
\Description
This property tells where on the module local part of the stack the variable can be found.\end{FPCList}
% TThoriumVariable.TypeSpec
\subsection{TThoriumVariable.TypeSpec}
\label{thoriumcorepkg:thorium:tthoriumvariable:typespec}
\index{TThoriumVariable.TypeSpec}
\begin{FPCList}
\Synopsis
Type of the variable.\Declaration 

\begin{verbatim}
Property TypeSpec : TThoriumType
\end{verbatim}
\Visibility
public
\Access
Read
\Description
The type specification of the variable. \end{FPCList}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TThoriumVirtualMachine
\section{TThoriumVirtualMachine}
\label{thoriumcorepkg:thorium:tthoriumvirtualmachine}
\index{TThoriumVirtualMachine}
% Description
\subsection{Description}
This class is responsible to execute the bytecode generated by the Thorium compiler. It also keeps track of the stack. While a virtual machine is attached to a Thorium engine, no changes should be made to ensure the consistency of the virtual machine state.% Method overview
\subsection{Method overview}
\label{thoriumcorepkg:thorium:tthoriumvirtualmachine:methods}
\begin{tabularx}{\textwidth}{llX}
Page & Property & Description  \\ \hline
\pageref{thoriumcorepkg:thorium:tthoriumvirtualmachine:create} & Create  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumvirtualmachine:destroy} & Destroy  &  \\
\pageref{thoriumcorepkg:thorium:tthoriumvirtualmachine:dumpstack} & DumpStack  & Dump stack to stdout. \\
\pageref{thoriumcorepkg:thorium:tthoriumvirtualmachine:execute} & Execute  & Execute instructions. \\
\pageref{thoriumcorepkg:thorium:tthoriumvirtualmachine:getstack} & GetStack  & Return the stack of the virtual machine. \\
\hline
\end{tabularx}
% TThoriumVirtualMachine.Create
\subsection{TThoriumVirtualMachine.Create}
\label{thoriumcorepkg:thorium:tthoriumvirtualmachine:create}
\index{TThoriumVirtualMachine.Create}
\begin{FPCList}
\Declaration 

\begin{verbatim}
constructor Create(AThorium: TThorium)
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumVirtualMachine.Destroy
\subsection{TThoriumVirtualMachine.Destroy}
\label{thoriumcorepkg:thorium:tthoriumvirtualmachine:destroy}
\index{TThoriumVirtualMachine.Destroy}
\begin{FPCList}
\Declaration 

\begin{verbatim}
destructor Destroy;  Override
\end{verbatim}
\Visibility
default
\end{FPCList}
% TThoriumVirtualMachine.DumpStack
\subsection{TThoriumVirtualMachine.DumpStack}
\label{thoriumcorepkg:thorium:tthoriumvirtualmachine:dumpstack}
\index{TThoriumVirtualMachine.DumpStack}
\begin{FPCList}
\Synopsis
Dump stack to stdout.\Declaration 

\begin{verbatim}
procedure DumpStack
\end{verbatim}
\Visibility
public
\Description
Dumps the whole stack to stdout. Be aware that it also tries to read values and thus may crash if the stack is in an inconsistent state (which should of course not occur normally).\end{FPCList}
% TThoriumVirtualMachine.GetStack
\subsection{TThoriumVirtualMachine.GetStack}
\label{thoriumcorepkg:thorium:tthoriumvirtualmachine:getstack}
\index{TThoriumVirtualMachine.GetStack}
\begin{FPCList}
\Synopsis
Return the stack of the virtual machine.\Declaration 

\begin{verbatim}
function GetStack : TThoriumStack
\end{verbatim}
\Visibility
public
\Description
Returns the stack which is being used by this virtual machine. Handle with care. You should not attempt to make any changes to the stack by yourself.\end{FPCList}
% TThoriumVirtualMachine.Execute
\subsection{TThoriumVirtualMachine.Execute}
\label{thoriumcorepkg:thorium:tthoriumvirtualmachine:execute}
\index{TThoriumVirtualMachine.Execute}
\begin{FPCList}
\Synopsis
Execute instructions.\Declaration 

\begin{verbatim}
procedure Execute(StartModuleIndex: Integer;StartInstruction: Integer;
                 CreateDefaultStackFrame: Boolean);  Virtual
\end{verbatim}
\Visibility
public
\Description
This function starts the execution of Thorium bytecode instructions. The execution begins at the instruction index supplied via \textit{StartInstruction} in the module which can be found at the index given with \textit{StartModuleIndex}. The execution stops only when a jump to THORIUM\_JMP\_EXIT (\pageref{thoriumcorepkg:thorium}) occurs. If \textit{CreateDefaultStackframe} is true, a stack frame is generated whose return value points to THORIUM\_JMP\_EXIT so that a \textit{ret} instruction will finish the execution.  You would normally only set CreateDefaultStackframe to False if you would want to initialize a module since that is the only situation where jmp-instructions to THORIUM\_JMP\_EXIT are placed. If you want to call a function, you set CreateDefaultStackframe to True, although you should call functions always using their Call (\pageref{thoriumcorepkg:thorium:tthoriumfunction:call}) or even SafeCall (\pageref{thoriumcorepkg:thorium:tthoriumfunction:safecall}) method since these take care of the stack for you.\end{FPCList}
