Ogre::RTShader::Function Class Reference
RTShader

A class that represents a shader based program function. More...

`#include <OgreShaderFunction.h>`

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

List of all members.

## Public Types

enum | FunctionType { FFT_INTERNAL, FFT_VS_MAIN, FFT_PS_MAIN }

## Public Member Functions

const String & | getName () const
| Get the name of this function.
const String & | getDescription () const
| Get the description of this function.
ParameterPtr | resolveInputParameter (Parameter::Semantic semantic, int index, const Parameter::Content content, GpuConstantType type)
| Resolve input parameter of this function.
ParameterPtr | resolveOutputParameter (Parameter::Semantic semantic, int index, const Parameter::Content content, GpuConstantType type)
| Resolve output parameter of this function.
ParameterPtr | resolveLocalParameter (Parameter::Semantic semantic, int index, const String &name, GpuConstantType type)
| Resolve local parameter of this function.
ParameterPtr | resolveLocalParameter (Parameter::Semantic semantic, int index, const Parameter::Content content, GpuConstantType type)
| Resolve local parameter of this function.
ParameterPtr | getParameterByContent (const ShaderParameterList &parameterList, const Parameter::Content content, GpuConstantType type)
| Get parameter by a given content and type from the given parameter list.
const ShaderParameterList & | getInputParameters () const
| Return a list of input parameters.
const ShaderParameterList & | getOutputParameters () const
| Return a list of output parameters.
const ShaderParameterList & | getLocalParameters () const
| Return a list of local parameters.
void | addAtomInstance (FunctionAtom *atomInstance)
| Add a function atom instance to this function.
bool | deleteAtomInstance (FunctionAtom *atomInstance)
| Delete a function atom instance from this function.
void | sortAtomInstances ()
| Sort all atom instances of this function.
FunctionAtomInstanceList & | getAtomInstances ()
| Return list of atom instances composing this function.
const FunctionAtomInstanceList & | getAtomInstances () const
| Return list of atom instances composing this function.
void | addInputParameter (ParameterPtr parameter)
| Add input parameter to this function.
void | addOutputParameter (ParameterPtr parameter)
| Add output parameter to this function.
void | deleteInputParameter (ParameterPtr parameter)
| Delete input parameter from this function.
void | deleteOutputParameter (ParameterPtr parameter)
| Delete output parameter from this function.
void | deleteAllInputParameters ()
| Delete all input parameters from this function.
void | deleteAllOutputParameters ()
| Delete all output parameters from this function.
FunctionType | getFunctionType () const
| get function type.
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 *)

## Static Public Member Functions

static ParameterPtr | getParameterByName (const ShaderParameterList &parameterList, const String &name)
| Get parameter by a given name from the given parameter list.
static ParameterPtr | getParameterBySemantic (const ShaderParameterList &parameterList, const Parameter::Semantic semantic, int index)
| Get parameter by a given semantic and index from the given parameter list.

## Protected Member Functions

| Function (const String &name, const String &desc, const FunctionType functionType)
| Class constructor.
| ~Function ()
| Class destructor.
void | addParameter (ShaderParameterList &parameterList, ParameterPtr parameter)
| Add parameter to given list.
void | deleteParameter (ShaderParameterList &parameterList, ParameterPtr parameter)
| Delete parameter from a given list.

## Static Protected Member Functions

static int | sAtomInstanceCompare (const void *p0, const void *p1)
| Function atom comparison function used to sort atoms.

## Protected Attributes

String | mName
String | mDescription
ShaderParameterList | mInputParameters
ShaderParameterList | mOutputParameters
ShaderParameterList | mLocalParameters
FunctionAtomInstanceList | mAtomInstances
FunctionType | mFunctionType

## Friends

class | Program

## Detailed Description

A class that represents a shader based program function.

Definition at line 46 of file OgreShaderFunction.h.

## Member Enumeration Documentation

enum Ogre::RTShader::Function::FunctionType

Enumerator:

  FFT_INTERNAL |
  FFT_VS_MAIN |
  FFT_PS_MAIN |

Definition at line 50 of file OgreShaderFunction.h.

## Constructor & Destructor Documentation

