My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
msu_state.h
Go to the documentation of this file.
1 /*
2 START OF LICENSE STUB
3  DeDOS: Declarative Dispersion-Oriented Software
4  Copyright (C) 2017 University of Pennsylvania, Georgetown University
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 END OF LICENSE STUB
19 */
28 #ifndef MSU_STATE_H_
29 #define MSU_STATE_H_
30 #include "msu_message.h"
31 
32 // Forward declaration to avoid circular dependency
33 struct local_msu;
34 
36 int msu_num_states(struct local_msu *msu);
37 
43 void *msu_init_state(struct local_msu *msu, struct msu_msg_key *key, size_t size);
44 
52 void *msu_get_state(struct local_msu *msu, struct msu_msg_key *key, size_t *size);
53 
55 int msu_free_state(struct local_msu *msu, struct msu_msg_key *key);
56 
58 int msu_free_all_state(struct local_msu *msu);
59 #endif
int msu_num_states(struct local_msu *msu)
Definition: msu_state.c:51
int msu_free_all_state(struct local_msu *msu)
Frees all state structures associated with the given MSU.
Definition: msu_state.c:117
The structure that represents an MSU located on the local machine.
Definition: local_msu.h:38
int msu_free_state(struct local_msu *msu, struct msu_msg_key *key)
Frees the state assocated with the given MSU and key.
Definition: msu_state.c:97
void * msu_get_state(struct local_msu *msu, struct msu_msg_key *key, size_t *size)
Gets the state allocated with the given key.
Definition: msu_state.c:82
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.
Definition: msu_state.c:55
Messages passed to MSUs.
Used to uniquely identify the source of a message, used in state storage as well as routing...
Definition: msu_message.h:46