X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fhashtable%2Fhashtable.hpp;h=ac1af7eed6669824dd981b7f84e91d8984ae2918;hb=28f23191dcbf047429d51950a337a57d7a3f866a;hp=1feab4d39d1328d8e3de0021c4b920d35b0bade9;hpb=e665dfbce25215d5ec77ff03a279c7163b337db1;p=lttng-tools.git diff --git a/src/common/hashtable/hashtable.hpp b/src/common/hashtable/hashtable.hpp index 1feab4d39..ac1af7eed 100644 --- a/src/common/hashtable/hashtable.hpp +++ b/src/common/hashtable/hashtable.hpp @@ -8,12 +8,13 @@ #ifndef _LTT_HT_H #define _LTT_HT_H -#include -#include -#include - #include + #include + +#include +#include +#include #include LTTNG_EXPORT extern unsigned long lttng_ht_seed; @@ -74,60 +75,47 @@ struct lttng_ht_node_two_u64 { struct lttng_ht *lttng_ht_new(unsigned long size, enum lttng_ht_type type); void lttng_ht_destroy(struct lttng_ht *ht); struct lttng_ht_deleter { - void operator()(lttng_ht *ht) { lttng_ht_destroy(ht); }; + void operator()(lttng_ht *ht) + { + lttng_ht_destroy(ht); + }; }; /* Specialized node init and free functions */ void lttng_ht_node_init_str(struct lttng_ht_node_str *node, char *key); -void lttng_ht_node_init_ulong(struct lttng_ht_node_ulong *node, - unsigned long key); -void lttng_ht_node_init_u64(struct lttng_ht_node_u64 *node, - uint64_t key); -void lttng_ht_node_init_two_u64(struct lttng_ht_node_two_u64 *node, - uint64_t key1, uint64_t key2); +void lttng_ht_node_init_ulong(struct lttng_ht_node_ulong *node, unsigned long key); +void lttng_ht_node_init_u64(struct lttng_ht_node_u64 *node, uint64_t key); +void lttng_ht_node_init_two_u64(struct lttng_ht_node_two_u64 *node, uint64_t key1, uint64_t key2); void lttng_ht_node_free_str(struct lttng_ht_node_str *node); void lttng_ht_node_free_ulong(struct lttng_ht_node_ulong *node); void lttng_ht_node_free_u64(struct lttng_ht_node_u64 *node); void lttng_ht_node_free_two_u64(struct lttng_ht_node_two_u64 *node); -void lttng_ht_lookup(struct lttng_ht *ht, const void *key, - struct lttng_ht_iter *iter); +void lttng_ht_lookup(struct lttng_ht *ht, const void *key, struct lttng_ht_iter *iter); /* Specialized add unique functions */ -void lttng_ht_add_unique_str(struct lttng_ht *ht, - struct lttng_ht_node_str *node); -void lttng_ht_add_unique_ulong(struct lttng_ht *ht, - struct lttng_ht_node_ulong *node); -void lttng_ht_add_unique_u64(struct lttng_ht *ht, - struct lttng_ht_node_u64 *node); -void lttng_ht_add_unique_two_u64(struct lttng_ht *ht, - struct lttng_ht_node_two_u64 *node); -struct lttng_ht_node_ulong *lttng_ht_add_replace_ulong( - struct lttng_ht *ht, struct lttng_ht_node_ulong *node); -struct lttng_ht_node_u64 *lttng_ht_add_replace_u64( - struct lttng_ht *ht, struct lttng_ht_node_u64 *node); -void lttng_ht_add_str(struct lttng_ht *ht, - struct lttng_ht_node_str *node); -void lttng_ht_add_ulong(struct lttng_ht *ht, - struct lttng_ht_node_ulong *node); -void lttng_ht_add_u64(struct lttng_ht *ht, - struct lttng_ht_node_u64 *node); +void lttng_ht_add_unique_str(struct lttng_ht *ht, struct lttng_ht_node_str *node); +void lttng_ht_add_unique_ulong(struct lttng_ht *ht, struct lttng_ht_node_ulong *node); +void lttng_ht_add_unique_u64(struct lttng_ht *ht, struct lttng_ht_node_u64 *node); +void lttng_ht_add_unique_two_u64(struct lttng_ht *ht, struct lttng_ht_node_two_u64 *node); +struct lttng_ht_node_ulong *lttng_ht_add_replace_ulong(struct lttng_ht *ht, + struct lttng_ht_node_ulong *node); +struct lttng_ht_node_u64 *lttng_ht_add_replace_u64(struct lttng_ht *ht, + struct lttng_ht_node_u64 *node); +void lttng_ht_add_str(struct lttng_ht *ht, struct lttng_ht_node_str *node); +void lttng_ht_add_ulong(struct lttng_ht *ht, struct lttng_ht_node_ulong *node); +void lttng_ht_add_u64(struct lttng_ht *ht, struct lttng_ht_node_u64 *node); int lttng_ht_del(struct lttng_ht *ht, struct lttng_ht_iter *iter); -void lttng_ht_get_first(struct lttng_ht *ht, - struct lttng_ht_iter *iter); +void lttng_ht_get_first(struct lttng_ht *ht, struct lttng_ht_iter *iter); void lttng_ht_get_next(struct lttng_ht *ht, struct lttng_ht_iter *iter); unsigned long lttng_ht_get_count(struct lttng_ht *ht); -struct lttng_ht_node_str *lttng_ht_iter_get_node_str( - struct lttng_ht_iter *iter); -struct lttng_ht_node_ulong *lttng_ht_iter_get_node_ulong( - struct lttng_ht_iter *iter); -struct lttng_ht_node_u64 *lttng_ht_iter_get_node_u64( - struct lttng_ht_iter *iter); -struct lttng_ht_node_two_u64 *lttng_ht_iter_get_node_two_u64( - struct lttng_ht_iter *iter); +struct lttng_ht_node_str *lttng_ht_iter_get_node_str(struct lttng_ht_iter *iter); +struct lttng_ht_node_ulong *lttng_ht_iter_get_node_ulong(struct lttng_ht_iter *iter); +struct lttng_ht_node_u64 *lttng_ht_iter_get_node_u64(struct lttng_ht_iter *iter); +struct lttng_ht_node_two_u64 *lttng_ht_iter_get_node_two_u64(struct lttng_ht_iter *iter); #endif /* _LTT_HT_H */