Ogre::RTShader::Function::Function | ( | const String & | name,
|  | const String & | desc,
|  | const FunctionType | functionType
| ) |  | `[protected]`

Class constructor.

Parameters:

  name | The name of this function.
  desc | The description of this function.

Remarks:
  This class is allocated via an instance of Program class.

Ogre::RTShader::Function::~Function | ( |  | ) | `[protected]`

Class destructor.

## Member Function Documentation

void Ogre::RTShader::Function::addAtomInstance | ( | FunctionAtom * | atomInstance | ) |

Add a function atom instance to this function.

Parameters:

  atomInstance | The atom instance to add.

void Ogre::RTShader::Function::addInputParameter | ( | ParameterPtr | parameter | ) |

Add input parameter to this function.

void Ogre::RTShader::Function::addOutputParameter | ( | ParameterPtr | parameter | ) |

Add output parameter to this function.

void Ogre::RTShader::Function::addParameter | ( | ShaderParameterList & | parameterList,
|  | ParameterPtr | parameter
| ) |  | `[protected]`

Add parameter to given list.

void Ogre::RTShader::Function::deleteAllInputParameters | ( |  | ) |

Delete all input parameters from this function.

void Ogre::RTShader::Function::deleteAllOutputParameters | ( |  | ) |

Delete all output parameters from this function.

bool Ogre::RTShader::Function::deleteAtomInstance | ( | FunctionAtom * | atomInstance | ) |

Delete a function atom instance from this function.

Parameters:

  atomInstance | The atom instance to OGRE_DELETE.

void Ogre::RTShader::Function::deleteInputParameter | ( | ParameterPtr | parameter | ) |

Delete input parameter from this function.

void Ogre::RTShader::Function::deleteOutputParameter | ( | ParameterPtr | parameter | ) |

Delete output parameter from this function.

void Ogre::RTShader::Function::deleteParameter | ( | ShaderParameterList & | parameterList,
|  | ParameterPtr | parameter
| ) |  | `[protected]`

Delete parameter from a given list.

FunctionAtomInstanceList& Ogre::RTShader::Function::getAtomInstances | ( |  | ) |

Return list of atom instances composing this function.

Definition at line 156 of file OgreShaderFunction.h.

const FunctionAtomInstanceList& Ogre::RTShader::Function::getAtomInstances | ( |  | ) | const

Return list of atom instances composing this function.

(Const version)

Definition at line 159 of file OgreShaderFunction.h.

const String& Ogre::RTShader::Function::getDescription | ( | void |  | ) | const

Get the description of this function.

Definition at line 64 of file OgreShaderFunction.h.

FunctionType Ogre::RTShader::Function::getFunctionType | ( |  | ) | const

get function type.

const ShaderParameterList& Ogre::RTShader::Function::getInputParameters | ( |  | ) | const

Return a list of input parameters.

Definition at line 134 of file OgreShaderFunction.h.

const ShaderParameterList& Ogre::RTShader::Function::getLocalParameters | ( |  | ) | const

Return a list of local parameters.

Definition at line 140 of file OgreShaderFunction.h.

const String& Ogre::RTShader::Function::getName | ( | void |  | ) | const

Get the name of this function.

Definition at line 61 of file OgreShaderFunction.h.

const ShaderParameterList& Ogre::RTShader::Function::getOutputParameters | ( |  | ) | const

Return a list of output parameters.

Definition at line 137 of file OgreShaderFunction.h.

ParameterPtr Ogre::RTShader::Function::getParameterByContent | ( | const ShaderParameterList & | parameterList,
|  | const Parameter::Content | content,
|  | GpuConstantType | type
| ) |  |

Get parameter by a given content and type from the given parameter list.

Parameters:

  parameterList | The parameters list to look in.
  content | The content of the parameter to search in the list.
  type | The type of the parameter to search in the list.

Remarks:
  Return NULL if no matching parameter found.

static ParameterPtr Ogre::RTShader::Function::getParameterByName | ( | const ShaderParameterList & | parameterList,
|  | const String & | name
| ) |  | `[static]`

Get parameter by a given name from the given parameter list.

Parameters:

  parameterList | The parameters list to look in.
  name | The name of the parameter to search in the list.

