The class LevelSetContainerBaseCache is the base class for defining caches that stores the values inside a container owned by them. More...
#include <levelSetCache.hpp>
Public Types | |
typedef container_t::const_iterator | const_iterator |
typedef const_reference_t | const_reference |
typedef container_t | container_type |
typedef LevelSetValueCache< key_t, value_t >::Entry | Entry |
typedef container_t::iterator | iterator |
typedef const key_t & | key_type |
typedef reference_t | reference |
typedef value_t | value_type |
Public Types inherited from bitpit::LevelSetValueCache< key_t, value_t > | |
typedef LevelSetValueCacheEntry< value_t > | Entry |
Public Member Functions | |
reference | at (const key_t &key) |
const_reference | at (const key_t &key) const |
iterator | begin () |
const_iterator | begin () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
bool | contains (const key_t &key) const override |
iterator | end () |
const_iterator | end () const |
virtual const_iterator | find (const key_t &key) const =0 |
virtual iterator | find (const key_t &key)=0 |
Entry | findEntry (const key_t &key) const override |
std::size_t | getEntryBinarySize () const override |
virtual iterator | insert (const key_t &key, const value_t &value)=0 |
virtual iterator | insert (const key_t &key, value_t &&value)=0 |
Entry | insertEntry (const key_t &key, const value_t &value) override |
Entry | insertEntry (const key_t &key, value_t &&value) override |
reference | operator[] (const key_t &key) |
const_reference | operator[] (const key_t &key) const |
void | readBuffer (const std::vector< key_t > &ids, RecvBuffer &buffer) override |
void | writeBuffer (const std::vector< key_t > &ids, SendBuffer &buffer) const override |
Public Member Functions inherited from bitpit::LevelSetCache< key_t > | |
virtual void | clear ()=0 |
virtual std::unique_ptr< LevelSetCache< key_t > > | clone () const =0 |
virtual void | dump (std::ostream &stream)=0 |
virtual std::size_t | erase (const key_t &key)=0 |
template<typename Keys > | |
std::size_t | erase (const Keys &keys) |
virtual bool | isVolatile () const =0 |
virtual void | reserve (std::size_t n)=0 |
virtual void | restore (std::istream &stream)=0 |
virtual void | shrink_to_fit ()=0 |
Protected Member Functions | |
template<typename... Args> | |
LevelSetContainerBaseCache (Args &&... args) | |
virtual key_t | getKey (const const_iterator &itr) const =0 |
virtual const_reference | getValue (const const_iterator &itr) const =0 |
virtual reference | getValue (const iterator &itr) const =0 |
Protected Attributes | |
container_t | m_container |
The class LevelSetContainerBaseCache is the base class for defining caches that stores the values inside a container owned by them.
Definition at line 174 of file levelSetCache.hpp.
typedef container_t::const_iterator bitpit::LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::const_iterator |
Definition at line 187 of file levelSetCache.hpp.
typedef const_reference_t bitpit::LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::const_reference |
Definition at line 184 of file levelSetCache.hpp.
typedef container_t bitpit::LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::container_type |
Definition at line 179 of file levelSetCache.hpp.
typedef LevelSetValueCache<key_t,value_t>::Entry bitpit::LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::Entry |
Definition at line 177 of file levelSetCache.hpp.
typedef container_t::iterator bitpit::LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::iterator |
Definition at line 186 of file levelSetCache.hpp.
typedef const key_t& bitpit::LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::key_type |
Definition at line 180 of file levelSetCache.hpp.
typedef reference_t bitpit::LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::reference |
Definition at line 183 of file levelSetCache.hpp.
typedef value_t bitpit::LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::value_type |
Definition at line 181 of file levelSetCache.hpp.
|
protected |
Constructor.
args | are the arguments that will be used to create the container |
Definition at line 121 of file levelSetCache.tpp.
LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::reference bitpit::LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::at | ( | const key_t & | key | ) |
Get a reference to the entry associated with the specified key.
Attempting to access a non-existent entry results in undefined behavior.
key | is key associated with the entry |
Definition at line 270 of file levelSetCache.tpp.
LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::const_reference bitpit::LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::at | ( | const key_t & | key | ) | const |
Get a constant reference to the entry associated with the specified key.
Attempting to access a non-existent entry results in undefined behavior.
key | is key associated with the entry |
Definition at line 284 of file levelSetCache.tpp.
LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::iterator bitpit::LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::begin | ( | ) |
Get an iterator pointing to the first entry.
Definition at line 132 of file levelSetCache.tpp.
LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::const_iterator bitpit::LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::begin | ( | ) | const |
Get a constant iterator pointing to the first entry.
Definition at line 154 of file levelSetCache.tpp.
LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::const_iterator bitpit::LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::cbegin | ( | ) | const |
Get a constant iterator pointing to the first entry.
Definition at line 176 of file levelSetCache.tpp.
LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::const_iterator bitpit::LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::cend | ( | ) | const |
Get a constant iterator referring to the past-the-end entry.
Definition at line 187 of file levelSetCache.tpp.
|
overridevirtual |
Check if the cache contains an entry for the specified key.
key | is key associated with the entry |
Implements bitpit::LevelSetCache< key_t >.
Definition at line 199 of file levelSetCache.tpp.
LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::iterator bitpit::LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::end | ( | ) |
Get an iterator referring to the past-the-end entry.
Definition at line 143 of file levelSetCache.tpp.
LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::const_iterator bitpit::LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::end | ( | ) | const |
Get a constant iterator referring to the past-the-end entry.
Definition at line 165 of file levelSetCache.tpp.
|
pure virtual |
Implemented in bitpit::LevelSetContainerCache< key_t, std::unordered_map< key_t, value_t > >, bitpit::LevelSetContainerCache< key_t, std::vector< value_t > >, bitpit::LevelSetContainerCache< key_t, PiercedVector< value_t, key_t > >, and bitpit::LevelSetContainerCache< key_t, PiercedStorage< value_t, key_t > >.
|
pure virtual |
Implemented in bitpit::LevelSetContainerCache< key_t, std::unordered_map< key_t, value_t > >, bitpit::LevelSetContainerCache< key_t, std::vector< value_t > >, bitpit::LevelSetContainerCache< key_t, PiercedVector< value_t, key_t > >, and bitpit::LevelSetContainerCache< key_t, PiercedStorage< value_t, key_t > >.
|
overridevirtual |
Find the entry associated with the specified key.
If the cache doesn't contain an entry associated with the specified key, an invalid entry will be returned.
key | is key associated with the entry |
Implements bitpit::LevelSetValueCache< key_t, value_t >.
Definition at line 215 of file levelSetCache.tpp.
|
overridevirtual |
Get the size, expressed in bytes, of an entry.
Implements bitpit::LevelSetCache< key_t >.
Definition at line 324 of file levelSetCache.tpp.
|
protectedpure virtual |
|
protectedpure virtual |
|
protectedpure virtual |
|
pure virtual |
Implemented in bitpit::LevelSetContainerCache< key_t, std::unordered_map< key_t, value_t > >, bitpit::LevelSetContainerCache< key_t, std::vector< value_t > >, bitpit::LevelSetContainerCache< key_t, PiercedVector< value_t, key_t > >, and bitpit::LevelSetContainerCache< key_t, PiercedStorage< value_t, key_t > >.
|
pure virtual |
Implemented in bitpit::LevelSetContainerCache< key_t, std::unordered_map< key_t, value_t > >, bitpit::LevelSetContainerCache< key_t, std::vector< value_t > >, bitpit::LevelSetContainerCache< key_t, PiercedVector< value_t, key_t > >, and bitpit::LevelSetContainerCache< key_t, PiercedStorage< value_t, key_t > >.
|
overridevirtual |
Insert a cache entry for the specified key.
If an entry associated with the same key is already in the cache, the existing cached value will be replaced by the one passed to the function.
key | is key associated with the entry |
value | is the value that will be inserted into the cache |
Implements bitpit::LevelSetValueCache< key_t, value_t >.
Definition at line 236 of file levelSetCache.tpp.
|
overridevirtual |
Insert a cache entry for the specified key.
If an entry associated with the same key is already in the cache, the existing cached value will be replaced by the one passed to the function.
key | is key associated with the entry |
value | is the value that will be inserted into the cache |
Implements bitpit::LevelSetValueCache< key_t, value_t >.
Definition at line 254 of file levelSetCache.tpp.
LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::reference bitpit::LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::operator[] | ( | const key_t & | key | ) |
Get a reference to the entry associated with the specified key.
Attempting to access a non-existent entry results in undefined behavior.
key | is key associated with the entry |
Definition at line 298 of file levelSetCache.tpp.
LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::const_reference bitpit::LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >::operator[] | ( | const key_t & | key | ) | const |
Get a constant reference to the entry associated with the specified key.
Attempting to access a non-existent entry results in undefined behavior.
key | is key associated with the entry |
Definition at line 312 of file levelSetCache.tpp.
|
overridevirtual |
Read the specified entries from the given buffer.
keys | is the list of keys whose data need to be received | |
[in,out] | buffer | is the buffer to read from |
Implements bitpit::LevelSetCache< key_t >.
Definition at line 356 of file levelSetCache.tpp.
|
overridevirtual |
Write the specified entries to the given buffer.
[in] | keys | is the list of keys whose data need to be send |
[in,out] | buffer | is the buffer to write to |
Implements bitpit::LevelSetCache< key_t >.
Definition at line 336 of file levelSetCache.tpp.
|
protected |
Definition at line 223 of file levelSetCache.hpp.