"L. Spiro Engine"
|
A stack of scopes containing variables, functions, and structures declared in shaders. More...
#include <LSGShaderScopeStack.h>
Classes | |
struct | LSG_TYPE_INDEX_AND_INDEX |
Public Types | |
typedef struct lsg::CShaderScopeStack::LSG_TYPE_INDEX_AND_INDEX * | LPLSG_TYPE_INDEX_AND_INDEX |
typedef struct lsg::CShaderScopeStack::LSG_TYPE_INDEX_AND_INDEX | LPCLSG_TYPE_INDEX_AND_INDEX |
Public Member Functions | |
LSBOOL LSE_CALL | Push () |
LSVOID LSE_CALL | Pop () |
LSVOID LSE_CALL | Reset () |
CShaderScope *LSE_CALL | GetCurrentScope () |
const CShaderScope *LSE_CALL | GetCurrentScope () const |
CShaderScope *LSE_CALL | GetScope (LSUINT32 _ui32Index) |
const CShaderScope *LSE_CALL | GetScope (LSUINT32 _ui32Index) const |
LSUINT32 LSE_CALL | TotalScopes () const |
LSBOOL LSE_CALL | IdentifierExistsAs (CShaderScope::LSG_TYPE _tType, const CString &_sName) const |
LSBOOL LSE_CALL | GetIdentifiersAs (CShaderScope::LSG_TYPE _tType, const CString &_sName, CVectorPoD< LSG_TYPE_INDEX_AND_INDEX > &_vRet) const |
LSBOOL LSE_CALL | GetNameAssociation (const CString &_sName, const LSCHAR *&_pcNew) const |
Protected Attributes | |
CVector< CShaderScope, LSUINT32, 512UL > | m_vStack |
A stack of scopes containing variables, functions, and structures declared in shaders.
Class CShaderScopeStack Description: A stack of scopes. The bottom scope is global. The top scope is the current scope.
typedef struct lsg::CShaderScopeStack::LSG_TYPE_INDEX_AND_INDEX * lsg::CShaderScopeStack::LPLSG_TYPE_INDEX_AND_INDEX |
The location of an identifier.
CShaderScope* LSE_CALL lsg::CShaderScopeStack::GetCurrentScope | ( | ) |
Get the current scope, if any. If used properly, there will always be at least a global scope. Since the engine is the only thing that should be using this function, and the engine uses it properly, the engine does not perform a NULL check on the return. If you did not write this engine, you should be checking for NULL on this return.
const CShaderScope* LSE_CALL lsg::CShaderScopeStack::GetCurrentScope | ( | ) | const |
Get the current scope, if any. If used properly, there will always be at least a global scope. Since the engine is the only thing that should be using this function, and the engine uses it properly, the engine does not perform a NULL check on the return. If you did not write this engine, you should be checking for NULL on this return.
LSBOOL LSE_CALL lsg::CShaderScopeStack::GetIdentifiersAs | ( | CShaderScope::LSG_TYPE | _tType, |
const CString & | _sName, | ||
CVectorPoD< LSG_TYPE_INDEX_AND_INDEX > & | _vRet | ||
) | const |
Get all forms of the given identifier as the given type. For example, if an identifier exists as both a structure name and a function, this allows to get only the function or only the structure form.
_tType | Type of the identifier. |
_sName | The identifier to locate. |
_vRet | Holds the returned list of variables, structures, or functions, all of which will match the type given in _tType. |
LSBOOL LSE_CALL lsg::CShaderScopeStack::GetNameAssociation | ( | const CString & | _sName, |
const LSCHAR *& | _pcNew | ||
) | const |
Get a name association.
_sName | The name for which to find an association. |
_pcNew | The replacement name, if any. Filled on successful return. |
CShaderScope* LSE_CALL lsg::CShaderScopeStack::GetScope | ( | LSUINT32 | _ui32Index | ) |
Get a scope by index.
_ui32Index | Index of the scope to get. |
const CShaderScope* LSE_CALL lsg::CShaderScopeStack::GetScope | ( | LSUINT32 | _ui32Index | ) | const |
Get a scope by index.
_ui32Index | Index of the scope to get. |
LSBOOL LSE_CALL lsg::CShaderScopeStack::IdentifierExistsAs | ( | CShaderScope::LSG_TYPE | _tType, |
const CString & | _sName | ||
) | const |
Does the given type-identifier name exist within any scopes?
_tType | Type of the identifier. |
_sName | The identifier to locate. |
LSVOID LSE_CALL lsg::CShaderScopeStack::Pop | ( | ) |
Leave a scope.
LSBOOL LSE_CALL lsg::CShaderScopeStack::Push | ( | ) |
Add a scope.
LSVOID LSE_CALL lsg::CShaderScopeStack::Reset | ( | ) |
Reset the stack.
LSUINT32 LSE_CALL lsg::CShaderScopeStack::TotalScopes | ( | ) | const |
Get the total number of scopes.
CVector<CShaderScope, LSUINT32, 512UL> lsg::CShaderScopeStack::m_vStack [protected] |
Our stack of scopes.