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 |
![]() | |
typedef LevelSetValueCacheEntry< typename container_t::value_type > | 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 |
![]() | |
virtual Entry | insertEntry (const key_t &key, const typename container_t::value_type &value)=0 |
virtual Entry | insertEntry (const key_t &key, typename container_t::value_type &&value)=0 |
![]() | |
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 |
Detailed Description
class bitpit::LevelSetContainerBaseCache< key_t, container_t, value_t, reference_t, const_reference_t >
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.
Member Typedef Documentation
◆ const_iterator
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.
◆ const_reference
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.
◆ container_type
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.
◆ Entry
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.
◆ iterator
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.
◆ key_type
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.
◆ reference
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.
◆ value_type
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.
Constructor & Destructor Documentation
◆ LevelSetContainerBaseCache()
|
protected |
Constructor.
- Parameters
-
args are the arguments that will be used to create the container
Definition at line 121 of file levelSetCache.tpp.
Member Function Documentation
◆ at() [1/2]
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.
- Parameters
-
key is key associated with the entry
- Returns
- A reference to the entry associated with the specified key.
Definition at line 270 of file levelSetCache.tpp.
◆ at() [2/2]
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.
- Parameters
-
key is key associated with the entry
- Returns
- A constant reference to the entry associated with the specified key.
Definition at line 284 of file levelSetCache.tpp.
◆ begin() [1/2]
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.
- Returns
- An iterator pointing to the first entry.
Definition at line 132 of file levelSetCache.tpp.
◆ begin() [2/2]
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.
- Returns
- A constant iterator pointing to the first entry.
Definition at line 154 of file levelSetCache.tpp.
◆ cbegin()
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.
- Returns
- A constant iterator pointing to the first entry.
Definition at line 176 of file levelSetCache.tpp.
◆ cend()
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.
- Returns
- a constant iterator referring to the past-the-end entry.
Definition at line 187 of file levelSetCache.tpp.
◆ contains()
|
overridevirtual |
Check if the cache contains an entry for the specified key.
- Parameters
-
key is key associated with the entry
- Returns
- True if the cache contains an entry for the specified key, false otherwise.
Implements bitpit::LevelSetCache< key_t >.
Definition at line 199 of file levelSetCache.tpp.
◆ end() [1/2]
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.
- Returns
- An iterator referring to the past-the-end entry.
Definition at line 143 of file levelSetCache.tpp.
◆ end() [2/2]
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.
- Returns
- a constant iterator referring to the past-the-end entry.
Definition at line 165 of file levelSetCache.tpp.
◆ find() [1/2]
|
pure virtual |
Implemented in bitpit::LevelSetContainerCache< key_t, PiercedStorage< value_t, key_t > >, bitpit::LevelSetContainerCache< key_t, PiercedVector< value_t, key_t > >, bitpit::LevelSetContainerCache< key_t, std::unordered_map< key_t, value_t > >, and bitpit::LevelSetContainerCache< key_t, std::vector< value_t > >.
◆ find() [2/2]
|
pure virtual |
Implemented in bitpit::LevelSetContainerCache< key_t, PiercedStorage< value_t, key_t > >, bitpit::LevelSetContainerCache< key_t, PiercedVector< value_t, key_t > >, bitpit::LevelSetContainerCache< key_t, std::unordered_map< key_t, value_t > >, and bitpit::LevelSetContainerCache< key_t, std::vector< value_t > >.
◆ findEntry()
|
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.
- Parameters
-
key is key associated with the entry
- Returns
- The entry associated with the specified key or an invalid entry if the cache doesn't contain an actual entry associated with the key.
Implements bitpit::LevelSetValueCache< key_t, typename container_t::value_type >.
Definition at line 215 of file levelSetCache.tpp.
◆ getEntryBinarySize()
|
overridevirtual |
Get the size, expressed in bytes, of an entry.
- Returns
- The size, expressed in bytes, of an entry.
Implements bitpit::LevelSetCache< key_t >.
Definition at line 324 of file levelSetCache.tpp.
◆ getKey()
|
protectedpure virtual |
◆ getValue() [1/2]
|
protectedpure virtual |
◆ getValue() [2/2]
|
protectedpure virtual |
◆ insert() [1/2]
|
pure virtual |
Implemented in bitpit::LevelSetContainerCache< key_t, PiercedStorage< value_t, key_t > >, bitpit::LevelSetContainerCache< key_t, PiercedVector< value_t, key_t > >, bitpit::LevelSetContainerCache< key_t, std::unordered_map< key_t, value_t > >, and bitpit::LevelSetContainerCache< key_t, std::vector< value_t > >.
◆ insert() [2/2]
|
pure virtual |
Implemented in bitpit::LevelSetContainerCache< key_t, PiercedStorage< value_t, key_t > >, bitpit::LevelSetContainerCache< key_t, PiercedVector< value_t, key_t > >, bitpit::LevelSetContainerCache< key_t, std::unordered_map< key_t, value_t > >, and bitpit::LevelSetContainerCache< key_t, std::vector< value_t > >.
◆ insertEntry() [1/2]
|
override |
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.
- Parameters
-
key is key associated with the entry value is the value that will be inserted into the cache
- Returns
- The entry associated with the key.
Definition at line 236 of file levelSetCache.tpp.
◆ insertEntry() [2/2]
|
override |
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.
- Parameters
-
key is key associated with the entry value is the value that will be inserted into the cache
- Returns
- The entry associated with the key.
Definition at line 254 of file levelSetCache.tpp.
◆ operator[]() [1/2]
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.
- Parameters
-
key is key associated with the entry
- Returns
- A reference to the entry associated with the specified key.
Definition at line 298 of file levelSetCache.tpp.
◆ operator[]() [2/2]
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.
- Parameters
-
key is key associated with the entry
- Returns
- A constant reference to the entry associated with the specified key.
Definition at line 312 of file levelSetCache.tpp.
◆ readBuffer()
|
overridevirtual |
Read the specified entries from the given buffer.
- Parameters
-
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.
◆ writeBuffer()
|
overridevirtual |
Write the specified entries to the given buffer.
- Parameters
-
[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.
Member Data Documentation
◆ m_container
|
protected |
Definition at line 223 of file levelSetCache.hpp.
The documentation for this class was generated from the following files:
- src/levelset/levelSetCache.hpp
- src/levelset/levelSetCache.tpp
