SimPHash/Src/Def.mqh
2026-07-28 11:19:10 -05:00

66 lines
2.3 KiB
MQL5

//+------------------------------------------------------------------+
//| Def.mqh |
//| Copyright 2026, Niquel Mendoza. |
//| https://www.mql5.com/ |
//+------------------------------------------------------------------+
#property copyright "Copyright 2026, Niquel Mendoza."
#property link "https://www.mql5.com/"
#property strict
#ifndef SIMPHASH_SRC_DEF_MQH
#define SIMPHASH_SRC_DEF_MQH
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
#include <TSN\\Tables\\AllHashes.mqh>
#include <TSN\\YAML\\Yaml.mqh>
#include <TSN\\PHash\\Main.mqh>
#include "EnumReg\\Main.mqh"
#include <TSN\\MQLArticles\\Utils\\Basic.mqh>
//+------------------------------------------------------------------+
//| Clase intemedia para hasing |
//+------------------------------------------------------------------+
interface CPerfectHashHasherWSeed
{
ulong Hash(ulong v, const ulong seed);
};
//+------------------------------------------------------------------+
//| Hash 0 |
//+------------------------------------------------------------------+
class CHashGeneratorBasis
{
public:
~CHashGeneratorBasis() {}
CHashGeneratorBasis() {}
static ulong Hash(const ulong v)
{
return v; // Tal cual
}
};
//+------------------------------------------------------------------+
//| Hash 1 |
//+------------------------------------------------------------------+
class CSimPHashHaserUl1
{
public:
CSimPHashHaserUl1(void) {}
~CSimPHashHaserUl1(void) {}
//---
static CPerfectHashHasherWSeed* m_hasher;
static __forceinline ulong Hash(const ulong v, const ulong seed)
{
return m_hasher.Hash(v, seed);
}
};
CPerfectHashHasherWSeed* CSimPHashHaserUl1::m_hasher = NULL;
//+------------------------------------------------------------------+
#endif // SIMPHASH_SRC_DEF_MQH