asset::DB Class Reference

Implementation of the registry holding all Asset instances known to the Asset Manager subsystem. More...

#include <db.hpp>

List of all members.

Public Member Functions

void asList (list< PcAsset > &output) const
 intended for diagnostics
void clear () throw ()
 removes all registered assets and does something similar to Asset::unlink() on each to break cyclic dependencies (we can't use the real unlink()-function, because this will propagate, including calls to the AssetManager.
bool del (ID< Asset > hash)
template<class KIND>
P< KIND > get (ID< KIND > hash) const
void put (ID< Asset > hash, PAsset &ptr)
template<class KIND>
void put (ID< KIND > hash, P< KIND > &ptr)

Private Member Functions

const PAssetfind (size_t hash) const

Private Attributes

IdHashtable table

Friends

class lumiera::singleton::StaticCreate< DB >


Detailed Description

As of 8/2007 implemented by a hashtable.

Definition at line 86 of file db.hpp.


Member Function Documentation

void asset::DB::clear (  )  throw () [inline]

As the destructor of DB needs to call clear(), this could result in segfaults. This doesn't seem to be a problem, though, because we register and process all assets and the net effect is just breaking any cyclic dependencies)

Definition at line 120 of file db.hpp.

References lumiera::Error::what().

00121         {
00122           try
00123             {
00124               IdHashtable::iterator i = table.begin(); 
00125               IdHashtable::iterator e = table.end(); 
00126               for ( ; i!=e ; ++i )
00127                 i->second->dependants.clear();
00128               
00129               table.clear();
00130             }
00131           catch (lumiera::Error& EX)
00132             {
00133               WARN (oper, "Problems while clearing Asset registry: %s", EX.what());
00134             }
00135           catch (...)
00136             {
00137               ERROR (oper, "Serious trouble while clearing Asset registry.");
00138         }   }

Here is the call graph for this function:


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

Generated on Sat Aug 16 18:10:41 2008 for Lumiera by  doxygen 1.5.5