OGRE-Next: Ogre::ScriptCompilerManager Class Reference

| OGRE-Next 3.0.0 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Ogre::ScriptCompilerManager Class Reference
Core » General

Manages threaded compilation of scripts. More...

`#include <OgreScriptCompiler.h>`

Inheritance diagram for Ogre::ScriptCompilerManager:
[legend]

## Public Member Functions
| ScriptCompilerManager ()
| ~ScriptCompilerManager () override
void | addScriptPattern (const String &pattern)
| Adds a script extension that can be handled (e.g. *.material, *.pu, etc.)
void | addTranslatorManager (ScriptTranslatorManager *man)
| Adds the given translator manager to the list of managers.
void | clearTranslatorManagers ()
| Clears all translator managers.
ScriptCompilerListener * | getListener ()
| Returns the currently set listener used for compiler instances.
Real | getLoadingOrder () const override
| Gets the relative loading order of scripts of this type.
const StringVector & | getScriptPatterns () const override
| Gets the file patterns which should be used to find scripts for this class.
ScriptTranslator * | getTranslator (const AbstractNodePtr &node)
| Retrieves a ScriptTranslator from the supported managers.
void | parseScript (DataStreamPtr &stream, const String &groupName) override
| Parse a script file.
uint32 | registerCustomWordId (const String &word)
| Adds a custom word id which can be used for custom script translators.
void | removeTranslatorManager (ScriptTranslatorManager *man)
| Removes the given translator manager from the list of managers.
void | setListener (ScriptCompilerListener *listener)
| Sets the listener used for compiler instances.
Public Member Functions inherited from Ogre::Singleton< ScriptCompilerManager >
| Singleton ()
| ~Singleton ()
Public Member Functions inherited from Ogre::ScriptLoader
virtual | ~ScriptLoader ()

## Static Public Member Functions
static ScriptCompilerManager & | getSingleton ()
| Override standard Singleton retrieval.
static ScriptCompilerManager * | getSingletonPtr ()
| Override standard Singleton retrieval.
Static Public Member Functions inherited from Ogre::Singleton< ScriptCompilerManager >
static ScriptCompilerManager & | getSingleton ()
static ScriptCompilerManager * | getSingletonPtr ()

## Detailed Description

Manages threaded compilation of scripts.

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

## Constructor & Destructor Documentation

## ◆ ScriptCompilerManager()

Ogre::ScriptCompilerManager::ScriptCompilerManager | ( |  | ) |

Referenced by getSingleton(), and getSingletonPtr().

## ◆ ~ScriptCompilerManager()

Ogre::ScriptCompilerManager::~ScriptCompilerManager | ( |  | ) |
| override

## Member Function Documentation

## ◆ addScriptPattern()

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

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

## ◆ addTranslatorManager()

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

Adds the given translator manager to the list of managers.

## ◆ clearTranslatorManagers()

void Ogre::ScriptCompilerManager::clearTranslatorManagers | ( |  | ) |

Clears all translator managers.

## ◆ getListener()

ScriptCompilerListener * Ogre::ScriptCompilerManager::getListener | ( |  | ) |

Returns the currently set listener used for compiler instances.

## ◆ getLoadingOrder()

Real Ogre::ScriptCompilerManager::getLoadingOrder | ( |  | ) | const
| overridevirtual

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.

## ◆ getScriptPatterns()

const StringVector & Ogre::ScriptCompilerManager::getScriptPatterns | ( |  | ) | const
| overridevirtual

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.

## ◆ getSingleton()

static ScriptCompilerManager & Ogre::ScriptCompilerManager::getSingleton | ( |  | ) |
| 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.

References ScriptCompilerManager().

## ◆ getSingletonPtr()

static ScriptCompilerManager * Ogre::ScriptCompilerManager::getSingletonPtr | ( |  | ) |
| 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.

References ScriptCompilerManager().

## ◆ getTranslator()

ScriptTranslator * Ogre::ScriptCompilerManager::getTranslator | ( | const AbstractNodePtr & | node | ) |

Retrieves a ScriptTranslator from the supported managers.

## ◆ parseScript()

void Ogre::ScriptCompilerManager::parseScript | ( | DataStreamPtr & | stream,
|  | const String & | groupName )
| overridevirtual

Parse a script file.

Parameters

  stream | Weak reference to a data stream which is the source of the script
  groupName | The name of a resource group which should be used if any resources are created during the parse of this script.

Implements Ogre::ScriptLoader.

## ◆ registerCustomWordId()

uint32 Ogre::ScriptCompilerManager::registerCustomWordId | ( | const String & | word | ) |

Adds a custom word id which can be used for custom script translators.

Parameters

  word | The word to be registered.

Returns
  The word id for the registered word.

Note
  If the word is already registered, the already registered id is returned.

## ◆ removeTranslatorManager()

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

Removes the given translator manager from the list of managers.

## ◆ setListener()

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

Sets the listener used for compiler instances.

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

- OgreScriptCompiler.h