См. документацию.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef _GLOBALDATA_H
00009 #define _GLOBALDATA_H
00010 #include <map>
00011 #include <string>
00012 using namespace std;
00013
00014 struct OpenedFilesInfo {
00015
00016 map<unsigned int,unsigned int> file_info;
00017 unsigned int flags;
00018 };
00019
00020 class GlobalData{
00021 private:
00022
00023
00024 GlobalData(){
00025
00026 }
00027
00028
00029
00030 public:
00031 pthread_mutex_t* get_openedFiles_mutex(){
00032 static pthread_mutex_t openedFiles_mutex = PTHREAD_MUTEX_INITIALIZER;
00033 return &openedFiles_mutex;
00034 }
00035
00036 map<string,OpenedFilesInfo>* get_OpenedFiles(){
00037 static map<string,OpenedFilesInfo> openedFiles;
00038 return &openedFiles;
00039 }
00040
00041 static GlobalData* get_Instance(){
00042 static GlobalData gd;
00043 return &gd;
00044 }
00045 };
00046
00047 #endif
00048