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