#ifndef _APPNAME2ID_ #define _APPNAME2ID_ #include "common_types.h" #ifndef _WINDOWS64 #ifndef _HPUX #include #else #include #endif #include #else #include #include #endif #include #include #ifdef _WINDOWS64 #ifdef ODB_API_LIB_EXPORTS #define ODB_API_LIB_API __declspec(dllexport) #else #define ODB_API_LIB_API __declspec(dllimport) #endif #else #define ODB_API_LIB_API #endif #define MAXSIZE 8092 struct ID2NameNode { int app_id; char app_name[32]; struct ID2NameNode * next_pointer; }; class ODB_API_LIB_API CAppNameIDTrans { public : CAppNameIDTrans(); CAppNameIDTrans(const CAppNameIDTrans&); ~CAppNameIDTrans(); //void operator= (const CAppNameIDTrans&); private: #ifndef _WINDOWS64 static pthread_mutex_t s_guard; #else static CRITICAL_SECTION s_guard; #endif static CAppNameIDTrans * s_instance ; ID2NameNode * m_hashTable; ID2NameNode * second; char* m_InitPtr; cmnInt64 * freePos; cmnInt64 freePointer; public: static CAppNameIDTrans * getInstance(); char * getAppNameByID(const int app_id); int createHashTable(); int putData2Table(); }; #endif