Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of github.com:mquinson/simgrid
[simgrid.git] / src / mc / Variable.hpp
1 /* Copyright (c) 2007-2015. 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 #ifndef SIMGRID_MC_VARIABLE_HPP
8 #define SIMGRID_MC_VARIABLE_HPP
9
10 #include <cstddef>
11
12 #include <string>
13
14 #include "src/mc/mc_forward.h"
15 #include "src/mc/LocationList.hpp"
16
17 namespace simgrid {
18 namespace mc {
19
20 /** A variable (global or local) in the model-checked program */
21 class Variable {
22 public:
23   Variable() {}
24   std::uint32_t id = 0;
25   bool global = false;
26   std::string name;
27   unsigned type_id = 0;
28   simgrid::mc::Type* type = nullptr;
29
30   /** Address of the variable -if it is fixed) */
31   void* address = nullptr;
32
33   /** Description of the location of the variable if it's not fixed */
34   simgrid::dwarf::LocationList location_list;
35
36   /** Offset of validity of the variable (DW_AT_start_scope)
37    *
38    *  This variable is not valid since the beginning of its scope.
39    */
40   std::size_t start_scope = 0;
41
42   simgrid::mc::ObjectInformation* object_info = nullptr;
43 };
44
45 }
46 }
47
48 #endif