|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Defines a pointer to a specific location in the cache. More...
#include <ringfilecache.H>
Public Member Functions | |
| Pointer ()=default | |
| Pointer (const RingFileCache &cache, const size_t __pos=0) | |
| Construct a pointer to the current head (oldest item in the cache) | |
| Pointer | operator++ () noexcept |
| Prefix increment: advance one position (with wraparound) | |
| Pointer | operator++ (int) noexcept |
| Postfix increment: advance one position (with wraparound) | |
| Pointer | operator-- () noexcept |
| Prefix decrement: move back one position (with wraparound) | |
| Pointer | operator-- (int) noexcept |
| Postfix decrement: move back one position (with wraparound) | |
| Pointer & | operator+= (const long val) noexcept |
Advance by val positions (with wraparound) | |
| Pointer & | operator-= (const long val) noexcept |
Move back by val positions (with wraparound) | |
| Pointer | operator+ (const long val) const noexcept |
Return a new Pointer advanced by val positions. | |
| Pointer | operator- (const long val) const noexcept |
Return a new Pointer moved back by val positions. | |
| size_t | get_pos_respect_to_head () const noexcept |
| Offset of this pointer relative to the current head of the cache. | |
| size_t | get_pos () const noexcept |
Alias of get_pos_respect_to_head() | |
Private Member Functions | |
| void | validate_position (const size_t pos) const |
| void | increase_pos (const long delta=1) noexcept |
| void | decrease_pos (const long delta=1) noexcept |
Private Attributes | |
| RingFileCache * | cache_ptr = nullptr |
| size_t | pos = 0 |
Friends | |
| class | RingFileCache |
Defines a pointer to a specific location in the cache.
Cache entries can be read or written through a pointer object that moves circularly over the storage.
Definition at line 405 of file ringfilecache.H.
|
default |
|
inline |
Construct a pointer to the current head (oldest item in the cache)
| [in] | cache | the cache |
| [in] | __pos | offset relative to the current head of cache |
Definition at line 457 of file ringfilecache.H.
|
inlineprivatenoexcept |
Definition at line 434 of file ringfilecache.H.
References RingFileCache< T >::Pointer::cache_ptr, RingFileCache< T >::dim, RingFileCache< T >::Pointer::increase_pos(), Aleph::maps(), and RingFileCache< T >::Pointer::pos.
Referenced by RingFileCache< T >::Pointer::increase_pos(), RingFileCache< T >::Pointer::operator--(), RingFileCache< T >::Pointer::operator--(), and RingFileCache< T >::Pointer::operator-=().
|
inlinenoexcept |
Alias of get_pos_respect_to_head()
Definition at line 531 of file ringfilecache.H.
References RingFileCache< T >::Pointer::get_pos_respect_to_head().
|
inlinenoexcept |
Offset of this pointer relative to the current head of the cache.
Definition at line 522 of file ringfilecache.H.
References RingFileCache< T >::Pointer::cache_ptr, RingFileCache< T >::dim, RingFileCache< T >::head, and RingFileCache< T >::Pointer::pos.
Referenced by RingFileCache< T >::Pointer::get_pos(), and RingFileCache< T >::read_from().
|
inlineprivatenoexcept |
Definition at line 422 of file ringfilecache.H.
References RingFileCache< T >::Pointer::cache_ptr, RingFileCache< T >::Pointer::decrease_pos(), RingFileCache< T >::dim, and RingFileCache< T >::Pointer::pos.
Referenced by RingFileCache< T >::Pointer::decrease_pos(), RingFileCache< T >::Pointer::operator++(), RingFileCache< T >::Pointer::operator++(), and RingFileCache< T >::Pointer::operator+=().
|
inlinenoexcept |
Return a new Pointer advanced by val positions.
Definition at line 506 of file ringfilecache.H.
References Aleph::maps().
|
inlinenoexcept |
Prefix increment: advance one position (with wraparound)
Definition at line 462 of file ringfilecache.H.
References RingFileCache< T >::Pointer::increase_pos().
Postfix increment: advance one position (with wraparound)
Definition at line 469 of file ringfilecache.H.
References RingFileCache< T >::Pointer::increase_pos(), and Aleph::maps().
|
inlinenoexcept |
Advance by val positions (with wraparound)
Definition at line 492 of file ringfilecache.H.
References RingFileCache< T >::Pointer::increase_pos().
|
inlinenoexcept |
Return a new Pointer moved back by val positions.
Definition at line 514 of file ringfilecache.H.
References Aleph::maps().
|
inlinenoexcept |
Prefix decrement: move back one position (with wraparound)
Definition at line 477 of file ringfilecache.H.
References RingFileCache< T >::Pointer::decrease_pos().
Postfix decrement: move back one position (with wraparound)
Definition at line 484 of file ringfilecache.H.
References RingFileCache< T >::Pointer::decrease_pos(), and Aleph::maps().
|
inlinenoexcept |
Move back by val positions (with wraparound)
Definition at line 499 of file ringfilecache.H.
References RingFileCache< T >::Pointer::decrease_pos().
|
inlineprivate |
Definition at line 412 of file ringfilecache.H.
References ah_out_of_range_error_if, RingFileCache< T >::Pointer::cache_ptr, RingFileCache< T >::dim, Aleph::maps(), and RingFileCache< T >::Pointer::pos.
|
friend |
Definition at line 407 of file ringfilecache.H.
|
private |
Definition at line 409 of file ringfilecache.H.
Referenced by RingFileCache< T >::Pointer::decrease_pos(), RingFileCache< T >::Pointer::get_pos_respect_to_head(), RingFileCache< T >::Pointer::increase_pos(), RingFileCache< T >::read(), RingFileCache< T >::Pointer::validate_position(), and RingFileCache< T >::write().
|
private |
Definition at line 410 of file ringfilecache.H.
Referenced by RingFileCache< T >::Pointer::decrease_pos(), RingFileCache< T >::Pointer::get_pos_respect_to_head(), RingFileCache< T >::Pointer::increase_pos(), RingFileCache< T >::read(), RingFileCache< T >::Pointer::validate_position(), and RingFileCache< T >::write().