Sheep
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
Classes | Namespaces | Typedefs | Enumerations | Functions
sheepcpp.h File Reference
#include "sheepCommon.h"

Go to the source code of this file.

Classes

class  Sheep::IExecutionContext
 
class  Sheep::IVirtualMachine
 Represents a Sheep Virtual Machine which executes compiled Sheep scripts. More...
 
class  Sheep::IDisassembly
 Represents a disassembly of an IScript object. More...
 
class  Sheep::ICompiledScriptOutput
 
class  Sheep::IScript
 Interface to a Script object. More...
 
class  Sheep::ICompiler
 Interface to a Compiler object that compiles sheep scripts. More...
 

Namespaces

 Sheep
 Namespace that contains the C++ Sheep API.
 

Typedefs

typedef void(SHP_CALLBACK * Sheep::ImportCallback )(IExecutionContext *context)
 
typedef void(SHP_CALLBACK * Sheep::EndWaitCallback )(IVirtualMachine *vm, IExecutionContext *context)
 

Enumerations

enum  Sheep::SymbolType { Sheep::SymbolType::Void = 0, Sheep::SymbolType::Int = 1, Sheep::SymbolType::Float = 2, Sheep::SymbolType::String = 3 }
 Represents a Sheep symbol type. More...
 
enum  Sheep::SheepLanguageVersion { Sheep::SheepLanguageVersion::V100 = 0, Sheep::SheepLanguageVersion::V200 }
 Represents a specific version of Sheep. More...
 
enum  Sheep::ExecutionContextState { Sheep::ExecutionContextState::Prepared, Sheep::ExecutionContextState::Executing, Sheep::ExecutionContextState::Suspended, Sheep::ExecutionContextState::Finished }
 
enum  Sheep::ScriptStatus { Sheep::ScriptStatus::Success, Sheep::ScriptStatus::Error, Sheep::ScriptStatus::Invalid }
 Represents the status of an IScript object. More...
 

Functions

SHP_DECLSPEC Sheep::ICompiler
*SHP_APIENTRY 
CreateSheepCompiler (Sheep::SheepLanguageVersion version)
 
SHP_DECLSPEC
Sheep::IVirtualMachine
*SHP_APIENTRY 
CreateSheepVirtualMachine (Sheep::SheepLanguageVersion version)
 
SHP_DECLSPEC int SHP_APIENTRY CreateScriptFromBytecode (const char *bytecode, int length, Sheep::IScript **result)
 

Function Documentation

SHP_DECLSPEC int SHP_APIENTRY CreateScriptFromBytecode ( const char *  bytecode,
int  length,
Sheep::IScript **  result 
)

Creates a new IScript object from Sheep bytecode

Be sure to call Sheep::IScript::Release() when you're done with the script. The bytecode can be freed after this call. The Sheep::IScript doesn't need it anymore.

Parameters
bytecodeThe bytecode for the script
lengthThe length of the bytecode
resultA pointer to a pointer that will hold the new IScript instance
Returns
SHEEP_SUCCESS if successful, or an error otherwise
SHP_DECLSPEC Sheep::ICompiler* SHP_APIENTRY CreateSheepCompiler ( Sheep::SheepLanguageVersion  version)

Creates an ICompiler object for compiling Sheep scripts

Be sure to call Sheep::ICompiler::Release() when you're done with the compiler.

Parameters
versionThe version of Sheep that the compiler should support
Returns
A new Sheep::ICompiler instance
SHP_DECLSPEC Sheep::IVirtualMachine* SHP_APIENTRY CreateSheepVirtualMachine ( Sheep::SheepLanguageVersion  version)

Creates an IVirtualMachine object for running Sheep scripts

Be sure to call IVirtualMachine::Release() when you're done with the virtual machine.

Parameters
return A new Sheep::IVirtualMachine instance