Skip to content

Commit

Permalink
cleanup taskresolver code from unused sections
Browse files Browse the repository at this point in the history
  • Loading branch information
w0lek committed Dec 1, 2023
1 parent afa5bc1 commit 4decf9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
25 changes: 1 addition & 24 deletions vpr/src/server/taskresolver.cpp
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
#include "taskresolver.h"
#ifdef ENABLE_RANDOM_PATH_GENERATION
#include <server_app/pathsgen.h>
#endif

#ifndef STANDALONE_APP
#include "globals.h"
#include "pathhelper.h"
#include "telegramoptions.h"
#include "telegramparser.h"
#include "gtkcomboboxhelper.h"
#include <ezgl/application.hpp>
#endif

#ifdef ENABLE_TASK_DELAY
#include <thread>
#include <chrono>
#endif

void TaskResolver::addTasks(const std::vector<Task>& tasks)
{
Expand Down Expand Up @@ -68,7 +58,6 @@ std::vector<std::string> splitString(const std::string& input, char delimiter)
return tokens;
}

#ifndef STANDALONE_APP
void TaskResolver::update(ezgl::application* app)
{
for (auto& task: m_tasks) {
Expand Down Expand Up @@ -126,16 +115,4 @@ void TaskResolver::update(ezgl::application* app)
}
}
}
#else
void TaskResolver::update()
{
for (auto& task: m_tasks) {
if (!task.isFinished()) {
#ifdef ENABLE_TASK_DELAY
std::this_thread::sleep_for(std::chrono::milliseconds(TASK_RESOLVE_DELAY_MS));
#endif
task.success(generateRandomPathsString());
}
}
}
#endif

7 changes: 1 addition & 6 deletions vpr/src/server/taskresolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@

#include <vector>

#ifndef STANDALONE_APP
namespace ezgl {
class application;
}
#endif

class TaskResolver {
public:
Expand All @@ -20,11 +18,8 @@ class TaskResolver {

void addTasks(const std::vector<Task>&);
void addTask(Task);
#ifndef STANDALONE_APP

void update(ezgl::application*);
#else
void update();
#endif
void takeFinished(std::vector<Task>&);

const std::vector<Task>& tasks() const { return m_tasks; }
Expand Down

0 comments on commit 4decf9b

Please sign in to comment.