ResourceManager Class Reference

Static resource manager synchronized across all Milton threads, containing references to loaded images, global logging utilities, and user-definable options which may be used to affect Milton functionality. Many user-definable options that are supported are aimed at dynamic, on-the-fly debugging changes (whether or not to preview kd-Trees built from Meshes, for instance). More...

#include <ResourceManager.h>

List of all members.

Static Public Member Functions

External image cache
static ImagePtr getImage (const std::string &filename)
 Loads the requested image from the given file, retaining a global cache of all previously loaded images to default to upon future calls to 'getImage'.
static void cleanup ()
 Attempts to synchronously clean up all resources which are not currently in use, flushing the static cache of any currently unused images.
Thread-local resources map
static bool containsThreadLocal (const std::string &key)
template<typename T>
static void insertThreadLocal (const std::string &key, const T &value)
template<typename T>
static T & getValueThreadLocal (const std::string &key)
template<typename T>
static T & getValueThreadLocal (const std::string &key, const T &defaultValue)
Global user-definable options
static bool contains (const std::string &key)
template<typename T>
static void insert (const std::string &key, const T &value)
template<typename T>
static T & getValue (const std::string &key)
template<typename T>
static T & getValue (const std::string &key, const T &defaultValue)

Static Public Attributes

Global logging interface
static Log log
Global external shared library manager (for plugins)
static SharedLibraryManagermanager


Detailed Description

Static resource manager synchronized across all Milton threads, containing references to loaded images, global logging utilities, and user-definable options which may be used to affect Milton functionality. Many user-definable options that are supported are aimed at dynamic, on-the-fly debugging changes (whether or not to preview kd-Trees built from Meshes, for instance).

Author:
Travis Fischer (fisch0920@gmail.com)

Matthew Jacobs (jacobs.mh@gmail.com)

Date:
Fall 2008

Definition at line 33 of file ResourceManager.h.


Member Function Documentation

static ImagePtr ResourceManager::getImage ( const std::string &  filename  )  [inline, static]

Loads the requested image from the given file, retaining a global cache of all previously loaded images to default to upon future calls to 'getImage'.

Returns:
a reference to an Image upon success or an empty reference upon failure

Definition at line 47 of file ResourceManager.h.

void ResourceManager::cleanup (  )  [static]

Attempts to synchronously clean up all resources which are not currently in use, flushing the static cache of any currently unused images.

Definition at line 34 of file ResourceManager.cpp.

static bool ResourceManager::containsThreadLocal ( const std::string &  key  )  [inline, static]

Definition at line 80 of file ResourceManager.h.

template<typename T>
static void ResourceManager::insertThreadLocal ( const std::string &  key,
const T &  value 
) [inline, static]

Definition at line 91 of file ResourceManager.h.

template<typename T>
static T& ResourceManager::getValueThreadLocal ( const std::string &  key  )  [inline, static]

Definition at line 100 of file ResourceManager.h.

template<typename T>
static T& ResourceManager::getValueThreadLocal ( const std::string &  key,
const T &  defaultValue 
) [inline, static]

Definition at line 108 of file ResourceManager.h.

static bool ResourceManager::contains ( const std::string &  key  )  [inline, static]

Definition at line 127 of file ResourceManager.h.

template<typename T>
static void ResourceManager::insert ( const std::string &  key,
const T &  value 
) [inline, static]

Definition at line 134 of file ResourceManager.h.

template<typename T>
static T& ResourceManager::getValue ( const std::string &  key  )  [inline, static]

Definition at line 141 of file ResourceManager.h.

template<typename T>
static T& ResourceManager::getValue ( const std::string &  key,
const T &  defaultValue 
) [inline, static]

Definition at line 148 of file ResourceManager.h.


Member Data Documentation

Definition at line 120 of file ResourceManager.h.

Initial value:

 
   new SharedLibraryManager(ResourceManager::s_sharedLibraryPlatform)

Definition at line 159 of file ResourceManager.h.


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

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6