//+----------------------------------------------------------------------+
//|                                               IndicatorEntry.mqh     |
//| SCacheEntry: metadata structure per cache entry for CIndicatorCache. |
//| Holds the handle, reference count, composite key, and memory         |
//| estimate for one cached indicator instance.                          |
//|                                                                      |
//| Note: enum member names use the INDT_ prefix to avoid conflict       |
//| with MQL5's built-in ENUM_INDICATOR members (IND_ATR etc.)           |
//+----------------------------------------------------------------------+
#ifndef INDICATORENTRY_MQH
#define INDICATORENTRY_MQH

//+------------------------------------------------------------------+
//| ENUM_INDICATOR_TYPE                                              |
//| Purpose: Identifies the specific indicator subclass type         |
//+------------------------------------------------------------------+
enum ENUM_INDICATOR_TYPE
  {
   INDT_ATR      = 0,  // Average True Range
   INDT_MA       = 1,  // Moving Average
   INDT_RSI      = 2,  // Relative Strength Index
   INDT_MACD     = 3,  // MACD
   INDT_BBANDS   = 4,  // Bollinger Bands
   INDT_STOCH    = 5,  // Stochastic Oscillator
   INDT_CCI      = 6,  // Commodity Channel Index
   INDT_ADX      = 7,  // Average Directional Index
   INDT_ICHIMOKU = 8,  // Ichimoku Kinko Hyo
   INDT_DEMA     = 9   // Double Exponential Moving Average
  };

//+------------------------------------------------------------------+
//| SCacheEntry                                                      |
//| Purpose: Structure holding descriptor data for cache tracking    |
//+------------------------------------------------------------------+
struct SCacheEntry
  {
   string               m_key;              // Composite identity string
   int                  m_handle;           // Terminal indicator handle
   int                  m_ref_count;        // Number of active acquisitions
   string               m_symbol;           // Symbol component
   ENUM_TIMEFRAMES      m_timeframe;        // Timeframe component
   ENUM_INDICATOR_TYPE  m_indicator_type;   // Indicator type component
   string               m_params;           // Serialized parameter string
   double               m_memory_est_kb;    // Approximate memory footprint (KB)

   //--- Default constructor initialisation
   SCacheEntry(void)
      :  m_key(""),
         m_handle(INVALID_HANDLE),
         m_ref_count(0),
         m_symbol(""),
         m_timeframe(PERIOD_CURRENT),
         m_indicator_type(INDT_ATR),
         m_params(""),
         m_memory_est_kb(0.0)
     {
      //--- Entry structural setup completed
     }
  };

#endif // INDICATORENTRY_MQH
//+------------------------------------------------------------------+