From 0ba773d913450f88ff7bcf54a39e0c8a8c4d7d64 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Thu, 6 May 2021 17:46:34 +0200 Subject: Refactoring and start extended version --- src/inputs.hpp | 82 ---------------------------------------------------------- 1 file changed, 82 deletions(-) delete mode 100644 src/inputs.hpp (limited to 'src/inputs.hpp') diff --git a/src/inputs.hpp b/src/inputs.hpp deleted file mode 100644 index 23ced49..0000000 --- a/src/inputs.hpp +++ /dev/null @@ -1,82 +0,0 @@ -#include "rapidjson/document.h" -#include "rapidjson/filereadstream.h" -#include -#include -#include -#include -#include -#include "xbt/log.h" -#include - -#define INPUTS_FILE "inputs.json" -/// @brief Pay attention to this strange number, you could tear your hairs out -#define JSON_BUFFER_SIZE 65536 - -using namespace rapidjson; - -class Inputs { - /// @brief RapidJSON - Document d; - /// @brief Current node associated with the Inputs - std::string node_name; - /// @brief Timestamps (at which time the nodes should wake up) - std::vector wake_ts; - /// @brief Wake up time durations - std::vector wake_duration; - /** - * Recursively merge overlapping events - */ - void MergeEvents(); -public: - /** - * Load node_name configuration - */ - Inputs(std::string node_name); - /** - * Generate a SimGrid platform file from the json configuration - */ - static void GeneratePlatform(std::string p); - /** - * Is there any event that remains in the queue ? - */ - bool ShouldContinue(){return wake_ts.size()!=0;} - /** - * Is there another event to process ? - */ - bool HasNext(){return(wake_ts.size()>1);} - /** - * Get current event timestamp - */ - double GetTS(){return wake_ts.front();} - /** - * Get current event duration - */ - double GetDuration(){return wake_duration.front();} - /** - * Get next event timestamp - */ - double GetNextTS(); - /** - * Get next event duration - */ - double GetNextDuration(); - /** - * Time travel machine (note that this function is following the second principle - * of thermodynamics) - */ - void GotoNextEvent(); - /** - * Allows to add a *FUTURE* event and merge overlapping events - */ - void AddEvent(double ts, double duration); - /** - * This is the timeline - */ - void DumpEvents(); - - /// @brief These are public attributes, please take care they are fragile - bool is_sender; - bool use_hint; - int data_size; - -}; \ No newline at end of file -- cgit v1.2.3