28 lines
543 B
C
28 lines
543 B
C
|
#ifndef POLICY_H
|
||
|
#define POLICY_H
|
||
|
|
||
|
#include <string>
|
||
|
|
||
|
class Policy
|
||
|
{
|
||
|
public:
|
||
|
explicit Policy(const std::string& satisfaction, const std::string& dissatisfaction);
|
||
|
virtual ~Policy() = 0;
|
||
|
|
||
|
struct CheckResult
|
||
|
{
|
||
|
bool satisfied = false;
|
||
|
std::string commentary;
|
||
|
};
|
||
|
|
||
|
virtual CheckResult check() const = 0;
|
||
|
|
||
|
protected:
|
||
|
virtual CheckResult composeMessageFromResult(bool result) const final;
|
||
|
|
||
|
std::string _commentary_on_satisfaction;
|
||
|
std::string _commentary_on_dissatisfaction;
|
||
|
};
|
||
|
|
||
|
#endif // POLICY_H
|