00001 #pragma once
00002
00003 #include <functional>
00004 #include <memory>
00005 #include <vector>
00006
00007 namespace FDR
00008 {
00009 class Session;
00010
00011 namespace Evaluator
00012 {
00020 class Event
00021 {
00022 public:
00023 Event(){};
00024 virtual ~Event(){};
00025
00026 Event(const Event& event) = delete;
00027 Event& operator=(const Event& event) = delete;
00028
00032 virtual bool operator==(const Event& event) const = 0;
00033
00037 virtual bool operator!=(const Event& event) const = 0;
00038
00040 virtual size_t hash_code() const = 0;
00041
00043 virtual std::string to_string() const = 0;
00044 };
00045
00046 }
00047 }
00048
00049 namespace std
00050 {
00051 template <>
00052 struct hash<FDR::Evaluator::Event>
00053 {
00054 size_t operator()(const FDR::Evaluator::Event& event) const
00055 {
00056 return event.hash_code();
00057 }
00058 };
00059
00060 template <>
00061 struct hash<std::shared_ptr<FDR::Evaluator::Event>>
00062 {
00063 size_t operator()(const std::shared_ptr<FDR::Evaluator::Event>& event) const
00064 {
00065 return event ? event->hash_code() : 0;
00066 }
00067 };
00068
00069 inline bool operator==(const std::shared_ptr<FDR::Evaluator::Event>& first,
00070 const std::shared_ptr<FDR::Evaluator::Event>& second)
00071 {
00072 return first.get() == second.get() || *first == *second;
00073 }
00074
00075 inline bool operator!=(const std::shared_ptr<FDR::Evaluator::Event>& first,
00076 const std::shared_ptr<FDR::Evaluator::Event>& second)
00077 {
00078 return first.get() != second.get() && *first != *second;
00079 }
00080
00081 }