SimPHash/Src/Def.mqh

66 lines
2.3 KiB
MQL5
Raw Permalink Normal View History

2026-06-26 12:44:41 -05:00
//+------------------------------------------------------------------+
//| 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>
2026-06-27 21:28:54 -05:00
#include <TSN\\PHash\\Main.mqh>
2026-06-28 17:05:25 -05:00
#include "EnumReg\\Main.mqh"
#include <TSN\\MQLArticles\\Utils\\Basic.mqh>
//+------------------------------------------------------------------+
//| Clase intemedia para hasing |
//+------------------------------------------------------------------+
interface CPerfectHashHasherWSeed
{
2026-07-28 11:19:10 -05:00
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);
}
};
2026-07-28 11:19:10 -05:00
CPerfectHashHasherWSeed* CSimPHashHaserUl1::m_hasher = NULL;
2026-06-26 12:44:41 -05:00
//+------------------------------------------------------------------+
#endif // SIMPHASH_SRC_DEF_MQH