159 lines
4.3 KiB
MQL5
159 lines
4.3 KiB
MQL5
#ifndef LIB_DBG_DEBUG_STDLIB_MQL5_TRACER_MQH_INCLUDED
|
|
#define LIB_DBG_DEBUG_STDLIB_MQL5_TRACER_MQH_INCLUDED
|
|
#property version "1.0";
|
|
/**********************************************************************************
|
|
* Copyright (C) 2020 Dominik Egert <info@freie-netze.de>
|
|
*
|
|
* This file is the debugger library include file.
|
|
*
|
|
* This file may be copied and/or distributed at free will.
|
|
*
|
|
* Author Dominik Egert / Freie Netze UG.
|
|
**********************************************************************************
|
|
*
|
|
* Version: 1.0
|
|
* State: public
|
|
*
|
|
* File information
|
|
* ================
|
|
*
|
|
*/
|
|
|
|
|
|
|
|
|
|
//*********************************************************************************************************************************************************/
|
|
// BEGIN MQLAPI tracer
|
|
//
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// MQL5 API function call meta object
|
|
//
|
|
|
|
#ifdef __MQL5__
|
|
namespace dbg_lib
|
|
{
|
|
|
|
#endif
|
|
|
|
template <typename MQL_STDLIB>
|
|
class mqlapi_call_tracer_object_stdlib_CObject
|
|
{
|
|
// Hidden local object pointer
|
|
|
|
MQL_STDLIB* p_obj;
|
|
|
|
|
|
public:
|
|
// Constructor
|
|
|
|
mqlapi_call_tracer_object_stdlib_CObject(MQL_STDLIB* p_in = NULL) :
|
|
p_obj (p_in)
|
|
{ };
|
|
|
|
|
|
// Debug location recorder
|
|
|
|
MQL_STDLIB* trace_call_details(const int _line_in, const char _func_id, const string _file_in, const string _function_in, const string _mqlapi_func)
|
|
{
|
|
// Base class function
|
|
mqlapi_call_tracer_object::trace_call_details(_line, _func_id, _file_in, _function_in, _mqlapi_func);
|
|
|
|
// Return
|
|
return(p_obj);
|
|
};
|
|
|
|
|
|
// MQL-Standard library rewrite functions with return values
|
|
|
|
string dbg_mqlapi_trace_func_Symbol()
|
|
{
|
|
string retval;
|
|
_return_type = typename((retval));
|
|
DBG_MQLAPI_TRACE_FUNCTION_CALL_SETUP;
|
|
retval = dynamic_cast<MQL_STDLIB>(p_obj).Symbol();
|
|
DBG_MQLAPI_TRACE_FUNCTION_CALL_FINALIZE;
|
|
return(retval);
|
|
};
|
|
|
|
|
|
// MQL-Standard library variable input function rewrite
|
|
|
|
|
|
// MQL-Standard library void-typed function rewrite
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
template <typename MQL_API>
|
|
class mqlapi_call_tracer_object_stdlib_CCanvas : protected mqlapi_call_tracer_object_mql5
|
|
{
|
|
// Hidden local object
|
|
|
|
MQL_API* p_obj;
|
|
|
|
|
|
public:
|
|
// Constructor
|
|
|
|
mqlapi_call_tracer_object_stdlib_CCanvas(MQL_API* p_in) :
|
|
p_obj (p_in)
|
|
{ };
|
|
|
|
|
|
// Debug location recorder
|
|
|
|
mqlapi_call_tracer_object_stdlib_CCanvas* trace_call_details(const int _line_in, const char _func_id, const string _file_in, const string _function_in, const string _mqlapi_func)
|
|
{
|
|
// Base class function
|
|
mqlapi_call_tracer_object::trace_call_details(_line, _func_id, _file_in, _function_in, _mqlapi_func);
|
|
|
|
// Return
|
|
return(GetPointer(this));
|
|
};
|
|
|
|
|
|
// MQL-Standard library rewrite functions with return values
|
|
|
|
|
|
// MQL-Standard library variable input function rewrite
|
|
|
|
|
|
// MQL-Standard library void-typed function rewrite
|
|
|
|
void dbg_mqlapi_trace_func_TextOut(int x, int y, const string text, const uint _color, uint alignment = 0)
|
|
{
|
|
string retval = "NV";
|
|
_return_type = "void";
|
|
DBG_MQLAPI_TRACE_FUNCTION_CALL_SETUP;
|
|
DBG_MQLAPI_TRACE_FUNC_PARAMS_STR(5, x, y, text, _color, alignment, 0, 0);
|
|
p_obj.TextOut(x, y, text, _color, alignment);
|
|
DBG_MQLAPI_TRACE_FUNCTION_CALL_FINALIZE;
|
|
return;
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef __MQL5__
|
|
};
|
|
|
|
#endif
|
|
|
|
//
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
//
|
|
// END Debugging support
|
|
//*********************************************************************************************************************************************************/
|
|
#endif // LIB_DBG_DEBUG_STDLIB_MQL5_TRACER_MQH_INCLUDED
|