Create a hdsApp instance Pointer to the new Dissamino application
| Return Type | Function name | Arguments |
|---|---|---|
| hdsApp* | hdsApp::GetInstance | (hzLogger&,) |
Declared in file: hzDissemino.h
Defined in file : hdsCore.cpp
Function Logic:
Function body:
hdsApp* hdsApp::GetInstance (hzLogger& pLog)
{
// Category: Dissemino System Initialization
//
// Create a hdsApp instance
//
// Arguments: 1) pLog Pointer to an established logger to log config errors and events
//
// Returns: Pointer to the new Dissamino application
_hzfunc("hdsApp::GetInstance") ;
hdsApp* pApp ; // Dissemino application visible entity belongs to
if (_hzGlobal_Webapp)
{
// Singleton webapp case
hzwarn(E_SETONCE, "Existing singleton webapp") ;
return _hzGlobal_Webapp ;
}
if (_hzGlobal_Sphere)
{
// Multiple webapps allowed
pApp = new hdsApp() ;
pApp->m_pLog = &pLog ;
return pApp ;
}
// No current webapp and no sphere, so create the webapp and make it the singleton
_hzGlobal_Webapp = new hdsApp() ;
if (!_hzGlobal_Webapp)
hzexit(E_MEMORY, "No allocation for Dissemino Sphere") ;
_hzGlobal_Webapp->m_pLog = &pLog ;
return _hzGlobal_Webapp ;
}