|
CStageInitInfo class |
Pipelines v2.0 |
|
Description |
CStageInitInfo is the class object which is passed to your
stage BeginStage() function. It is through this class object that you instruct
the CStageManager as to the success or failure of you stages’ initialisation
process; by setting the m_bReturnCode
member variable to a value of true or false, respectively.
|
Definition |
The following class definition is an edited version; it
details only those members which are accessible and of use to you. In addition;
any examples that may be shown are only intended as a demonstration of how
certain functions might be used, they do not represent best practice nor do
they take into account the scope and de-allocation of class objects.
class CStageInitInfo
{ // Access to the CStageManager that created me. CStageManager *Manager( void ) // Stage initialisation return code. bool m_bReturnCode;};|
Member variables |
|
● |
bool m_bReturnCode [in] is the return code to be set by your stage
BeginStage() function. |
|
Member functions |
CStageInitInfo::Manager( void ) |
|
● |
Purpose Use Manager()
to access the CStageManager that created your stage. The function
is used in combination with the m_bReturnCode member in
order to inform the CStageManager of the status of your stage initialisation
phase. |
||
|
● |
Parameters
|
||
|
● |
Returns |
||
|
|
|
||
|
● |
Messages None |
||
|
● |
Usage The following example shows the
BeginStage() function, which is the entry point of your stage. CStageManager calls BeginStage()
with a CStageInitInfo class object; you instantiate your stage, call your
Initialise() function to parse your stage command argument and allocate the
resources that your stage requires and through the m_bReturnCode
member you report back to CStageManager its success or failure. CStageManager
then reports back to you whether you should proceed or terminate immediately. DWORD BeginStage( CStageInitInfo *a_pInfo ) { AFX_MANAGE_STATE(
AfxGetStaticModuleState() ); //
Instantiate the CStage class object. CLookup lookup(
a_pInfo ); //
Perform initialisation phase processing. a_pInfo->m_bReturnCode = lookup.Initialise(); // Inform the manager of the initialisation phase result and if // this or any other stage has reported an error, then terminate processing.
if( !a_pInfo->Manager()->SetStatus(
a_pInfo ) ) return( _RC_FAIL_ ); //
Otherwise; proceed to our runtime phase. return( lookup.Go() ); } |
|
|