Nebula
Loading...
Searching...
No Matches
IO::StreamCache Class Reference

#include <streamcache.h>

Detailed Description

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::StringGetClassName () 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, CacheEntrystreams
 

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)
 

Constructor & Destructor Documentation

◆ StreamCache()

IO::StreamCache::StreamCache ( )

constructor

◆ ~StreamCache()

IO::StreamCache::~StreamCache ( )
virtual

destructor

Member Function Documentation

◆ __DeclareClass()

IO::StreamCache::__DeclareClass ( StreamCache )
private

◆ __DeclareSingleton()

IO::StreamCache::__DeclareSingleton ( StreamCache )
private

◆ Discard()

void IO::StreamCache::Discard ( )
private

discard

◆ GetCachedStream()

Util::KeyValuePair< void *, Ptr< IO::Stream > > IO::StreamCache::GetCachedStream ( IO::URI const & uri)

◆ IsCached()

bool IO::StreamCache::IsCached ( IO::URI const & uri) const

◆ OpenStream()

bool IO::StreamCache::OpenStream ( IO::URI const & uri,
Core::Rtti const & rtti )

◆ RemoveStream()

void IO::StreamCache::RemoveStream ( IO::URI const & uri)

Member Data Documentation

◆ streams

Util::Dictionary<Util::String, CacheEntry> IO::StreamCache::streams
private

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