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

# oscl_base.h

Go to the documentation of this file.

    00001 // -*- c++ -*-
    00002 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
    00003
    00004 //                           O S C L _ B A S E
    00005
    00006 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
    00007
    00018 #ifndef OSCL_BASE_H_INCLUDED
    00019 #define OSCL_BASE_H_INCLUDED
    00020
    00021 #include "osclconfig.h"
    00022 #include "oscl_base_macros.h"
    00023 #include "oscl_types.h"
    00024 #include "osclconfig_check.h"
    00025
    00026 #include "pv_config.h"
    00027
    00028 //singleton support derives from global var support.
    00029 #define OSCL_HAS_SINGLETON_SUPPORT 1
    00030
    00031 #ifdef __cplusplus
    00032
    00033 class OsclLockBase;
    00034
    00035 class OsclBase
    00036 {
    00037     public:
    00052         OSCL_IMPORT_REF static int32 Init();
    00053
    00060         OSCL_IMPORT_REF static int32 Cleanup();
    00061 };
    00062
    00068 enum TPVBaseErrorEnum
    00069 {
    00070     EPVErrorBaseNotInstalled = 1
    00071     , EPVErrorBaseAlreadyInstalled = 2
    00072     , EPVErrorBaseOutOfMemory = 3
    00073     , EPVErrorBaseSystemCallFailed = 4
    00074     , EPVErrorBaseTooManyThreads = 5
    00075 };
    00076
    00077 #include "oscl_lock_base.h"
    00078
    00084 #if (OSCL_HAS_BASIC_LOCK)
    00085 class _OsclBasicLock : public OsclLockBase
    00086 {
    00087     public:
    00088
    00092         OSCL_IMPORT_REF _OsclBasicLock();
    00093
    00097         OSCL_IMPORT_REF ~_OsclBasicLock();
    00098
    00103         OSCL_IMPORT_REF void Lock();
    00104
    00109         OSCL_IMPORT_REF void Unlock();
    00110
    00111
    00115         int32 iError;
    00116
    00117     private:
    00118         TOsclBasicLockObject    ObjLock;
    00119
    00120 };
    00121 #else
    00122 typedef OsclNullLock _OsclBasicLock;
    00123 #endif
    00124
    00125 #else
    00126
    00134 void PVOsclBase_Init();
    00135
    00141 void PVOsclBase_Cleanup();
    00142
    00143 #endif
    00144
    00147 #endif  // OSCL_BASE_H_INCLUDED