Remarks:
  Return NULL if no matching parameter found.

static ParameterPtr Ogre::RTShader::Function::getParameterBySemantic | ( | const ShaderParameterList & | parameterList,
|  | const Parameter::Semantic | semantic,
|  | int | index
| ) |  | `[static]`

Get parameter by a given semantic and index from the given parameter list.

Parameters:

  parameterList | The parameters list to look in.
  semantic | The semantic of the parameter to search in the list.
  index | The index of the parameter to search in the list.

Remarks:
  Return NULL if no matching parameter found.

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 107 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 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 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 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]`

array operator new, with debug line info

Definition at line 85 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.

ParameterPtr Ogre::RTShader::Function::resolveInputParameter | ( | Parameter::Semantic | semantic,
|  | int | index,
|  | const Parameter::Content | content,
|  | GpuConstantType | type
| ) |  |

Resolve input parameter of this function.

Parameters:

  semantic | The desired parameter semantic.
  index | The index of the desired parameter.
  content | The content of the parameter.
  type | The type of the desired parameter. Return parameter instance in case of that resolve operation succeeded.

Remarks:
  Pass -1 as index parameter to create a new parameter with the desired semantic and type.

ParameterPtr Ogre::RTShader::Function::resolveLocalParameter | ( | Parameter::Semantic | semantic,
|  | int | index,
|  | const String & | name,
|  | GpuConstantType | type
| ) |  |

Resolve local parameter of this function.

Parameters:

  semantic | The desired parameter semantic.
  index | The index of the desired parameter.
  name | The name of the parameter.
  type | The type of the desired parameter. Return parameter instance in case of that resolve operation succeeded.

ParameterPtr Ogre::RTShader::Function::resolveLocalParameter | ( | Parameter::Semantic | semantic,
|  | int | index,
|  | const Parameter::Content | content,
|  | GpuConstantType | type
| ) |  |

Resolve local parameter of this function.

Parameters:

  semantic | The desired parameter semantic.
  index | The index of the desired parameter.
  content | The content of the parameter.
  type | The type of the desired parameter. Return parameter instance in case of that resolve operation succeeded.

ParameterPtr Ogre::RTShader::Function::resolveOutputParameter | ( | Parameter::Semantic | semantic,
|  | int | index,
|  | const Parameter::Content | content,
|  | GpuConstantType | type
| ) |  |

Resolve output parameter of this function.

Parameters:

  semantic | The desired parameter semantic.
  index | The index of the desired parameter.
  content | The content of the parameter.
  type | The type of the desired parameter. Return parameter instance in case of that resolve operation succeeded.

Remarks:
  Pass -1 as index parameter to create a new parameter with the desired semantic and type.

static int Ogre::RTShader::Function::sAtomInstanceCompare | ( | const void * | p0,
|  | const void * | p1
| ) |  | `[static, protected]`

Function atom comparison function used to sort atoms.

void Ogre::RTShader::Function::sortAtomInstances | ( |  | ) |

Sort all atom instances of this function.

## Friends And Related Function Documentation

friend class Program`[friend]`

Definition at line 221 of file OgreShaderFunction.h.

## Member Data Documentation

FunctionAtomInstanceList Ogre::RTShader::Function::mAtomInstances`[protected]`

Definition at line 216 of file OgreShaderFunction.h.

String Ogre::RTShader::Function::mDescription`[protected]`

Definition at line 208 of file OgreShaderFunction.h.

FunctionType Ogre::RTShader::Function::mFunctionType`[protected]`

Definition at line 218 of file OgreShaderFunction.h.

ShaderParameterList Ogre::RTShader::Function::mInputParameters`[protected]`

Definition at line 210 of file OgreShaderFunction.h.

ShaderParameterList Ogre::RTShader::Function::mLocalParameters`[protected]`

Definition at line 214 of file OgreShaderFunction.h.

String Ogre::RTShader::Function::mName`[protected]`

Definition at line 206 of file OgreShaderFunction.h.

ShaderParameterList Ogre::RTShader::Function::mOutputParameters`[protected]`

Definition at line 212 of file OgreShaderFunction.h.

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

- OgreShaderFunction.h

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Sun Sep 2 2012 07:28:05