Main Page Modules Class Hierarchy Data Structures File List Data Fields Globals Related Pages

# oscl_init.h

Go to the documentation of this file.

    00001
    00013 #ifndef OSCL_INIT_H_INCLUDED
    00014 #define OSCL_INIT_H_INCLUDED
    00015
    00016 #ifndef OSCL_BASE_H_INCLUDED
    00017 #include "oscl_base.h"
    00018 #endif
    00019
    00020 //For logging memory leaks, this module relies directly on fprintf to FILE.
    00021 #include <stdio.h>
    00022
    00023 class Oscl_DefAlloc;
    00024
    00028 class OsclSelect
    00029 {
    00030     public:
    00031         OsclSelect()
    00032                 : iOsclBase(true)
    00033                 , iOsclMemory(true)
    00034                 , iOsclErrorTrap(true)
    00035                 , iOsclLogger(true)
    00036                 , iOsclScheduler(true)
    00037                 , iErrAlloc(NULL)
    00038                 , iSchedulerAlloc(NULL)
    00039                 , iSchedulerName(NULL)
    00040                 , iSchedulerReserve(10)
    00041                 , iHeapCheck(false)
    00042                 , iOutputFile(NULL)
    00043         {}
    00044
    00045         //this constructor is mainly for back-compatibility with the old OsclInit argument list.
    00046         OsclSelect(Oscl_DefAlloc* erralloc
    00047                    , Oscl_DefAlloc* schedalloc
    00048                    , const char*name
    00049                    , int32 reserve = 10
    00050                                      , bool heapcheck = false
    00051                                                         , FILE* output = NULL)
    00052                 : iOsclBase(true)
    00053                 , iOsclMemory(true)
    00054                 , iOsclErrorTrap(true)
    00055                 , iOsclLogger(true)
    00056                 , iOsclScheduler(true)
    00057                 , iErrAlloc(erralloc)
    00058                 , iSchedulerAlloc(schedalloc)
    00059                 , iSchedulerName(name)
    00060                 , iSchedulerReserve(reserve)
    00061                 , iHeapCheck(heapcheck)
    00062                 , iOutputFile(output)
    00063         {}
    00064
    00065         bool iOsclBase;         //Init/Cleanup OsclBase?
    00066         bool iOsclMemory;       //Init/Cleanup OsclMemory?
    00067         bool iOsclErrorTrap;    //Init/Cleanup OsclErrorTrap?
    00068         bool iOsclLogger;       //Init/Cleanup PVLogger?
    00069         bool iOsclScheduler;    //Init/Cleanup OsclScheduler?
    00070
    00071         Oscl_DefAlloc *iErrAlloc; //Allocator for OsclErrorTrap::Init
    00072         Oscl_DefAlloc *iSchedulerAlloc; //Allocator for OsclScheduler::Init
    00073         const char *iSchedulerName;     //Name for OsclScheduler::Init
    00074         int32 iSchedulerReserve;        //Queue reserve for OsclScheduler::Init
    00075
    00076         bool iHeapCheck; //Do Symbian heap checks?
    00077
    00078         FILE* iOutputFile; //Output file for memory leak report.
    00079 };
    00080
    00084 class OsclInit
    00085 {
    00086     public:
    00097         OSCL_IMPORT_REF static void Init(
    00098             int32& aError
    00099             , const OsclSelect *aSelect = NULL
    00100         );
    00101
    00113         OSCL_IMPORT_REF static void Cleanup(
    00114             int32& aError
    00115             , const OsclSelect *aSelect = NULL
    00116         );
    00117 };
    00118
    00119
    00120 #endif
    00121
    00122