HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NET_ICache Class Referenceabstract

#include <NET_Cache.h>

+ Inheritance diagram for NET_ICache:

Public Types

using int_def_clb_t = UT_Function< int(UT_ErrorCode &ec)>
 
using str_def_clb_t = UT_Function< UT_StringHolder(UT_ErrorCode &ec)>
 

Public Member Functions

virtual ~NET_ICache ()=default
 
 UT_NON_COPYABLE (NET_ICache)
 
virtual int64 getBackendTimeout (int64 timeout=-1)
 
UT_StringHolder makeKey (const UT_StringHolder &key, int version=-1)
 
virtual bool add (const UT_StringHolder &key, int value, UT_ErrorCode *ec=nullptr, int64 timeout=-1, int version=-1)
 
virtual bool add (const UT_StringHolder &key, const UT_StringHolder &value, UT_ErrorCode *ec=nullptr, int64 timeout=-1, int version=-1)=0
 
virtual bool get (const UT_StringRef &key, int &value, int def=-1, UT_ErrorCode *ec=nullptr, int version=-1)
 
virtual bool get (const UT_StringRef &key, UT_StringHolder &value, const UT_StringHolder &def=UT_StringHolder::theEmptyString, UT_ErrorCode *ec=nullptr, int version=-1)=0
 
virtual bool set (const UT_StringHolder &key, int value, UT_ErrorCode *ec=nullptr, int64 timeout=-1, int version=-1)
 
virtual bool set (const UT_StringHolder &key, const UT_StringHolder &value, UT_ErrorCode *ec=nullptr, int64 timeout=-1, int version=-1)=0
 
virtual bool touch (const UT_StringRef &key, UT_ErrorCode *ec=nullptr, int timeout=-1, int version=-1)=0
 
virtual bool remove (const UT_StringRef &key, UT_ErrorCode *ec=nullptr, int version=-1)=0
 
virtual void getMany (const UT_StringArray &keys, UT_Map< UT_StringHolder, UT_StringHolder > &results, UT_ErrorCode *ec=nullptr, int version=-1)
 
virtual void getMany (const UT_StringArray &keys, UT_Map< UT_StringHolder, int > &results, UT_ErrorCode *ec=nullptr, int version=-1)
 
virtual int getOrSet (const UT_StringRef &key, int_def_clb_t &&clb, UT_ErrorCode &ec, int64 timeout=-1, int version=-1)
 
virtual int getOrSet (const UT_StringRef &key, int def, UT_ErrorCode *ec=nullptr, int64 timeout=-1, int version=-1)
 
virtual UT_StringHolder getOrSet (const UT_StringRef &key, str_def_clb_t &&clb, UT_ErrorCode &ec, int64 timeout=-1, int version=-1)
 
virtual UT_StringHolder getOrSet (const UT_StringRef &key, const UT_StringHolder &def, UT_ErrorCode *ec=nullptr, int64 timeout=-1, int version=-1)
 
virtual bool hasKey (const UT_StringRef &key, UT_ErrorCode *ec=nullptr, int version=-1)
 
virtual bool incr (const UT_StringRef &key, int &value, int delta=1, UT_ErrorCode *ec=nullptr, int version=-1)
 
virtual bool decr (const UT_StringRef &key, int &value, int delta=1, UT_ErrorCode *ec=nullptr, int version=-1)
 
virtual UT_StringArray setMany (const UT_Map< UT_StringHolder, UT_StringHolder > &data, int64 timeout=-1, int version=-1)
 
virtual UT_StringArray setMany (const UT_Map< UT_StringHolder, int > &data, int64 timeout=-1, int version=-1)
 
virtual void removeMany (const UT_StringArray &keys, UT_ErrorCode *ec, int version=-1)
 
virtual void clear (UT_ErrorCode *ec=nullptr)=0
 
virtual int incrVersion (const UT_StringRef &key, int delta=1, UT_ErrorCode *ec=nullptr, int version=-1)
 
virtual int decrVersion (const UT_StringRef &key, int delta=1, UT_ErrorCode *ec=nullptr, int version=-1)
 
