Monado OpenXR Runtime
u_id_ringbuffer.cpp File Reference

Wrap some ring buffer internals for somewhat generic C usage. More...

#include "u_id_ringbuffer.h"
#include "u_iterator_base.hpp"
#include "u_template_historybuf_impl_helpers.hpp"
#include "u_logging.h"
#include <vector>
#include <memory>
#include <iterator>
#include <type_traits>
Include dependency graph for u_id_ringbuffer.cpp:

Data Structures

struct  u_id_ringbuffer
 

Macros

#define DEFAULT_CATCH(...)
 

Typedefs

using id_value_type = uint64_t
 

Functions

struct u_id_ringbufferu_id_ringbuffer_create (uint32_t capacity)
 
template<typename F >
static int64_t exceptionCatchingWrapper (F &&func)
 
int64_t u_id_ringbuffer_push_back (struct u_id_ringbuffer *uirb, uint64_t id)
 
void u_id_ringbuffer_pop_front (struct u_id_ringbuffer *uirb)
 
void u_id_ringbuffer_pop_back (struct u_id_ringbuffer *uirb)
 
int32_t u_id_ringbuffer_get_back (struct u_id_ringbuffer *uirb, uint64_t *out_id)
 
int32_t u_id_ringbuffer_get_front (struct u_id_ringbuffer *uirb, uint64_t *out_id)
 
uint32_t u_id_ringbuffer_get_size (struct u_id_ringbuffer const *uirb)
 
bool u_id_ringbuffer_is_empty (struct u_id_ringbuffer const *uirb)
 
static int32_t handleGetterResult (struct u_id_ringbuffer const *uirb, size_t inner_index, uint64_t *out_id)
 
int32_t u_id_ringbuffer_get_at_age (struct u_id_ringbuffer *uirb, uint32_t age, uint64_t *out_id)
 
int32_t u_id_ringbuffer_get_at_clamped_age (struct u_id_ringbuffer *uirb, uint32_t age, uint64_t *out_id)
 
int32_t u_id_ringbuffer_get_at_index (struct u_id_ringbuffer *uirb, uint32_t index, uint64_t *out_id)
 
static int32_t handleAlgorithmResult (IdRingbufferIterator it, uint64_t *out_id, uint32_t *out_index)
 
int32_t u_id_ringbuffer_lower_bound_id (struct u_id_ringbuffer *uirb, uint64_t search_id, uint64_t *out_id, uint32_t *out_index)
 
int32_t u_id_ringbuffer_find_id_unordered (struct u_id_ringbuffer *uirb, uint64_t search_id, uint64_t *out_id, uint32_t *out_index)
 
void u_id_ringbuffer_destroy (struct u_id_ringbuffer **ptr_to_uirb)
 

Detailed Description

Wrap some ring buffer internals for somewhat generic C usage.

Author
Rylie Pavlik rylie.nosp@m..pav.nosp@m.lik@c.nosp@m.olla.nosp@m.bora..nosp@m.com

Macro Definition Documentation

◆ DEFAULT_CATCH

#define DEFAULT_CATCH (   ...)
Value:
catch (std::exception const &e) \
{ \
U_LOG_E("Caught exception: %s", e.what()); \
return __VA_ARGS__; \
} \
catch (...) \
{ \
U_LOG_E("Caught exception"); \
return __VA_ARGS__; \
}