Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
DB Class Reference

#include "steam/asset/db.hpp"

Description

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

As of 8/2007 implemented by a hashtable.

Definition at line 87 of file db.hpp.

Public Member Functions

template<class KIND >
lib::P< KIND > get (ID< KIND > hash) const
 
template<class KIND >
void put (ID< KIND > hash, lib::P< KIND > &ptr)
 
void put (ID< Asset > hash, PAsset &ptr)
 
bool del (ID< Asset > hash)
 
void clear ()
 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.
 
void asList (list< PcAsset > &output) const
 intended for diagnostics
 

Friends

class lib::DependencyFactory< DB >
 

Private Member Functions

 DB ()
 
 ~DB ()
 
const PAssetfind (size_t hash) const
 
- Private Member Functions inherited from NonCopyable
 ~NonCopyable ()=default
 
 NonCopyable ()=default
 
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Private Attributes

IdHashtable table
 

Additional Inherited Members

- Static Public Member Functions inherited from Sync< CONF >
static MonitorgetMonitor (Sync const *forThis)
 

Constructor & Destructor Documentation

◆ DB()

DB ( )
inlineprivate

Definition at line 93 of file db.hpp.

◆ ~DB()

~DB ( )
inlineprivate

Definition at line 97 of file db.hpp.

Member Function Documentation

◆ get()

template<class KIND >
lib::P< KIND > get ( ID< KIND >  hash) const
inline

Definition at line 108 of file db.hpp.

References DB::find(), and hash.

Referenced by AssetManager::getAsset(), WrappedStandardExeBuilder::invokeOriginalBuilder(), AssetManager::known(), AssetManager::known(), and AssetManager::wrap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ put() [1/2]

template<class KIND >
void put ( ID< KIND >  hash,
lib::P< KIND > &  ptr 
)
inline

Definition at line 115 of file db.hpp.

References hash, and DB::table.

Referenced by AssetManager::reg().

+ Here is the caller graph for this function:

◆ put() [2/2]

void put ( ID< Asset hash,
PAsset ptr 
)
inline

Definition at line 121 of file db.hpp.

References hash, and DB::table.

◆ del()

bool del ( ID< Asset hash)
inline

Definition at line 127 of file db.hpp.

References hash, and DB::table.

Referenced by AssetManager::remove().

+ Here is the caller graph for this function:

◆ clear()

void clear ( )
inline

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.

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)

Note
EX_FREE

Definition at line 144 of file db.hpp.

References DB::table.

Referenced by AssetManager::clear().

+ Here is the caller graph for this function:

◆ asList()

void asList ( list< PcAsset > &  output) const
inline

intended for diagnostics

Definition at line 159 of file db.hpp.

References DB::table.

Referenced by AssetManager::listContent().

+ Here is the caller graph for this function:

◆ find()

const PAsset & find ( size_t  hash) const
inlineprivate

Definition at line 170 of file db.hpp.

References hash, and DB::table.

Referenced by DB::get().

+ Here is the caller graph for this function:

Member Data Documentation

◆ table

IdHashtable table
private

Definition at line 91 of file db.hpp.

Referenced by DB::asList(), DB::clear(), DB::del(), DB::find(), DB::put(), and DB::put().

Friends And Related Symbol Documentation

◆ lib::DependencyFactory< DB >

friend class lib::DependencyFactory< DB >
friend

Definition at line 97 of file db.hpp.

+ Inheritance diagram for DB:
+ Collaboration diagram for DB:

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