HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NET_DatabaseCache Class Referencefinal

#include <NET_Cache.h>

+ Inheritance diagram for NET_DatabaseCache:

Public Member Functions

 NET_DatabaseCache (const UT_StringHolder &table_name)
 
 ~NET_DatabaseCache () override
 
 UT_NON_COPYABLE (NET_DatabaseCache)
 
bool open (UT_SqlOrm &orm, UT_ErrorCode &ec)
 
bool add (const UT_StringHolder &key, int value, UT_ErrorCode *ec=nullptr, int64 timeout=-1, int version=-1) override
 
bool add (const UT_StringHolder &key, const UT_StringHolder &value, UT_ErrorCode *ec=nullptr, int64 timeout=-1, int version=-1) override
 
bool get (const UT_StringRef &key, int &value, int def=-1, UT_ErrorCode *ec=nullptr, int version=-1) override
 
bool get (const UT_StringRef &key, UT_StringHolder &value, const UT_StringHolder &def=UT_StringHolder::theEmptyString, UT_ErrorCode *ec=nullptr, int version=-1) override
 
void getMany (const UT_StringArray &keys, UT_Map< UT_StringHolder, UT_StringHolder > &results, UT_ErrorCode *ec=nullptr, int version=-1) override
 
void getMany (const UT_StringArray &keys, UT_Map< UT_StringHolder, int > &results, UT_ErrorCode *ec=nullptr, int version=-1) override
 
bool set (const UT_StringHolder &key, const UT_StringHolder &value, UT_ErrorCode *ec=nullptr, int64 timeout=-1, int version=-1) override
 
bool set (const UT_StringHolder &key, int value, UT_ErrorCode *ec=nullptr, int64 timeout=-1, int version=-1) override
 
bool touch (const UT_StringRef &key, UT_ErrorCode *ec=nullptr, int timeout=-1, int version=-1) override
 
bool remove (const UT_StringRef &key, UT_ErrorCode *ec=nullptr, int version=-1) override
 
void removeMany (const UT_StringArray &keys, UT_ErrorCode *ec=nullptr, int version=-1) override
 
void clear (UT_ErrorCode *ec=nullptr) override
 
void close (UT_ErrorCode *ec=nullptr) override
 
bool incr (const UT_StringRef &key, int &value, int delta=1, UT_ErrorCode *ec=nullptr, int version=-1) override
 
- Public Member Functions inherited from NET_ICache
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 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 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 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)
 

Additional Inherited Members

- Public Types inherited from NET_ICache
using int_def_clb_t = UT_Function< int(UT_ErrorCode &ec)>
 
using str_def_clb_t = UT_Function< UT_StringHolder(UT_ErrorCode &ec)>
 
- Protected Member Functions inherited from NET_ICache
 NET_ICache ()=default
 
virtual UT_StringHolder generateKey (const UT_StringHolder &key_prefix, const UT_StringHolder &key, int version)
 
- Protected Attributes inherited from NET_ICache
int myDefaultTimeout = 300
 
int myMaxEntries = 300
 
int myCullFequency = 3
 
UT_StringHolder myKeyPrefix
 
int myDefaultVersion = 1
 

Detailed Description

Definition at line 364 of file NET_Cache.h.

Constructor & Destructor Documentation

NET_DatabaseCache::NET_DatabaseCache ( const UT_StringHolder table_name)
NET_DatabaseCache::~NET_DatabaseCache ( )
override

Member Function Documentation

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

Reimplemented from NET_ICache.

Definition at line 374 of file NET_Cache.h.

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

Implements NET_ICache.

void NET_DatabaseCache::clear ( UT_ErrorCode ec = nullptr)
overridevirtual

Implements NET_ICache.

void NET_DatabaseCache::close ( UT_ErrorCode ec = nullptr)
overridevirtual

Reimplemented from NET_ICache.

bool NET_DatabaseCache::get ( const UT_StringRef key,
int value,
int  def = -1,
UT_ErrorCode ec = nullptr,
int  version = -1 
)
overridevirtual

Reimplemented from NET_ICache.

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

Implements NET_ICache.

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

Reimplemented from NET_ICache.

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

Reimplemented from NET_ICache.

bool NET_DatabaseCache::incr ( const UT_StringRef key,
int value,
int  delta = 1,
UT_ErrorCode ec = nullptr,
int  version = -1 
)
overridevirtual

Reimplemented from NET_ICache.

bool NET_DatabaseCache::open ( UT_SqlOrm orm,
UT_ErrorCode ec 
)
bool NET_DatabaseCache::remove ( const UT_StringRef key,
UT_ErrorCode ec = nullptr,
int  version = -1 
)
overridevirtual

Implements NET_ICache.

void NET_DatabaseCache::removeMany ( const UT_StringArray keys,
UT_ErrorCode ec = nullptr,
int  version = -1 
)
inlineoverridevirtual

Reimplemented from NET_ICache.

Definition at line 439 of file NET_Cache.h.

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

Implements NET_ICache.

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

Reimplemented from NET_ICache.

Definition at line 419 of file NET_Cache.h.

bool NET_DatabaseCache::touch ( const UT_StringRef key,
UT_ErrorCode ec = nullptr,
int  timeout = -1,
int  version = -1 
)
overridevirtual

Implements NET_ICache.

NET_DatabaseCache::UT_NON_COPYABLE ( NET_DatabaseCache  )

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