Globals.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * @file Globals.h
  3. * @brief some routines which provide access to global variables
  4. * @author Erik Rodner
  5. * @date 1/1/2008
  6. */
  7. #ifndef GLOBALSINCLUDE
  8. #define GLOBALSINCLUDE
  9. #include <string>
  10. namespace OBJREC {
  11. /** @brief some routines which provide access to global variables */
  12. class Globals {
  13. private:
  14. /** image filename which is currently processed */
  15. static std::string currentImgFN;
  16. public:
  17. /** cache mode: none "none" (<root>/<imgfn>), categories "cat" (<root>/<last-dir-part>/<imgfn>),
  18. categories_secondpart "cat2" (<root>/<second-last-dir-part>/<imgfn>) */
  19. enum {
  20. SORT_NONE = 0,
  21. SORT_CATEGORIES,
  22. SORT_CATEGORIES_SECONDPART
  23. };
  24. /** set filename of the image which is currently processed */
  25. static void setCurrentImgFN ( const std::string & imgfn );
  26. /** get filename of the image which is currently processed */
  27. static std::string getCurrentImgFN ();
  28. /** get a filename which can be used for caching
  29. @param root root directory of the global cache
  30. @param cache_mode mode of the caching
  31. @return cache filename
  32. */
  33. static std::string getCacheFilename ( const std::string & root, int cache_mode );
  34. /** get cache mode
  35. @param desc description of the cache
  36. @return determined cache mode
  37. */
  38. static int getCacheMode ( const std::string & desc );
  39. };
  40. } // namespace
  41. #endif