<commit_before>#ifndef STATEMACHINEBASE_H_INCLUDED
#define STATEMACHINEBASE_H_INCLUDED


#include <functional>
#include <utility>
#include <list>
#include <vector>
#include <unordered_map>
#include <memory>

#include "runtime/ievent.hpp"

struct EventState : public std::pair<int, int> {
  EventState(int e_, int s_, int p_) : event (e_), state (s_), port (p_) {}

  bool operator == (const EventState& a){
    return event == a.event && this->state == a.state && this->port == a.port;
  }
  
	int event;
	int state;
	int port;
};

namespace std
{
  template<>
	struct hash<EventState> : public unary_function<EventState, size_t>
	{
	  std::size_t operator ()(const EventState& es_) const
	  {
	    hash<int> intHash;
	    size_t hashValue = (intHash(es_.event) ^ intHash(es_.state) ^ intHash(es_.port) );
	    return hashValue;
	  }
	};<commit_msg>Fix EventState improved by port-attribute equality<commit_after>#ifndef STATEMACHINEBASE_H_INCLUDED
#define STATEMACHINEBASE_H_INCLUDED


#include <functional>
#include <utility>
#include <list>
#include <vector>
#include <unordered_map>
#include <memory>

#include "runtime/ievent.hpp"

struct EventState {
	EventState(int e_, int s_, int p_) : event (e_), state (s_), port (p_) {}
  
	int event;
	int state;
	int port;
};

inline bool operator == (const EventState& a, const EventState& b) {
	return b.event == a.event && b.state == a.state && b.port == a.port;

}

namespace std
{
	
	template<>
	struct hash<EventState> : public unary_function<EventState, size_t>
	{
	  std::size_t operator ()(const EventState& es_) const
	  {
	    hash<int> intHash;
	    size_t hashValue = (intHash(es_.event) ^ intHash(es_.state) ^ intHash(es_.port) );
	    return hashValue;
	  }
	};
{'fraction_non_alphanumeric': 0.13697040046430645, 'fraction_numerical': 0.0, 'mean_word_length': 4.4043887147335425, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2144632', 'n_tokens_mistral': 636, 'n_tokens_neox': 612, 'n_words': 158}