Public Types | Public Member Functions | Protected Member Functions | List of all members
iproc::TFileCachedProducerCompBase< Key, CacheObject > Class Template Referenceabstract

Template base implementation iproc::TILockedProducer caching (buffering) objects using file system. More...

#include <TFileCachedProducerCompBase.h>

Inheritance diagram for iproc::TFileCachedProducerCompBase< Key, CacheObject >:
icomp::CComponentBase iproc::TILockedProducer< Key, CacheObject > icomp::IComponent istd::IPolymorphic istd::IPolymorphic

Public Types

typedef icomp::CComponentBase BaseClass
 
typedef TILockedProducer< Key,
CacheObject > 
LockedProducerType
 

Public Member Functions

virtual const CacheObject * ProduceLockedObject (const Key &key)
 Begin of accessing to cached element. More...
 
virtual void UnlockObject (const CacheObject *objectPtr)
 End of accessing to cached element. More...
 
- Public Member Functions inherited from icomp::IComponent
virtual const ICompositeComponentGetParentComponent (bool ownerOnly=false) const =0
 
virtual void * GetInterface (const istd::CClassInfo &interfaceType, const QByteArray &subId="")=0
 
virtual const IComponentContextGetComponentContext () const =0
 
virtual void SetComponentContext (const icomp::IComponentContext *contextPtr, const ICompositeComponent *parentPtr, bool isParentOwner)=0
 

Protected Member Functions

bool PushKeyBack (const Key &key)
 
void CleanFileList ()
 Removes cache files if there is too many of them. More...
 
virtual void OnCacheFileSaved (const Key &key, const QString &cacheFilePath)
 
virtual void OnCacheFileRemoved (const Key &key, const QString &cacheFilePath)
 
virtual QString CalcCacheFilePath (const Key &key) const =0
 Calculate unique file path of temporary file cache object. More...
 
virtual int GetMaxCachedFilesCount () const =0
 Get number of maximal cached files. More...
 

Detailed Description

template<class Key, class CacheObject>
class iproc::TFileCachedProducerCompBase< Key, CacheObject >

Template base implementation iproc::TILockedProducer caching (buffering) objects using file system.

Please note, that no memory caching is done - if you ask second time of existing (locked) object, second instance will be created and loaded.

Definition at line 27 of file TFileCachedProducerCompBase.h.

Member Typedef Documentation

template<class Key , class CacheObject >
typedef icomp::CComponentBase iproc::TFileCachedProducerCompBase< Key, CacheObject >::BaseClass

Definition at line 32 of file TFileCachedProducerCompBase.h.

template<class Key , class CacheObject >
typedef TILockedProducer<Key, CacheObject> iproc::TFileCachedProducerCompBase< Key, CacheObject >::LockedProducerType

Definition at line 33 of file TFileCachedProducerCompBase.h.

Member Function Documentation

template<class Key , class CacheObject >
virtual QString iproc::TFileCachedProducerCompBase< Key, CacheObject >::CalcCacheFilePath ( const Key &  key) const
protectedpure virtual

Calculate unique file path of temporary file cache object.

template<class Key , class CacheObject >
void iproc::TFileCachedProducerCompBase< Key, CacheObject >::CleanFileList ( )
protected

Removes cache files if there is too many of them.

Definition at line 184 of file TFileCachedProducerCompBase.h.

Referenced by iproc::TFileCachedProducerCompBase< Key, CacheObject >::ProduceLockedObject().

template<class Key , class CacheObject >
virtual int iproc::TFileCachedProducerCompBase< Key, CacheObject >::GetMaxCachedFilesCount ( ) const
protectedpure virtual

Get number of maximal cached files.

template<class Key , class CacheObject >
void iproc::TFileCachedProducerCompBase< Key, CacheObject >::OnCacheFileRemoved ( const Key &  key,
const QString &  cacheFilePath 
)
protectedvirtual

Definition at line 215 of file TFileCachedProducerCompBase.h.

template<class Key , class CacheObject >
void iproc::TFileCachedProducerCompBase< Key, CacheObject >::OnCacheFileSaved ( const Key &  key,
const QString &  cacheFilePath 
)
protectedvirtual

Definition at line 209 of file TFileCachedProducerCompBase.h.

template<class Key , class CacheObject >
const CacheObject * iproc::TFileCachedProducerCompBase< Key, CacheObject >::ProduceLockedObject ( const Key &  key)
virtual
template<class Key , class CacheObject >
bool iproc::TFileCachedProducerCompBase< Key, CacheObject >::PushKeyBack ( const Key &  key)
protected

Definition at line 167 of file TFileCachedProducerCompBase.h.

template<class Key , class CacheObject >
void iproc::TFileCachedProducerCompBase< Key, CacheObject >::UnlockObject ( const CacheObject *  objectPtr)
virtual

End of accessing to cached element.

Implements iproc::TILockedProducer< Key, CacheObject >.

Definition at line 145 of file TFileCachedProducerCompBase.h.

References NULL.


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

© 2007-2017 Witold Gantzke and Kirill Lepskiy