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

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 #ifdef USE_CML2_CONFIG
00027 #include "pv_config.h"
00028 #endif
00029 
00030 //singleton support derives from global var support.
00031 #define OSCL_HAS_SINGLETON_SUPPORT 1
00032 
00033 #ifdef __cplusplus
00034 
00035 class OsclLockBase;
00036 
00037 class OsclBase
00038 {
00039     public:
00054         OSCL_IMPORT_REF static int32 Init();
00055 
00062         OSCL_IMPORT_REF static int32 Cleanup();
00063 };
00064 
00070 enum TPVBaseErrorEnum
00071 {
00072     EPVErrorBaseNotInstalled = 1
00073     , EPVErrorBaseAlreadyInstalled = 2
00074     , EPVErrorBaseOutOfMemory = 3
00075     , EPVErrorBaseSystemCallFailed = 4
00076     , EPVErrorBaseTooManyThreads = 5
00077 };
00078 
00079 #include "oscl_lock_base.h"
00080 
00086 #if (OSCL_HAS_BASIC_LOCK)
00087 class _OsclBasicLock : public OsclLockBase
00088 {
00089     public:
00090 
00094         OSCL_IMPORT_REF _OsclBasicLock();
00095 
00099         OSCL_IMPORT_REF ~_OsclBasicLock();
00100 
00105         OSCL_IMPORT_REF void Lock();
00106 
00111         OSCL_IMPORT_REF void Unlock();
00112 
00113 
00117         int32 iError;
00118 
00119     private:
00120         TOsclBasicLockObject    ObjLock;
00121 
00122 };
00123 #else
00124 typedef OsclNullLock _OsclBasicLock;
00125 #endif
00126 
00127 #else
00128 
00136 void PVOsclBase_Init();
00137 
00143 void PVOsclBase_Cleanup();
00144 
00145 #endif
00146 
00149 #endif  // OSCL_BASE_H_INCLUDED

OSCL API
Posting Version: OPENCORE_20090310