00001 //---------------------------------------------------------------------------- 00002 /** @file SgInit.h 00003 Initialization of the SmartGo module. 00004 */ 00005 //---------------------------------------------------------------------------- 00006 00007 #ifndef SG_INIT_H 00008 #define SG_INIT_H 00009 00010 //---------------------------------------------------------------------------- 00011 00012 /** Used in SgInit(); public only as a side effect of the implementation. */ 00013 void SgInitImpl(bool compiledInDebugMode); 00014 00015 /** Call all lower-level Fini functions. 00016 This function must be called after using the SmartGo module. 00017 Also calls SgMemCheck. 00018 @note Will become obsolete in the future 00019 @see SgInit 00020 */ 00021 void SgFini(); 00022 00023 /** Call all lower-level initialization functions. 00024 This function must be called before using the SmartGo module. 00025 Returns false if one of them returns false. 00026 @note Don't add any more global variables that need explicit 00027 initialization; this function will become unnecessary in the future. 00028 Currently still needed for: 00029 - Property 00030 @throws SgException on error 00031 */ 00032 inline void SgInit() 00033 { 00034 // This function must be inline, it needs to use the setting of NDEBUG 00035 // of the user code including this header 00036 #ifndef NDEBUG 00037 SgInitImpl(true); 00038 #else 00039 SgInitImpl(false); 00040 #endif 00041 } 00042 00043 /** Check that SgInit was called. 00044 @throws SgException if not 00045 */ 00046 void SgInitCheck(); 00047 00048 //---------------------------------------------------------------------------- 00049 00050 #endif // SG_INIT_H 00051