OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ogre::ScriptCompilerManager Class Reference

Manages threaded compilation of scripts. More...

#include <OgreScriptCompiler.h>

+ Inheritance diagram for Ogre::ScriptCompilerManager:
+ Collaboration diagram for Ogre::ScriptCompilerManager:

Public Member Functions

 ScriptCompilerManager ()
 
virtual ~ScriptCompilerManager ()
 
void addScriptPattern (const String &pattern)
 Adds a script extension that can be handled (e.g. *.material, *.pu, etc.) More...
 
void addTranslatorManager (ScriptTranslatorManager *man)
 Adds the given translator manager to the list of managers. More...
 
void clearTranslatorManagers ()
 Clears all translator managers. More...
 
ScriptCompilerListenergetListener ()
 Returns the currently set listener used for compiler instances. More...
 
Real getLoadingOrder (void) const
 Gets the relative loading order of scripts of this type. More...
 
const StringVectorgetScriptPatterns (void) const
 Gets the file patterns which should be used to find scripts for this class. More...
 
ScriptTranslatorgetTranslator (const AbstractNodePtr &node)
 Retrieves a ScriptTranslator from the supported managers. More...
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, void *)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info More...
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *ptr)
 placement operator new More...
 
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info More...
 
void * operator new[] (size_t sz)
 
void parseScript (DataStreamPtr &stream, const String &groupName)
 Parse a script file. More...
 
void removeTranslatorManager (ScriptTranslatorManager *man)
 Removes the given translator manager from the list of managers. More...
 
void setListener (ScriptCompilerListener *listener)
 Sets the listener used for compiler instances. More...
 

Static Public Member Functions

static ScriptCompilerManagergetSingleton (void)
 Override standard Singleton retrieval. More...
 
static ScriptCompilerManagergetSingletonPtr (void)
 Override standard Singleton retrieval. More...
 

Static Protected Attributes

static ScriptCompilerManagermsSingleton
 

Private Member Functions

 OGRE_THREAD_POINTER (ScriptCompiler, mScriptCompiler)
 

Private Attributes

ScriptTranslatorManagermBuiltinTranslatorManager
 
ScriptCompilerListenermListener
 
vector
< ScriptTranslatorManager * >
::type 
mManagers
 
StringVector mScriptPatterns
 
 OGRE_AUTO_MUTEX
 

Detailed Description

Manages threaded compilation of scripts.

This script loader forwards scripts compilations to a specific compiler instance.

Definition at line 384 of file OgreScriptCompiler.h.

Constructor & Destructor Documentation

Ogre::ScriptCompilerManager::ScriptCompilerManager ( )
virtual Ogre::ScriptCompilerManager::~ScriptCompilerManager ( )
virtual

Member Function Documentation

void Ogre::ScriptCompilerManager::addScriptPattern ( const String pattern)

Adds a script extension that can be handled (e.g. *.material, *.pu, etc.)

void Ogre::ScriptCompilerManager::addTranslatorManager ( ScriptTranslatorManager man)

Adds the given translator manager to the list of managers.

void Ogre::ScriptCompilerManager::clearTranslatorManagers ( )

Clears all translator managers.

ScriptCompilerListener* Ogre::ScriptCompilerManager::getListener ( )

Returns the currently set listener used for compiler instances.

Real Ogre::ScriptCompilerManager::getLoadingOrder ( void  ) const
virtual

Gets the relative loading order of scripts of this type.

Remarks
There are dependencies between some kinds of scripts, and to enforce this all implementors of this interface must define a loading order.
Returns
A value representing the relative loading order of these scripts compared to other script users, where higher values load later.

Implements Ogre::ScriptLoader.

const StringVector& Ogre::ScriptCompilerManager::getScriptPatterns ( void  ) const
virtual

Gets the file patterns which should be used to find scripts for this class.

Remarks
This method is called when a resource group is loaded if you use ResourceGroupManager::_registerScriptLoader.
Returns
A list of file patterns, in the order they should be searched in.

Implements Ogre::ScriptLoader.

static ScriptCompilerManager& Ogre::ScriptCompilerManager::getSingleton ( void  )
static

Override standard Singleton retrieval.

Remarks
Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.
This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.
static ScriptCompilerManager* Ogre::ScriptCompilerManager::getSingletonPtr ( void  )
static

Override standard Singleton retrieval.

Remarks
Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.
This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.
ScriptTranslator* Ogre::ScriptCompilerManager::getTranslator ( const AbstractNodePtr node)

Retrieves a ScriptTranslator from the supported managers.

Ogre::ScriptCompilerManager::OGRE_THREAD_POINTER ( ScriptCompiler  ,
mScriptCompiler   
)
private
template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
)
inlineinherited

Definition at line 102 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

Definition at line 108 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr)
inlineinherited

Definition at line 113 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

Definition at line 119 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void *  ptr 
)
inlineinherited

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz)
inlineinherited

Definition at line 91 of file OgreMemoryAllocatedObject.h.

void Ogre::ScriptCompilerManager::parseScript ( DataStreamPtr stream,
const String groupName 
)
virtual

Parse a script file.

Parameters
streamWeak reference to a data stream which is the source of the script
groupNameThe name of a resource group which should be used if any resources are created during the parse of this script.

Implements Ogre::ScriptLoader.

void Ogre::ScriptCompilerManager::removeTranslatorManager ( ScriptTranslatorManager man)

Removes the given translator manager from the list of managers.

void Ogre::ScriptCompilerManager::setListener ( ScriptCompilerListener listener)

Sets the listener used for compiler instances.

Member Data Documentation

ScriptTranslatorManager* Ogre::ScriptCompilerManager::mBuiltinTranslatorManager
private

Definition at line 399 of file OgreScriptCompiler.h.

ScriptCompilerListener* Ogre::ScriptCompilerManager::mListener
private

Definition at line 393 of file OgreScriptCompiler.h.

vector<ScriptTranslatorManager*>::type Ogre::ScriptCompilerManager::mManagers
private

Definition at line 396 of file OgreScriptCompiler.h.

StringVector Ogre::ScriptCompilerManager::mScriptPatterns
private

Definition at line 390 of file OgreScriptCompiler.h.

ScriptCompilerManager * Ogre::Singleton< ScriptCompilerManager >::msSingleton
staticprotectedinherited

Definition at line 75 of file OgreSingleton.h.

Ogre::ScriptCompilerManager::OGRE_AUTO_MUTEX
private

Definition at line 387 of file OgreScriptCompiler.h.


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