Skip to content

Commit

Permalink
update condition_manager interface
Browse files Browse the repository at this point in the history
  • Loading branch information
tekezo committed Jul 9, 2017
1 parent 8f65125 commit 09d37f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/core/grabber/include/manipulator/condition_manager.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "manipulator/manipulator_factory.hpp"
#include "manipulator/details/conditions/base.hpp"

namespace krbn {
namespace manipulator {
Expand All @@ -11,8 +11,8 @@ class condition_manager final {
condition_manager(void) {
}

void push_back_condition(const nlohmann::json& json) {
conditions_.push_back(manipulator_factory::make_condition(json));
void push_back_condition(const std::shared_ptr<krbn::manipulator::details::conditions::base>& condition) {
conditions_.push_back(condition);
}

bool is_fulfilled(const krbn::manipulator_environment& manipulator_environment) const {
Expand Down
3 changes: 2 additions & 1 deletion tests/src/manipulator_conditions/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "../../vendor/catch/catch.hpp"

#include "manipulator/condition_manager.hpp"
#include "manipulator/manipulator_factory.hpp"
#include "thread_utility.hpp"
#include <boost/optional/optional_io.hpp>

Expand Down Expand Up @@ -47,7 +48,7 @@ class actual_examples_helper final {
std::ifstream input(std::string("json/") + file_name);
auto json = nlohmann::json::parse(input);
for (const auto& j : json) {
condition_manager_.push_back_condition(j);
condition_manager_.push_back_condition(krbn::manipulator::manipulator_factory::make_condition(j));
}
}

Expand Down

0 comments on commit 09d37f9

Please sign in to comment.