Monado OpenXR Runtime
Data Structures | Functions
u_hashset.cpp File Reference

Hashset struct header. More...

#include "util/u_hashset.h"
#include <cstring>
#include <string>
#include <unordered_map>
#include <vector>
Include dependency graph for u_hashset.cpp:

Data Structures

struct  u_hashset
 Kind of bespoke hashset implementation, where the user is responsible for allocating and freeing the items themselves. More...
 

Functions

int u_hashset_create (struct u_hashset **out_hashset)
 
int u_hashset_destroy (struct u_hashset **hs)
 
int u_hashset_find_str (struct u_hashset *hs, const char *str, size_t length, struct u_hashset_item **out_item)
 
int u_hashset_find_c_str (struct u_hashset *hs, const char *c_str, struct u_hashset_item **out_item)
 
int u_hashset_insert_item (struct u_hashset *hs, struct u_hashset_item *item)
 
int u_hashset_erase_item (struct u_hashset *hs, struct u_hashset_item *item)
 
int u_hashset_erase_str (struct u_hashset *hs, const char *str, size_t length)
 
int u_hashset_erase_c_str (struct u_hashset *hs, const char *c_str)
 
void u_hashset_clear_and_call_for_each (struct u_hashset *hs, u_hashset_callback cb, void *priv)
 First clear the hashset and then call the given callback with each item that was in the hashset. More...
 

Detailed Description

Hashset struct header.

Author
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m

Function Documentation

◆ u_hashset_create()

int u_hashset_create ( struct u_hashset **  out_hashset)

◆ u_hashset_destroy()

int u_hashset_destroy ( struct u_hashset **  hs)

◆ u_hashset_erase_c_str()

int u_hashset_erase_c_str ( struct u_hashset hs,
const char *  c_str 
)

References u_hashset_erase_str().

◆ u_hashset_erase_item()

int u_hashset_erase_item ( struct u_hashset hs,
struct u_hashset_item item 
)

◆ u_hashset_erase_str()

int u_hashset_erase_str ( struct u_hashset hs,
const char *  str,
size_t  length 
)

References u_hashset::map.

Referenced by u_hashset_erase_c_str().

◆ u_hashset_find_c_str()

int u_hashset_find_c_str ( struct u_hashset hs,
const char *  c_str,
struct u_hashset_item **  out_item 
)

References u_hashset_find_str().

◆ u_hashset_find_str()

int u_hashset_find_str ( struct u_hashset hs,
const char *  str,
size_t  length,
struct u_hashset_item **  out_item 
)

◆ u_hashset_insert_item()

int u_hashset_insert_item ( struct u_hashset hs,
struct u_hashset_item item 
)