BBS2chProxyThreadInfo.h 773 B

123456789101112131415161718192021222324252627282930
  1. #pragma once
  2. #include "DataStorage.h"
  3. #include <map>
  4. #include <string>
  5. #if (defined(__clang__) && defined(_LIBCPP_VERSION)) || (__cplusplus >= 201103L)
  6. #include <memory>
  7. #else
  8. #include <tr1/memory>
  9. #endif
  10. struct BBS2chProxyThreadInfo
  11. {
  12. int lastResNum;
  13. int cachedSize;
  14. DataStorage *cachedData;
  15. BBS2chProxyThreadInfo() : lastResNum(0), cachedSize(0), cachedData(NULL) {};
  16. ~BBS2chProxyThreadInfo()
  17. {
  18. if(cachedData) delete cachedData;
  19. }
  20. };
  21. #if (defined(__clang__) && defined(_LIBCPP_VERSION)) || (__cplusplus >= 201103L)
  22. typedef std::shared_ptr<BBS2chProxyThreadInfo> PBBS2chProxyThreadInfo;
  23. #else
  24. typedef std::tr1::shared_ptr<BBS2chProxyThreadInfo> PBBS2chProxyThreadInfo;
  25. #endif
  26. typedef std::map<const std::string, PBBS2chProxyThreadInfo> BBS2chProxyThreadCache;