|
const int | UNSET_INDEX = -1 |
|
◆ BookmarkRingBuffer()
AMPS.Client.BookmarkRingBuffer.BookmarkRingBuffer |
( |
| ) |
|
|
inline |
Initializes the underlying array, and sets the "last discarded" value to something reasonable.
◆ capacity()
int AMPS.Client.BookmarkRingBuffer.capacity |
( |
| ) |
|
|
inline |
Size of underlying array
- Returns
- current capacity of self.
◆ checkResize()
void AMPS.Client.BookmarkRingBuffer.checkResize |
( |
| ) |
|
|
inline |
Called to see if resize can proceed.
◆ discard()
bool AMPS.Client.BookmarkRingBuffer.discard |
( |
long |
index | ) |
|
|
inline |
Discards an entry by index. If the discard is completed, lastDiscarded will change, otherwise the discard is cached in the entry, and the getLastDiscarded() value is unchanged.
- Parameters
-
index | the index of the entry. |
- Returns
- true if this caused lastDiscarded to change.
◆ find()
Searches valid Entrys for the given bookmark
- Parameters
-
field | the bookmark to search for |
- Returns
- the Entry containing the given bookmark, or null.
◆ getByIndex()
Entry AMPS.Client.BookmarkRingBuffer.getByIndex |
( |
long |
index | ) |
|
|
inline |
Retrieves an Entry given an index
- Parameters
-
- Returns
- The entry at that index, or null if not found.
◆ getEndIndex()
long AMPS.Client.BookmarkRingBuffer.getEndIndex |
( |
| ) |
|
|
inline |
Returns the index value one greater than the last valid Entry in self.
- Returns
- index 1 greater than last valid entry.
◆ getLastDiscarded()
BookmarkField AMPS.Client.BookmarkRingBuffer.getLastDiscarded |
( |
| ) |
|
|
inline |
Returns the "last discarded" bookmark. This may be a newer bookmark than the one you last passed to discard(), if you're discarding out of order.
- Returns
- the last bookmark to be discarded.
◆ getStartIndex()
long AMPS.Client.BookmarkRingBuffer.getStartIndex |
( |
| ) |
|
|
inline |
Returns the index value associated with the first valid Entry in self.
- Returns
- index of first valid entry.
◆ isEmpty()
bool AMPS.Client.BookmarkRingBuffer.isEmpty |
( |
| ) |
|
|
inline |
Returns if the buffer is currently empty.
- Returns
- true if self is empty and false otherwise.
◆ log()
long AMPS.Client.BookmarkRingBuffer.log |
( |
BookmarkField |
bookmark | ) |
|
|
inline |
Logs the bookmark by allocating an Entry, setting the Entry to active, copying the bookmark value to that entry, and returning the index of that entry.
- Parameters
-
bookmark | the bookmark to loc |
- Returns
- the index of the new Entry.
◆ relog()
long AMPS.Client.BookmarkRingBuffer.relog |
( |
long |
oldIndex, |
|
|
BookmarkField |
bookmark |
|
) |
| |
|
inline |
WARNING: Deprecated. Do Not Use. The notion of a separate "recovered
bookmark" section within the ring buffer and the ability to re-log/re-order those entries into the main/active ring buffer section is an obsolete concept that hasn't been needed since the AMPS server stopped providing persisted acks for every message delivered on a replay (i.e. not needed since AMPS 4.0). The bookmark ring buffer has been simplified to remove this concept since a bug was discovered in it (AC-953).
Old Docs:
Re-logs the bookmark by copying an Entry to a new location and returning the index of that new location.
- Parameters
-
bookmark | the index to move |
- Returns
- the index of the new Entry.
◆ reset()
void AMPS.Client.BookmarkRingBuffer.reset |
( |
| ) |
|
|
inline |
Resets this bookmark ring buffer for reuse by clearing out its state.
The documentation for this class was generated from the following file:
- AMPS.Client/BookmarkRingBuffer.cs