degate  0.1.2
Configuration.h
Go to the documentation of this file.
00001 /* -*-c++-*-
00002 
00003  This file is part of the IC reverse engineering tool degate.
00004 
00005  Copyright 2008, 2009, 2010 by Martin Schobert
00006 
00007  Degate is free software: you can redistribute it and/or modify
00008  it under the terms of the GNU General Public License as published by
00009  the Free Software Foundation, either version 3 of the License, or
00010  any later version.
00011 
00012  Degate is distributed in the hope that it will be useful,
00013  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  GNU General Public License for more details.
00016 
00017  You should have received a copy of the GNU General Public License
00018  along with degate. If not, see <http://www.gnu.org/licenses/>.
00019 
00020 */
00021 
00022 #ifndef __CONFIGURATION_H__
00023 #define __CONFIGURATION_H__
00024 
00025 #include <globals.h>
00026 #include <SingletonBase.h>
00027 
00028 namespace degate {
00029 
00030   /**
00031    * Get the temp directory.
00032    * This is a shortcut for
00033    * \p (Configuration::get_instance()).get_temp_directory() .
00034    */
00035 
00036   std::string get_temp_directory();
00037 
00038 
00039   class Configuration : public SingletonBase<Configuration> {
00040 
00041     friend class SingletonBase<Configuration>;
00042 
00043   private:
00044 
00045     Configuration();
00046 
00047   public:
00048 
00049     /**
00050      * Get the temp directory for degate.
00051      * @return If the environment variable DEGATE_TEMP_DIR is set,
00052      *   its value. Else the default temp directory "/tmp"
00053      *   is returned.
00054      */
00055     std::string get_temp_directory() const;
00056 
00057     /**
00058      * Get the cache size for image tiles in MB.
00059      * @return If the environment variable DEGATE_CACHE_SIZE is set,
00060      *   its value. Else the default cache size is returned.
00061      *   That is 256 MB.
00062      */
00063     size_t get_max_tile_cache_size() const;
00064 
00065 
00066     /**
00067      * Get the URI address pattern for the collaboration server.
00068      * It is a pattern, because it holds a placeholder for the channel ID.
00069      * This channel ID identifies a shared project. The pattern is a
00070      * format string for boost::format.
00071      * @return If the environment variable DEGATE_SERVER_URI_PATTERN is set,
00072      *   its value. Else the default URI pattern is returned.
00073      */
00074 
00075     std::string get_servers_uri_pattern() const;
00076 
00077   };
00078 
00079 }
00080 
00081 #endif