virtual void close (UT_ErrorCode *ec=nullptr)
 

Protected Member Functions

 NET_ICache ()=default
 
virtual UT_StringHolder generateKey (const UT_StringHolder &key_prefix, const UT_StringHolder &key, int version)
 

Protected Attributes

int myDefaultTimeout = 300
 
int myMaxEntries = 300
 
int myCullFequency = 3
 
UT_StringHolder myKeyPrefix
 
int myDefaultVersion = 1
 

Detailed Description

Definition at line 29 of file NET_Cache.h.

Member Typedef Documentation

Definition at line 32 of file NET_Cache.h.

Constructor & Destructor Documentation

virtual NET_ICache::~NET_ICache ( )
virtualdefault
NET_ICache::NET_ICache ( )
protecteddefault

Member Function Documentation

virtual bool NET_ICache::add ( const UT_StringHolder key,
int  value,
UT_ErrorCode ec = nullptr,
int64  timeout = -1,
int  version = -1 
)
inlinevirtual

Reimplemented in NET_DatabaseCache.

Definition at line 55 of file NET_Cache.h.

virtual bool NET_ICache::add ( const UT_StringHolder key,
const UT_StringHolder value,
UT_ErrorCode ec = nullptr,
int64  timeout = -1,
int  version = -1 
)
pure virtual

Implemented in NET_DatabaseCache.

virtual void NET_ICache::clear ( UT_ErrorCode ec = nullptr)
pure virtual

Implemented in NET_DatabaseCache.

virtual void NET_ICache::close ( UT_ErrorCode ec = nullptr)
inlinevirtual

Reimplemented in NET_DatabaseCache.

Definition at line 336 of file NET_Cache.h.

virtual bool NET_ICache::decr ( const UT_StringRef key,
int value,
int  delta = 1,
UT_ErrorCode ec = nullptr,
int  version = -1 
)
inlinevirtual

Definition at line 264 of file NET_Cache.h.

virtual int NET_ICache::decrVersion ( const UT_StringRef key,
int  delta = 1,
UT_ErrorCode ec = nullptr,
int  version = -1 
)
inlinevirtual

Definition at line 327 of file NET_Cache.h.

virtual UT_StringHolder NET_ICache::generateKey ( const UT_StringHolder key_prefix,
const UT_StringHolder key,
int  version 
)
inlineprotectedvirtual

Definition at line 341 of file NET_Cache.h.

virtual bool NET_ICache::get ( const UT_StringRef key,
int value,
int  def = -1,
UT_ErrorCode ec = nullptr,
int  version = -1 
)
inlinevirtual

Reimplemented in NET_DatabaseCache.

Definition at line 73 of file NET_Cache.h.

virtual bool NET_ICache::get ( const UT_StringRef key,
UT_StringHolder value,
const UT_StringHolder def = UT_StringHolder::theEmptyString,
UT_ErrorCode ec = nullptr,
int  version = -1 
)
pure virtual

Implemented in NET_DatabaseCache.

virtual int64 NET_ICache::getBackendTimeout ( int64  timeout = -1)
inlinevirtual

Definition at line 38 of file NET_Cache.h.

virtual void NET_ICache::getMany ( const UT_StringArray keys,
UT_Map< UT_StringHolder, UT_StringHolder > &  results,
UT_ErrorCode ec = nullptr,
int  version = -1 
)
inlinevirtual

Reimplemented in NET_DatabaseCache.

Definition at line 127 of file NET_Cache.h.

virtual void NET_ICache::getMany ( const UT_StringArray keys,
UT_Map< UT_StringHolder, int > &  results,
UT_ErrorCode ec = nullptr,
int  version = -1 
)
inlinevirtual

Reimplemented in NET_DatabaseCache.

Definition at line 144 of file NET_Cache.h.

virtual int NET_ICache::getOrSet ( const UT_StringRef key,
int_def_clb_t &&  clb,
UT_ErrorCode ec,
int64  timeout = -1,
int  version = -1 
)
inlinevirtual

Definition at line 160 of file NET_Cache.h.

