Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : remove useless debug message and add another one
[simgrid.git] / src / mc / mc_set.cpp
1 /* Copyright (c) 2007-2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include <stddef.h>
8 #include <set>
9
10 typedef std::set<const void*>*  mc_address_set_t;
11
12 extern "C" {
13
14 mc_address_set_t mc_address_set_new();
15 void mc_address_set_free(mc_address_set_t* p);
16 void mc_address_add(mc_address_set_t p, const void* value);
17 bool mc_address_test(mc_address_set_t p, const void* value);
18
19 mc_address_set_t mc_address_set_new() {
20   return new std::set<const void*>();
21 }
22
23 void mc_address_set_free(mc_address_set_t* p) {
24   delete *p;
25   *p = NULL;
26 }
27
28 void mc_address_add(mc_address_set_t p, const void* value) {
29   p->insert(value);
30 }
31
32 bool mc_address_test(mc_address_set_t p, const void* value) {
33   return p->find(value) != p->end();
34 }
35
36 };