# Ogre::RTShader::SubRenderStateFactory Class Reference
[RTShader]

Abstract factory interface for creating SubRenderState implementation instances. More...

`#include <OgreShaderSubRenderState.h>`

Inheritance diagram for Ogre::RTShader::SubRenderStateFactory:
[legend]

List of all members.

## Public Member Functions

| SubRenderStateFactory ()
virtual | ~SubRenderStateFactory ()
virtual const String & | getType () const =0
| Get the type of this sub render state factory.
virtual SubRenderState * | createInstance ()
| Create an instance of the SubRenderState sub class it suppose to create.
virtual SubRenderState * | createInstance (ScriptCompiler *compiler, PropertyAbstractNode *prop, Pass *pass)
| Create an instance of the SubRenderState based on script properties.
virtual void | destroyInstance (SubRenderState *subRenderState)
| Destroy the given instance.
virtual void | destroyAllInstances ()
| Destroy all the instances that created by this factory.
virtual void | writeInstance (MaterialSerializer *ser, SubRenderState *subRenderState, Pass *srcPass, Pass *dstPass)
| Write the given sub-render state instance using the material serializer.
void * | operator new (size_t sz, const char *file, int line, const char *func)
| operator new, with debug line info
void * | operator new (size_t sz)
void * | operator new (size_t sz, void *ptr)
| placement operator new
void * | operator new[] (size_t sz, const char *file, int line, const char *func)
| array operator new, with debug line info
void * | operator new[] (size_t sz)
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 *)

## Protected Member Functions

virtual SubRenderState * | createInstanceImpl ()=0
| Create instance implementation method.

## Protected Attributes

SubRenderStateSet | mSubRenderStateList

## Detailed Description

Abstract factory interface for creating SubRenderState implementation instances.

Remarks:
  Plugins or 3rd party applications can add new types of sub render states to the RTShader System by creating subclasses of the SubRenderState class. Because multiple instances of these sub class may be required, a factory class to manage the instances is also required.

  SubRenderStateFactory subclasses must allow the creation and destruction of SubRenderState subclasses. They must also be registered with the ShaderGenerator::addSubRenderStateFactory. All factories have a type which identifies them and the sub class of SubRenderState they creates.

Definition at line 230 of file OgreShaderSubRenderState.h.

## Constructor & Destructor Documentation

Ogre::RTShader::SubRenderStateFactory::SubRenderStateFactory | ( |  | ) |

Definition at line 234 of file OgreShaderSubRenderState.h.

virtual Ogre::RTShader::SubRenderStateFactory::~SubRenderStateFactory | ( |  | ) | `[virtual]`

## Member Function Documentation

virtual SubRenderState* Ogre::RTShader::SubRenderStateFactory::createInstance | ( |  | ) | `[virtual]`

Create an instance of the SubRenderState sub class it suppose to create.

virtual SubRenderState* Ogre::RTShader::SubRenderStateFactory::createInstance | ( | ScriptCompiler * | compiler,
|  | PropertyAbstractNode * | prop,
|  | Pass * | pass |
| ) |  |  | `[virtual]`

Create an instance of the SubRenderState based on script properties.

This method is called in the context of script parsing and let this factory the opportunity to create custom SubRenderState instances based on extended script properties.

Parameters:

  | compiler | The compiler instance.
  | prop | The abstract property node.
  | pass | The pass that is the parent context of this node.

Definition at line 255 of file OgreShaderSubRenderState.h.

virtual SubRenderState* Ogre::RTShader::SubRenderStateFactory::createInstanceImpl | ( |  | ) | `[protected, pure virtual]`

Create instance implementation method.

Each sub class of this interface must implement this method in which it will allocate the specific sub class of the SubRenderState.

virtual void Ogre::RTShader::SubRenderStateFactory::destroyAllInstances | ( |  | ) | `[virtual]`

Destroy all the instances that created by this factory.

virtual void Ogre::RTShader::SubRenderStateFactory::destroyInstance | ( | SubRenderState * | subRenderState | ) | `[virtual]`

Destroy the given instance.

Parameters:

  | subRenderState | The instance to destroy.

virtual const String& Ogre::RTShader::SubRenderStateFactory::getType | ( |  | ) | const`[pure virtual]`

Get the type of this sub render state factory.

Remarks:
  The type string should be the same as the type of the SubRenderState sub class it is going to create.

See also:
  SubRenderState::getType.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |  |
| ) |  |  | `[inherited]`

Definition at line 107 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) | `[inherited]`

Definition at line 95 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | void * |  |
| ) |  |  | `[inherited]`

Definition at line 101 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |  |
| ) |  |  | `[inherited]`

Definition at line 118 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) | `[inherited]`

Definition at line 112 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) | `[inherited]`

Definition at line 72 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | void * | ptr |
| ) |  |  | `[inherited]`

placement operator new

Definition at line 78 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func |
| ) |  |  | `[inherited]`

operator new, with debug line info

Definition at line 67 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) | `[inherited]`

Definition at line 90 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func |
| ) |  |  | `[inherited]`

array operator new, with debug line info

Definition at line 85 of file OgreMemoryAllocatedObject.h.

virtual void Ogre::RTShader::SubRenderStateFactory::writeInstance | ( | MaterialSerializer * | ser,
|  | SubRenderState * | subRenderState,
|  | Pass * | srcPass,
|  | Pass * | dstPass |
| ) |  |  | `[virtual]`

Write the given sub-render state instance using the material serializer.

This method is called in the context of material serialization. It is useful for integrating into bigger context of material exporters from various environment that want to take advantage of the RT Shader System. Sub classes of this interface should override in case they need to write custom properties into the script context.

Parameters:

  | ser | The material serializer instace.
  | subRenderState | The sub render state instance to write down.
  | srcPass | The source pass. dstPass The generated shader based pass.

Definition at line 275 of file OgreShaderSubRenderState.h.

## Member Data Documentation

SubRenderStateSet Ogre::RTShader::SubRenderStateFactory::mSubRenderStateList `[protected]`

Definition at line 286 of file OgreShaderSubRenderState.h.

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

- OgreShaderSubRenderState.h

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Wed Nov 3 2010 19:25:06