Class ApiLog

Class Documentation

class ApiLog

Public Functions

ApiLog(serialization::Stream *stream, serialization::GPAToken const *delimiters = nullptr, memory::Allocator *allocator = nullptr)

Manages the log of API calls in a captured stream.

Parameters
  • stream -- Pointer to the object representing the captured stream data

  • delimiters -- (Optional) List of GPAToken representing the API calls that mark the ends of ranges in the stream. If null, then a default internal list of delimiters is used.

  • allocator -- (Optional) Custom allocator to manage memory used in scanning and maintaing API call state. If null, a default internal allocator is used.

ApiLog(playback::StreamData *streamData, serialization::GPAToken const *delimiters = nullptr)

Manages the log of API calls in a captured stream.

Parameters
  • streamData -- Pointer to the object representing the captured stream data

  • delimiters -- (Optional) List of GPAToken representing the API calls that mark the ends of ranges in the stream. If null, then a default internal list of delimiters is used.

~ApiLog()
uint64_t ScanForRanges(uint64_t limit = UINT64_MAX)

Invoke a scan of the stream data associated with this object, for ranges delimited by the list provided in the constructor.

Parameters

limit -- Maximum number of ranges to scan for. Scanning stops when the limit is reached.

Returns

Number of ranges detected.

uint64_t RangeCount() const

Access the number of ranges identified by a call to ScanForRanges().

Returns

The number of ranges found during the most recent scan.

CallableCache Range(uint64_t index) const

Return a list, ordered by timestamp, of all API calls within the range specified.

Parameters

index -- Zero-based index of the range. Must be in the range [0..N) where N is the value returned by RangeCount().

Returns

A CallableCache containing the ordered list (by timestamp) of API calls in the requested range.

CallableCache Ranges(uint64_t first, uint64_t last) const

Return a list, ordered by timestamp, of all API calls within the ranges specified.

Note

Only contiguous (non-sparse) ranges can be requested.

Parameters
  • first -- Zero-based index of the first range. Must be in the range [0..N) where N is the value returned by RangeCount().

  • last -- Zero-based index of the last range. Must be in the range [M..N) where M is equal to the value of "first" and N is the value returned by RangeCount().

Returns

A CallableCache containing the ordered list (by timestamp) of API calls in the requested ranges.

StreamDataBookmark RangeBookmark(uint64_t index) const

Obtain a reference to the starting point of the requested range.

Parameters

index -- Zero-based index of the requested range. Must be in the range [0..N) where N is the value returned by RangeCount().

Returns

A StreamDataBookmark object that represents the starting point of the requested range in the stream data associated with this object.

StreamDataBookmark RangeBookmarkEnd(uint64_t index) const

Obtain a reference to the ending point of the requested range.

Parameters

index -- Zero-based index of the requested range. Must be in the range [0..N) where N is the value returned by RangeCount().

Returns

A StreamDataBookmark object that represents the ending point of the requested range in the stream data associated with this object. Bookmark points to the last call in the range.

StreamDataBookmark RangeBookmarkEndWithDelimiter(uint64_t index) const

Obtain a reference to the ending point of the requested range that includes the last delimiter.

Parameters

index -- Zero-based index of the requested range. Must be in the range [0..N) where N is the value returned by RangeCount().

Returns

A StreamDataBookmark object that represents the ending point of the requested range in the stream data associated with this object. Bookmark points to the last call in the range including the last delimiter.