1 /* Copyright (c) 2008-2015. The SimGrid Team.
2 * All rights reserved. */
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. */
9 #include "ModelChecker.hpp"
10 #include "PageStore.hpp"
12 ::simgrid::mc::ModelChecker* mc_model_checker = NULL;
17 ModelChecker::ModelChecker(pid_t pid, int socket)
20 this->hostnames_ = xbt_dict_new();
21 MC_process_init(&this->process(), pid, socket);
24 ModelChecker::~ModelChecker()
26 MC_process_clear(&this->process_);
27 xbt_dict_free(&this->hostnames_);
30 const char* ModelChecker::get_host_name(const char* hostname)
32 // Lookup the host name in the dictionary (or create it):
33 xbt_dictelm_t elt = xbt_dict_get_elm_or_null(this->hostnames_, hostname);
35 xbt_dict_set(this->hostnames_, hostname, NULL, NULL);
36 elt = xbt_dict_get_elm_or_null(this->hostnames_, hostname);