mql5/Experts/_Architecture/State/IState.mqh

28 lines
1.1 KiB
MQL5

2026-08-14 16:19:56 +02:00
//+------------------------------------------------------------------+
//| IState.mqh |
//| Copyright 2025, MetaQuotes Ltd. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2025, MetaQuotes Ltd."
#property link "https://www.mql5.com"
#property version "1.00"
#include <JSON.mqh> // Your provided JSON class
//+------------------------------------------------------------------+
//| Abstract state interface |
//+------------------------------------------------------------------+
class IState
{
public:
virtual ~IState() {}
// Save the object's state into a JSON object.
// Returns NULL if serialisation fails.
virtual JSON::Object* Save() = 0;
// Load the object's state from a JSON object.
// Returns true on success.
virtual bool Load(const JSON::Object* json) = 0;
};
//+------------------------------------------------------------------+