maph 1.0.0 High-Performance Memory-Mapped Key-Value Database with O(1) Lookups

Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
sni_tree.cpp File Reference
`#include <map>`
`#include <memory>`
`#include <string_view>`
`#include <cstring>`
`#include <cstdlib>`
`#include <algorithm>`
Include dependency graph for sni_tree.cpp:

Go to the source code of this file.

## Classes
struct | sni_node

## Macros
#define | SNI_TREE_H
#define | MAX_LABELS 10

## Functions
void * | removeUser (struct sni_node *root, unsigned int label, std::string_view *labels, unsigned int numLabels)
void * | getUser (struct sni_node *root, unsigned int label, std::string_view *labels, unsigned int numLabels)
void * | sni_new ()
void | sni_free (void *sni, void(*cb)(void *))
int | sni_add (void *sni, const char *hostname, void *user)
void * | sni_remove (void *sni, const char *hostname)
void * | sni_find (void *sni, const char *hostname)

## Variables
thread_local void(* | sni_free_cb )(void *)

## Macro Definition Documentation

## ◆ MAX_LABELS

#define MAX_LABELS 10

Definition at line 34 of file sni_tree.cpp.

## ◆ SNI_TREE_H

#define SNI_TREE_H

Definition at line 22 of file sni_tree.cpp.

## Function Documentation

## ◆ getUser()

void * getUser | ( | struct sni_node * | root,
|  | unsigned int | label,
|  | std::string_view * | labels,
|  | unsigned int | numLabels
| ) |  |

Definition at line 92 of file sni_tree.cpp.

References sni_node::children, getUser(), and sni_node::user.

Referenced by getUser(), and sni_find().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ removeUser()

void * removeUser | ( | struct sni_node * | root,
|  | unsigned int | label,
|  | std::string_view * | labels,
|  | unsigned int | numLabels
| ) |  |

Definition at line 59 of file sni_tree.cpp.

References sni_node::children, removeUser(), and sni_node::user.

Referenced by removeUser(), and sni_remove().

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ sni_add()

int sni_add | ( | void * | sni,
|  | const char * | hostname,
|  | void * | user
| ) |  |

Definition at line 133 of file sni_tree.cpp.

References sni_node::children, and sni_node::user.

## ◆ sni_find()

void * sni_find | ( | void * | sni,
|  | const char * | hostname
| ) |  |

Definition at line 190 of file sni_tree.cpp.

References getUser().

Here is the call graph for this function:

## ◆ sni_free()

void sni_free | ( | void * | sni,
|  | void(*)(void *) | cb
| ) |  |

Definition at line 125 of file sni_tree.cpp.

References sni_free_cb.

## ◆ sni_new()

void * sni_new | ( |  | ) |

Definition at line 121 of file sni_tree.cpp.

## ◆ sni_remove()

void * sni_remove | ( | void * | sni,
|  | const char * | hostname
| ) |  |

Definition at line 166 of file sni_tree.cpp.

References removeUser().

Here is the call graph for this function:

## Variable Documentation

## ◆ sni_free_cb

thread_local void(* sni_free_cb) (void *) | ( | void * |  | ) |

Definition at line 37 of file sni_tree.cpp.

Referenced by sni_free(), and sni_node::~sni_node().