"L. Spiro Engine"
Classes | Public Types | Public Member Functions | Protected Attributes

lsg::CShaderScopeStack Class Reference

A stack of scopes containing variables, functions, and structures declared in shaders. More...

#include <LSGShaderScopeStack.h>

List of all members.

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

Detailed Description

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.


Member Typedef Documentation

The location of an identifier.


Member Function Documentation

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.

Returns:
Returns the current scope or NULL if there is none.
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.

Returns:
Returns the current scope or NULL if there is none.
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.

Parameters:
_tTypeType of the identifier.
_sNameThe identifier to locate.
_vRetHolds the returned list of variables, structures, or functions, all of which will match the type given in _tType.
Returns:
Returns true if the given identifier exists in any scope with the given form.
LSBOOL LSE_CALL lsg::CShaderScopeStack::GetNameAssociation ( const CString &  _sName,
const LSCHAR *&  _pcNew 
) const

Get a name association.

Parameters:
_sNameThe name for which to find an association.
_pcNewThe replacement name, if any. Filled on successful return.
Returns:
Returns true if there is a replacement name for the given name.
CShaderScope* LSE_CALL lsg::CShaderScopeStack::GetScope ( LSUINT32  _ui32Index)

Get a scope by index.

Parameters:
_ui32IndexIndex of the scope to get.
Returns:
Returns the scope at the given index.
const CShaderScope* LSE_CALL lsg::CShaderScopeStack::GetScope ( LSUINT32  _ui32Index) const

Get a scope by index.

Parameters:
_ui32IndexIndex of the scope to get.
Returns:
Returns the scope at the given index.
LSBOOL LSE_CALL lsg::CShaderScopeStack::IdentifierExistsAs ( CShaderScope::LSG_TYPE  _tType,
const CString &  _sName 
) const

Does the given type-identifier name exist within any scopes?

Parameters:
_tTypeType of the identifier.
_sNameThe identifier to locate.
Returns:
Returns true if the given identifier exists in any scope with the given form.
LSVOID LSE_CALL lsg::CShaderScopeStack::Pop ( )

Leave a scope.

LSBOOL LSE_CALL lsg::CShaderScopeStack::Push ( )

Add a scope.

Returns:
Returns true if there is enough memory to perform the operation.
LSVOID LSE_CALL lsg::CShaderScopeStack::Reset ( )

Reset the stack.

LSUINT32 LSE_CALL lsg::CShaderScopeStack::TotalScopes ( ) const

Get the total number of scopes.

Returns:
Returns the total number of scopes.

Member Data Documentation

CVector<CShaderScope, LSUINT32, 512UL> lsg::CShaderScopeStack::m_vStack [protected]

Our stack of scopes.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator