State storage that is tied to a specific MSU message. More...
#include "msu_message.h"
#include "rt_stats.h"
#include "logging.h"
#include "uthash.h"
#include "local_msu.h"
Go to the source code of this file.
Classes | |
struct | msu_state |
The structure contining msu state. More... | |
Macros | |
#define | CHECK_STATE_REPLACEMENT 1 |
Explicitly check whether a state is being replaced on a call to msu_init_state. More... | |
Functions | |
int | msu_num_states (struct local_msu *msu) |
void * | msu_init_state (struct local_msu *msu, struct msu_msg_key *key, size_t size) |
Initializes a new MSU state of the given size with the provided key. More... | |
void * | msu_get_state (struct local_msu *msu, struct msu_msg_key *key, size_t *size) |
Gets the state allocated with the given key. More... | |
int | msu_free_state (struct local_msu *msu, struct msu_msg_key *key) |
Frees the state assocated with the given MSU and key. More... | |
void | msu_free_all_state (struct local_msu *msu) |
Frees all state structures associated with the given MSU. More... | |
State storage that is tied to a specific MSU message.
Definition in file msu_state.c.
#define CHECK_STATE_REPLACEMENT 1 |
Explicitly check whether a state is being replaced on a call to msu_init_state.
Definition at line 32 of file msu_state.c.
void msu_free_all_state | ( | struct local_msu * | msu | ) |
Frees all state structures associated with the given MSU.
Definition at line 117 of file msu_state.c.
int msu_free_state | ( | struct local_msu * | msu, |
struct msu_msg_key * | key | ||
) |
Frees the state assocated with the given MSU and key.
Definition at line 97 of file msu_state.c.
void* msu_get_state | ( | struct local_msu * | msu, |
struct msu_msg_key * | key, | ||
size_t * | size | ||
) |
Gets the state allocated with the given key.
msu | The MSU storing the state |
key | The key with which the state was allocated |
size | An output argument, set to the size of the retrieved state if non-NULL |
Definition at line 82 of file msu_state.c.
void* msu_init_state | ( | struct local_msu * | msu, |
struct msu_msg_key * | key, | ||
size_t | size | ||
) |
Initializes a new MSU state of the given size with the provided key.
The returned pointer should later be freed with msu_free_state
Definition at line 55 of file msu_state.c.
int msu_num_states | ( | struct local_msu * | msu | ) |
Definition at line 51 of file msu_state.c.