UGDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions | Protected Attributes
ugdk::script::InheritableLangWrapper< loader_t > Class Template Reference

Wraps a scripting language. More...

#include <langwrapper.h>

Inheritance diagram for ugdk::script::InheritableLangWrapper< loader_t >:
Inheritance graph
[legend]
Collaboration diagram for ugdk::script::InheritableLangWrapper< loader_t >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

bool RegisterModule (const Module< loader_t > &module)

Protected Member Functions

 InheritableLangWrapper (const std::string &file_extension, const LangID id)

Protected Attributes

std::vector< Module< loader_t > > modules_

Detailed Description

template<class loader_t>
class ugdk::script::InheritableLangWrapper< loader_t >

Wraps a scripting language.

Classes derived from this should implement it's methods to wrap a given language in the system.

Besides this interface, derived classes should implement a method

bool RegisterModule(const string& moduleName, T initFunction)

where moduleName is the name of the module, as to be imported from the language; T is a language specific module init function type; initFunction is the pointer to a function of the said type to initialize the module in the language (SWIG generates these functions in the wrappers) and the bool return value tells if the module was registered correctly.

Also, in order to properly add a scripting language to the system, besides implementing this class, you need to derive the VirtualData class (like this, implementing it specific to your language), modify whatever compiling mechanisms you use to make SWIG generate the wrappers to your language; and finally, when using the scripting system, properly registering your specific wrapper in the ScriptManager and the wrapper modules you want in your LangWrapper.


Constructor & Destructor Documentation

template<class loader_t >
ugdk::script::InheritableLangWrapper< loader_t >::InheritableLangWrapper ( const std::string &  file_extension,
const LangID  id 
) [inline, protected]

Member Function Documentation

template<class loader_t >
bool ugdk::script::InheritableLangWrapper< loader_t >::RegisterModule ( const Module< loader_t > &  module) [inline]

Member Data Documentation

template<class loader_t >
std::vector< Module<loader_t> > ugdk::script::InheritableLangWrapper< loader_t >::modules_ [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines