#include "base_rule.hpp" #include "simple_plan.hpp" BaseRule::BaseRule(ptrSimplePlan pp, unsigned int prio, unsigned int weight, unsigned int flags, unsigned int stt, unsigned int fails, unsigned int successes) : _parent_plan(pp), _priority(prio), _weight(weight), _flags(flags), _sticky_timeout(stt), _fails(fails), _fails_act(fails), _successes(successes), _successes_act(successes) { } void BaseRule::Activate() { #ifndef CONDITION_ENGINE_DEBUG _parent_plan->_activate_rule(this); #else //std::cout << "Activating" << std::endl; #endif } void BaseRule::Deactivate() { #ifndef CONDITION_ENGINE_DEBUG _parent_plan->_deactivate_rule(this); #else //std::cout << "Deactivating" << std::endl; #endif } bool BaseRule::CheckFlags(RuleFlags flags) { return (bool) (_flags & flags); } unsigned int BaseRule::GetPriority() const { return _priority; } unsigned int BaseRule::GetWeight() const { return _weight; }