degate  0.1.2
Public Member Functions | Private Member Functions | Friends
degate::Configuration Class Reference

#include <Configuration.h>

Inheritance diagram for degate::Configuration:
Inheritance graph
[legend]

List of all members.

Public Member Functions

std::string get_temp_directory () const
 Get the temp directory for degate.
size_t get_max_tile_cache_size () const
 Get the cache size for image tiles in MB.
std::string get_servers_uri_pattern () const
 Get the URI address pattern for the collaboration server.

Private Member Functions

 Configuration ()

Friends

class SingletonBase< Configuration >

Detailed Description

Definition at line 39 of file Configuration.h.


Constructor & Destructor Documentation

Definition at line 34 of file Configuration.cc.

                             {
}

Member Function Documentation

Get the cache size for image tiles in MB.

Returns:
If the environment variable DEGATE_CACHE_SIZE is set, its value. Else the default cache size is returned. That is 256 MB.

Definition at line 43 of file Configuration.cc.

Referenced by degate::GlobalTileCache::GlobalTileCache().

                                                    {
  char * cs = getenv("DEGATE_CACHE_SIZE");
  if(cs == NULL) return 256;
  return boost::lexical_cast<size_t>(cs);
}

Here is the caller graph for this function:

Get the URI address pattern for the collaboration server.

It is a pattern, because it holds a placeholder for the channel ID. This channel ID identifies a shared project. The pattern is a format string for boost::format.

Returns:
If the environment variable DEGATE_SERVER_URI_PATTERN is set, its value. Else the default URI pattern is returned.

Definition at line 49 of file Configuration.cc.

                                                       {
  char * uri_pattern = getenv("DEGATE_SERVER_URI_PATTERN");
  if(uri_pattern == NULL) return "http://localhost/cgi-bin/test.pl?channel=%1%";
  return uri_pattern;
}
std::string Configuration::get_temp_directory ( ) const

Get the temp directory for degate.

Returns:
If the environment variable DEGATE_TEMP_DIR is set, its value. Else the default temp directory "/tmp" is returned.

Definition at line 37 of file Configuration.cc.

References degate::get_realpath().

Referenced by degate::get_temp_directory().

                                                  {
  char * td = getenv("DEGATE_TEMP_DIR");
  if(td == NULL) return get_realpath(std::string("/tmp"));
  return get_realpath(std::string(td));
}

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class SingletonBase< Configuration > [friend]

Definition at line 41 of file Configuration.h.


The documentation for this class was generated from the following files: