diff options
Diffstat (limited to 'vendor/bandit/bandit/run_policies/run_policy.h')
-rw-r--r-- | vendor/bandit/bandit/run_policies/run_policy.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/vendor/bandit/bandit/run_policies/run_policy.h b/vendor/bandit/bandit/run_policies/run_policy.h new file mode 100644 index 00000000..7440e1cd --- /dev/null +++ b/vendor/bandit/bandit/run_policies/run_policy.h @@ -0,0 +1,27 @@ +#ifndef BANDIT_RUN_POLICY_H +#define BANDIT_RUN_POLICY_H + +namespace bandit { namespace detail { + + struct run_policy + { + virtual ~run_policy() {} + virtual bool should_run(const char* it_name, const contextstack_t& contexts) const = 0; + }; + typedef std::unique_ptr<run_policy> run_policy_ptr; + + inline run_policy& registered_run_policy(run_policy* policy = NULL) + { + static struct run_policy* policy_; + + if(policy) + { + policy_ = policy; + } + + return *policy_; + } + +}} + +#endif |