Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
jedule: obey our coding standards
[simgrid.git] / include / simgrid / jedule / jedule_events.hpp
1 /* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef JEDULE_EVENTS_H_
7 #define JEDULE_EVENTS_H_
8
9 #include <simgrid/jedule/jedule_platform.hpp>
10
11 #include <simgrid/forward.h>
12
13 #include <vector>
14 #include <string>
15 #include <unordered_map>
16
17 namespace simgrid {
18 namespace jedule{
19
20 class XBT_PUBLIC Event {
21 public:
22   Event(std::string name, double start_time, double end_time, std::string type);
23   ~Event();
24   void add_characteristic(char* characteristic);
25   void add_resources(std::vector<sg_host_t>* host_selection);
26   void add_info(char* key, char* value);
27   void print(FILE* file);
28
29   // deprecated
30   XBT_ATTRIB_DEPRECATED_v323("Please use Event::add_characteristic()") void addCharacteristic(char* characteristic)
31   {
32     add_characteristic(characteristic);
33   }
34   XBT_ATTRIB_DEPRECATED_v323("Please use Event::add_resources()") void addResources(
35       std::vector<sg_host_t>* host_selection)
36   {
37     add_resources(host_selection);
38   }
39   XBT_ATTRIB_DEPRECATED_v323("Please use Event::add_info()") void addInfo(char* key, char* value)
40   {
41     add_info(key, value);
42   }
43
44 private:
45   std::string name_;
46   double start_time_;
47   double end_time_;
48   std::string type_;
49   std::vector<jed_subset_t>* resource_subsets_;
50   std::vector<char*> characteristics_list_;   /* just a list of names */
51   std::unordered_map<char*, char*> info_map_; /* key/value pairs */
52 };
53 }
54 }
55
56 typedef simgrid::jedule::Event* jed_event_t;
57
58 #endif /* JEDULE_EVENTS_H_ */