mql5/Include/Canvas/DX/DXHandle.mqh

118 lines
8.4 KiB
MQL5

2025-08-05 01:57:33 -04:00
<EFBFBD><EFBFBD>//+------------------------------------------------------------------+
//| DXHandle.mqh |
//| Copyright 2000-2025, MetaQuotes Ltd. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#include "DXObjectBase.mqh"
//+------------------------------------------------------------------+
//| Class CDXHandle |
//+------------------------------------------------------------------+
class CDXHandle : public CDXObjectBase
{
protected:
int m_handle; // DX handle
protected:
CDXHandle(void);
virtual ~CDXHandle(void);
public:
int Handle(void) const { return(m_handle); }
};
//+------------------------------------------------------------------+
//| CDXHandle constructor |
//+------------------------------------------------------------------+
CDXHandle::CDXHandle(void) : m_handle(-1)
{
}
//+------------------------------------------------------------------+
//| CDXHandle destructor |
//+------------------------------------------------------------------+
CDXHandle::~CDXHandle(void)
{
if(m_handle!=-1)
{
DXRelease(m_handle);
m_handle=-1;
}
}
//+------------------------------------------------------------------+
//| Class CDXHandleShared |
//+------------------------------------------------------------------+
class CDXHandleShared : public CDXHandle
{
protected:
ulong m_references; // reference count to the shared object
protected:
virtual ~CDXHandleShared(void);
public:
CDXHandleShared(void);
virtual ulong AddRef(void);
virtual ulong References(void);
virtual ulong Release(void);
bool operator!(void) const
{