Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
further objectification of jedule bindings
[simgrid.git] / include / simgrid / jedule / jedule_events.hpp
1 /* Copyright (c) 2010-2012, 2014-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 JEDULE_EVENTS_H_
8 #define JEDULE_EVENTS_H_
9
10 #include "simgrid_config.h"
11 #include "simgrid/forward.h"
12 #include <vector>
13 #include <string>
14 #include <unordered_map>
15
16 #include "jedule_platform.hpp"
17
18 #if HAVE_JEDULE
19 namespace simgrid {
20 namespace jedule{
21
22 XBT_PUBLIC_CLASS Event{
23   public:
24     Event(std::string name, double start_time, double end_time, std::string type)
25       : name(name), start_time(start_time), end_time(end_time), type(type){}
26     ~Event();
27     void addCharacteristic(char *characteristic);
28     void addResources(std::vector<sg_host_t> *host_selection);
29     void addInfo(char *key, char *value);
30     void print(FILE *file);
31
32   private:
33     std::string name;
34     double start_time;
35     double end_time;
36     std::string type;
37     std::vector<jed_res_subset_t> resource_subsets;
38     std::vector<char*> characteristics_list; /* just a list of names (strings) */
39     std::unordered_map<char*, char*> info_map;     /* key/value pairs */
40 };
41 }
42 }
43
44 SG_BEGIN_DECL()
45
46 typedef simgrid::jedule::Event * jed_event_t;
47
48 SG_END_DECL()
49
50 #endif
51
52 #endif /* JEDULE_EVENTS_H_ */