/**
* @file Globals.h
* @brief some routines which provide access to global variables
* @author Erik Rodner
* @date 1/1/2008
*/
#ifndef GLOBALSINCLUDE
#define GLOBALSINCLUDE

#include <string>


namespace OBJREC {

/** @brief some routines which provide access to global variables */
class Globals {

  private:

    /** image filename which is currently processed */
    static std::string currentImgFN;

  public:

    /** cache mode: none "none" (<root>/<imgfn>), categories "cat" (<root>/<last-dir-part>/<imgfn>),
        categories_secondpart "cat2" (<root>/<second-last-dir-part>/<imgfn>) */
    enum {
      SORT_NONE = 0,
      SORT_CATEGORIES,
      SORT_CATEGORIES_SECONDPART
    };

    /** set filename of the image which is currently processed */
    static void setCurrentImgFN ( const std::string & imgfn );

    /** get filename of the image which is currently processed */
    static std::string getCurrentImgFN ();

    /** get a filename which can be used for caching
    @param root root directory of the global cache
    @param cache_mode mode of the caching
    @return cache filename
    */
    static std::string getCacheFilename ( const std::string & root, int cache_mode );

    /** get cache mode
    @param desc description of the cache
    @return determined cache mode
    */
    static int getCacheMode ( const std::string & desc );

};


} // namespace

#endif