virtual int NET_ICache::getOrSet ( const UT_StringRef key,
int  def,
UT_ErrorCode ec = nullptr,
int64  timeout = -1,
int  version = -1 
)
inlinevirtual

Definition at line 182 of file NET_Cache.h.

virtual UT_StringHolder NET_ICache::getOrSet ( const UT_StringRef key,
str_def_clb_t &&  clb,
UT_ErrorCode ec,
int64  timeout = -1,
int  version = -1 
)
inlinevirtual

Definition at line 199 of file NET_Cache.h.

virtual UT_StringHolder NET_ICache::getOrSet ( const UT_StringRef key,
const UT_StringHolder def,
UT_ErrorCode ec = nullptr,
int64  timeout = -1,
int  version = -1 
)
inlinevirtual

Definition at line 221 of file NET_Cache.h.

virtual bool NET_ICache::hasKey ( const UT_StringRef key,
UT_ErrorCode ec = nullptr,
int  version = -1 
)
inlinevirtual

Definition at line 241 of file NET_Cache.h.

virtual bool NET_ICache::incr ( const UT_StringRef key,
int value,
int  delta = 1,
UT_ErrorCode ec = nullptr,
int  version = -1 
)
inlinevirtual

Reimplemented in NET_DatabaseCache.

Definition at line 250 of file NET_Cache.h.

virtual int NET_ICache::incrVersion ( const UT_StringRef key,
int  delta = 1,
UT_ErrorCode ec = nullptr,
int  version = -1 
)
inlinevirtual

Definition at line 305 of file NET_Cache.h.

UT_StringHolder NET_ICache::makeKey ( const UT_StringHolder key,
int  version = -1 
)
inline

Definition at line 46 of file NET_Cache.h.

virtual bool NET_ICache::remove ( const UT_StringRef key,
UT_ErrorCode ec = nullptr,
int  version = -1 
)
pure virtual

Implemented in NET_DatabaseCache.

virtual void NET_ICache::removeMany ( const UT_StringArray keys,
UT_ErrorCode ec,
int  version = -1 
)
inlinevirtual

Reimplemented in NET_DatabaseCache.

Definition at line 296 of file NET_Cache.h.

virtual bool NET_ICache::set ( const UT_StringHolder key,
int  value,
UT_ErrorCode ec = nullptr,
int64  timeout = -1,
int  version = -1 
)
inlinevirtual

Reimplemented in NET_DatabaseCache.

Definition at line 99 of file NET_Cache.h.

virtual bool NET_ICache::set ( const UT_StringHolder key,
const UT_StringHolder value,
UT_ErrorCode ec = nullptr,
int64  timeout = -1,
int  version = -1 
)
pure virtual

Implemented in NET_DatabaseCache.

virtual UT_StringArray NET_ICache::setMany ( const UT_Map< UT_StringHolder, UT_StringHolder > &  data,
int64  timeout = -1,
int  version = -1 
)
inlinevirtual

Definition at line 274 of file NET_Cache.h.

virtual UT_StringArray NET_ICache::setMany ( const UT_Map< UT_StringHolder, int > &  data,
int64  timeout = -1,
int  version = -1 
)
inlinevirtual

Definition at line 285 of file NET_Cache.h.

virtual bool NET_ICache::touch ( const UT_StringRef key,
UT_ErrorCode ec = nullptr,
int  timeout = -1,
int  version = -1 
)
pure virtual

Implemented in NET_DatabaseCache.

NET_ICache::UT_NON_COPYABLE ( NET_ICache  )

Member Data Documentation

int NET_ICache::myCullFequency = 3
protected

Definition at line 357 of file NET_Cache.h.

int NET_ICache::myDefaultTimeout = 300
protected

Definition at line 355 of file NET_Cache.h.

int NET_ICache::myDefaultVersion = 1
protected

Definition at line 360 of file NET_Cache.h.

UT_StringHolder NET_ICache::myKeyPrefix
protected

Definition at line 359 of file NET_Cache.h.

int NET_ICache::myMaxEntries = 300
protected

Definition at line 356 of file NET_Cache.h.


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