identt
Public Types | Public Member Functions | Static Public Member Functions | List of all members
identt::store::StoreCache Class Reference
Inheritance diagram for identt::store::StoreCache:
identt::store::StoreBase

Public Types

using pointer = std::shared_ptr< StoreCache >
 
using LockT = boost::shared_mutex
 
using WriteLockT = boost::unique_lock< LockT >
 
using ReadLockT = boost::shared_lock< LockT >
 
using AssocT = std::string
 
using AssocMapT = std::unordered_map< std::string, AssocT >
 

Public Member Functions

 StoreCache (const StoreCache &)=delete
 no copy
 
StoreCacheoperator= (const StoreCache &)=delete
 
virtual ~StoreCache ()
 destructor
 
void SetAssoc (std::string hash, AssocT assoc)
 SetAssoc : add an assoc entry. More...
 
bool GetAssoc (std::string hash, AssocT &assoc)
 GetAssoc : get assoc. More...
 
void DelAssoc (std::string hash)
 DelAssoc : del assoc entry. More...
 
void AddToCache (TransactionT *trans)
 AddToCache : adds a transaction to cache. More...
 
- Public Member Functions inherited from identt::store::StoreBase
std::string EncodeKeyType (KeyTypeE keytype)
 EncodeKeyType : make prefix key with keytype. More...
 
std::string EncodePrimaryKey (KeyTypeE keytype, ::google::protobuf::uint64 id)
 EncodePrimaryKey : make primary key with id only. More...
 
std::pair< KeyTypeE, uint64_t > DecodePrimaryKey (std::string &key)
 DecodePrimaryKey : get keytype and id from primary key. More...
 
template<typename T >
std::string EncodeSecondaryKey (KeyTypeE keytype, T key)
 EncodeSecondaryKey : make secondary key with one variable only. More...
 
template<typename T , typename U >
std::string EncodeSecondaryKey (KeyTypeE keytype, T key1, U key2)
 EncodeSecondaryKey : make secondary key with two variables. More...
 
template<typename T , typename U , typename V >
std::string EncodeSecondaryKey (KeyTypeE keytype, T key1, U key2, V key3)
 EncodeSecondaryKey : make secondary key with three variables. More...
 
template<>
std::string EncodeSecondaryKey (KeyTypeE keytype, uint64_t key)
 1 value More...
 
template<>
std::string EncodeSecondaryKey (KeyTypeE keytype, std::string key)
 EncodeSecondaryKey : make secondary key with std::string : always unique. More...
 
template<>
std::string EncodeSecondaryKey (KeyTypeE keytype, uint64_t key1, uint64_t key2)
 2 value More...
 
template<>
std::string EncodeSecondaryKey (KeyTypeE keytype, uint64_t key1, std::string key2)
 EncodeSecondaryKey : make secondary key with two keys uint64_t , std::string : always unique. More...
 
template<>
std::string EncodeSecondaryKey (KeyTypeE keytype, std::string key1, uint64_t key2)
 EncodeSecondaryKey : make secondary key with two keys std::string , uint64_t : always unique : s-u unique , s non unique. More...
 
template<>
std::string EncodeSecondaryKey (KeyTypeE keytype, std::string key1, std::string key2)
 EncodeSecondaryKey : make secondary key with two keys std::string , std::string : always unique. More...
 
template<>
std::string EncodeSecondaryKey (KeyTypeE keytype, uint64_t key1, int32_t key2)
 EncodeSecondaryKey : make secondary key with two keys uint64_t, int32_t : always unique. More...
 
template<>
std::string EncodeSecondaryKey (KeyTypeE keytype, uint64_t key1, uint64_t key2, uint64_t key3)
 3 value More...
 
template<>
std::string EncodeSecondaryKey (KeyTypeE keytype, uint64_t key1, uint64_t key2, std::string key3)
 EncodeSecondaryKey : make secondary key with three keys uint64_t , uint64_t , std::string : always unique. More...
 
template<>
std::string EncodeSecondaryKey (KeyTypeE keytype, uint64_t key1, std::string key2, uint64_t key3)
 EncodeSecondaryKey : make secondary key with three keys uint64_t , std::string , uint64_t : always unique : u-s-u unique , u-s non unique. More...
 
template<>
std::string EncodeSecondaryKey (KeyTypeE keytype, uint64_t key1, std::string key2, std::string key3)
 EncodeSecondaryKey : make secondary key with three keys uint64_t , std::string , std::string : always unique. More...
 
template<>
std::string EncodeSecondaryKey (KeyTypeE keytype, std::string key1, uint64_t key2, uint64_t key3)
 EncodeSecondaryKey : make secondary key with three keys std::string , uint64_t , uint64_t : s-u-u unique , s-u non unique. More...
 
template<>
std::string EncodeSecondaryKey (KeyTypeE keytype, std::string key1, uint64_t key2, std::string key3)
 EncodeSecondaryKey : make secondary key with three keys std::string , uint64_t , std::string : always unique. More...
 
template<>
std::string EncodeSecondaryKey (KeyTypeE keytype, std::string key1, std::string key2, uint64_t key3)
 EncodeSecondaryKey : make secondary key with three keys std::string , std::string , uint64_t : s-s-u unique , s-s non unique. More...
 
template<>
std::string EncodeSecondaryKey (KeyTypeE keytype, std::string key1, std::string key2, std::string key3)
 EncodeSecondaryKey : make secondary key with three keys std::string , std::string , std::string : always unique. More...
 

Static Public Member Functions

static pointer create ()
 create : static construction creates new first time More...
 

Member Function Documentation

§ AddToCache()

void identt::store::StoreCache::AddToCache ( TransactionT *  trans)

AddToCache : adds a transaction to cache.

Parameters
transTransactionT* transaction
Returns
none

§ create()

static pointer identt::store::StoreCache::create ( )
inlinestatic

create : static construction creates new first time

Returns
pointer

§ DelAssoc()

void identt::store::StoreCache::DelAssoc ( std::string  hash)

DelAssoc : del assoc entry.

Parameters
hashstd::string&& hash to update
Returns
none

§ GetAssoc()

bool identt::store::StoreCache::GetAssoc ( std::string  hash,
AssocT &  assoc 
)

GetAssoc : get assoc.

Parameters
hashstd::string hash to get
assocAssocT& assoc to get
Returns
bool if ok

§ SetAssoc()

void identt::store::StoreCache::SetAssoc ( std::string  hash,
AssocT  assoc 
)

SetAssoc : add an assoc entry.

Parameters
hashstd::string hash to update
assocAssocT assoc
Returns
none

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