Nebula
|
#include <streamcache.h>
Explicit cache for reusing read-only streams that are already opened.
Main use-case are expensive to open streams like http objects/zips
Inherits Core::RefCounted.
Classes | |
struct | CacheEntry |
Public Member Functions | |
StreamCache () | |
constructor | |
virtual | ~StreamCache () |
destructor | |
bool | IsCached (IO::URI const &uri) const |
Util::KeyValuePair< void *, Ptr< IO::Stream > > | GetCachedStream (IO::URI const &uri) |
bool | OpenStream (IO::URI const &uri, Core::Rtti const &rtti) |
void | RemoveStream (IO::URI const &uri) |
Public Member Functions inherited from Core::RefCounted | |
RefCounted () | |
constructor | |
int | GetRefCount () const |
get the current refcount | |
void | AddRef () |
increment refcount by one | |
void | Release () |
decrement refcount and destroy object if refcount is zero | |
bool | IsInstanceOf (const Rtti &rtti) const |
return true if this object is instance of given class | |
bool | IsInstanceOf (const Util::String &className) const |
return true if this object is instance of given class by string | |
bool | IsInstanceOf (const Util::FourCC &classFourCC) const |
return true if this object is instance of given class by fourcc | |
bool | IsA (const Rtti &rtti) const |
return true if this object is instance of given class, or a derived class | |
bool | IsA (const Util::String &rttiName) const |
return true if this object is instance of given class, or a derived class, by string | |
bool | IsA (const Util::FourCC &rttiFourCC) const |
return true if this object is instance of given class, or a derived class, by fourcc | |
const Util::String & | GetClassName () const |
get the class name | |
Util::FourCC | GetClassFourCC () const |
get the class FourCC code | |
Private Member Functions | |
__DeclareClass (StreamCache) | |
__DeclareSingleton (StreamCache) | |
void | Discard () |
discard | |
Private Attributes | |
Util::Dictionary< Util::String, CacheEntry > | streams |
Additional Inherited Members | |
Static Public Member Functions inherited from Core::RefCounted | |
static void | DumpRefCountingLeaks () |
dump refcounting leaks, call at end of application (NEBULA_DEBUG builds only!) | |
Protected Member Functions inherited from Core::RefCounted | |
virtual | ~RefCounted () |
destructor (called when refcount reaches zero) | |
IO::StreamCache::StreamCache | ( | ) |
constructor
|
virtual |
destructor
|
private |
|
private |
|
private |
discard
Util::KeyValuePair< void *, Ptr< IO::Stream > > IO::StreamCache::GetCachedStream | ( | IO::URI const & | uri | ) |
bool IO::StreamCache::IsCached | ( | IO::URI const & | uri | ) | const |
bool IO::StreamCache::OpenStream | ( | IO::URI const & | uri, |
Core::Rtti const & | rtti ) |
void IO::StreamCache::RemoveStream | ( | IO::URI const & | uri | ) |
|
private |