You.i Engine
CYIBindingContext Class Referenceabstract

Detailed Description

The entry point for executing script source code in You.i Engine.

This class is responsible for loading the C++ bindings into the binding engine as well as executing scripts from script source code. To execute script source code, a CYIBindingContext subclass must be instanced and then initialized using Init().

Note
This class is not intended to be implemented by users of You.i Engine as each binding engine requires a specific binding implementation for each bound You.i Engine class. Implementing this class would not provide bindings to You.i Engine classes.
See also
CYIDTBindingContext

#include <binding/YiBindingContext.h>

Inheritance diagram for CYIBindingContext:

Public Member Functions

 CYIBindingContext ()
 
virtual ~CYIBindingContext ()
 
virtual bool Init ()=0
 
virtual bool ExecuteString (const CYIString &scriptString)=0
 
virtual bool ExecuteScript (const std::shared_ptr< CYIAssetScript > &pScriptAsset)=0
 
virtual void CreateGlobalObject (const CYIString &scriptObjectName, const CYIString &className, CYIScriptableObject *pScriptableObject)=0
 
virtual CYIScriptableObjectNewRootedObject (const CYIRuntimeTypeInfo &enforceClassType, const CYIString &scriptObjectName)=0
 
virtual void DumpToLog ()=0
 
virtual bool ConnectDebugger ()
 

Constructor & Destructor Documentation

CYIBindingContext::CYIBindingContext ( )
virtual CYIBindingContext::~CYIBindingContext ( )
virtual

Member Function Documentation

virtual bool CYIBindingContext::ConnectDebugger ( )
virtual

Connects the debugger associated with the binding engine to allow debugging of the script source. Returns true if the debugger was successfully connected and false otherwise.

Reimplemented in CYIDTBindingContext.

virtual void CYIBindingContext::CreateGlobalObject ( const CYIString scriptObjectName,
const CYIString className,
CYIScriptableObject pScriptableObject 
)
pure virtual

Creates an object that can be accessed globally in script source code with the name scriptObjectName. pScriptableObject is the C++ object that will be accessible in script source and className is its C++ class name.

Implemented in CYIDTBindingContext.

virtual void CYIBindingContext::DumpToLog ( )
pure virtual

Dumps the current context of the binding engine using CYILogger.

Implemented in CYIDTBindingContext.

virtual bool CYIBindingContext::ExecuteScript ( const std::shared_ptr< CYIAssetScript > &  pScriptAsset)
pure virtual

Executes script source from a script asset, pScriptAsset.

See also
ExecuteString(const CYIString &)

Implemented in CYIDTBindingContext.

virtual bool CYIBindingContext::ExecuteString ( const CYIString scriptString)
pure virtual

Executes script source code contained in the string scriptString.

Note
Init() must be called before executing any script source or the user will not have access to You.i Engine bound classes.
See also
Init

Implemented in CYIDTBindingContext.

virtual bool CYIBindingContext::Init ( )
pure virtual

Initializes the binding engine. This registers all You.i Engine bound classes with the binding engine for access in the script source code. Users of this class must register any custom bound classes after calling this method and before executing any scripts. Returns true if initialization was successful.

Implemented in CYIDTBindingContext.

virtual CYIScriptableObject* CYIBindingContext::NewRootedObject ( const CYIRuntimeTypeInfo enforceClassType,
const CYIString scriptObjectName 
)
pure virtual

Creates a new instance of the script object with name scriptObjectName and forces the binding engine to keep the script object in memory and not garbage collected.

See also
CYIBindingImplementation::SetIsRooted

Implemented in CYIDTBindingContext.


The documentation for this class was generated from the following file: