-/* Copyright (c) 2010-2012, 2014-2017. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2010-2020. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#ifndef JEDULE_EVENTS_H_
#define JEDULE_EVENTS_H_
-#include "simgrid_config.h"
-#include "simgrid/forward.h"
+#include <simgrid/jedule/jedule_platform.hpp>
+
+#include <simgrid/forward.h>
+
#include <vector>
#include <string>
#include <unordered_map>
-#include "jedule_platform.hpp"
-
-#if SIMGRID_HAVE_JEDULE
namespace simgrid {
namespace jedule{
-XBT_PUBLIC_CLASS Event{
- public:
- Event(std::string name, double start_time, double end_time, std::string type);
- ~Event();
- void addCharacteristic(char *characteristic);
- void addResources(std::vector<sg_host_t> *host_selection);
- void addInfo(char *key, char *value);
- void print(FILE *file);
-
- private:
- std::string name;
- double start_time;
- double end_time;
- std::string type;
- std::vector<jed_subset_t> *resource_subsets;
- std::vector<char*> characteristics_list; /* just a list of names (strings) */
- std::unordered_map<char*, char*> info_map; /* key/value pairs */
+class XBT_PUBLIC Event {
+public:
+ Event(const std::string& name, double start_time, double end_time, const std::string& type)
+ : name_(name), start_time_(start_time), end_time_(end_time), type_(type)
+ {
+ }
+ void add_characteristic(const char* characteristic);
+ void add_resources(const std::vector<sg_host_t>& host_selection);
+ void add_info(char* key, char* value);
+ void print(FILE* file) const;
+
+private:
+ std::string name_;
+ double start_time_;
+ double end_time_;
+ std::string type_;
+ std::vector<Subset> resource_subsets_;
+ std::vector<std::string> characteristics_list_; /* just a list of names */
+ std::unordered_map<std::string, std::string> info_map_; /* key/value pairs */
};
}
}
-extern "C" {
-typedef simgrid::jedule::Event * jed_event_t;
-}
-
-#endif
+typedef simgrid::jedule::Event* jed_event_t;
#endif /* JEDULE_EVENTS_H_ */