MCPcopy Create free account
hub / github.com/USBGuard/usbguard / update

Method update

src/Library/RuleAppliedCondition.cpp:48–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46 }
47
48 bool RuleAppliedCondition::update(const Rule& rule)
49 {
50 if (rule.internal()->metadata().counter_applied > 0) {
51 if (_elapsed_time == std::chrono::steady_clock::duration::zero()) {
52 return true;
53 }
54 else {
55 const auto last_applied_duration = std::chrono::steady_clock::now() \
56 - rule.internal()->metadata().tp_last_applied;
57
58 if (last_applied_duration <= _elapsed_time) {
59 return true;
60 }
61 }
62 }
63
64 return false;
65 }
66
67 RuleConditionBase* RuleAppliedCondition::clone() const
68 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected