- Create a Data Collector Class;
- Add Support for Save Logs in Alert Class; - Add Propper inputs for Handle Saving Logs in EA and Expert Class; - remove x-trade.manager Class Data Collector and use General Developed Data Collector; - Add Support for Reading Fles in Data Collector Class for Support Configuration Parsing; - Remove XCBaseAlert class and add Support for get XCAlert instance reference pointer as Dependency Injection in all used classed and Refactor all Changes; - Apply Fix some UnImplemented Event Handlers on Ea Expert Class of XCATBEA and also change Event Handler Binding to Collection Based Model; - Test all Functionalities ... - Apply Some Fixes on Prevent Double Saing Same Log Messages ...
This commit is contained in:
@@ -0,0 +1,214 @@
|
||||
|
||||
//
|
||||
// a Base Class by Support Alert ...
|
||||
class XCBaseAlert : public XCBase
|
||||
{
|
||||
//
|
||||
// Public ...
|
||||
public:
|
||||
//
|
||||
// Props ...
|
||||
|
||||
//
|
||||
// Constructor(s) ...
|
||||
void XCBaseAlert()
|
||||
{
|
||||
//
|
||||
// Instance Alert ...
|
||||
mAlert = new XCAlert();
|
||||
}
|
||||
|
||||
//
|
||||
// Deconstructors ...
|
||||
void ~XCBaseAlert()
|
||||
{
|
||||
//
|
||||
delete mAlert;
|
||||
|
||||
//
|
||||
ZeroMemory(mAlert);
|
||||
}
|
||||
|
||||
//
|
||||
// Alert Handler Functions ...
|
||||
|
||||
//
|
||||
// Alert Functions Getter(s) / Setters(s) ...
|
||||
|
||||
//
|
||||
string GetAlertPrefix()
|
||||
{
|
||||
return mAlert.GetPrefix();
|
||||
}
|
||||
|
||||
//
|
||||
void SetAlertPrefix(string value)
|
||||
{
|
||||
mAlert.SetPrefix(value);
|
||||
}
|
||||
|
||||
//
|
||||
bool GetAlertLogAlerts()
|
||||
{
|
||||
return mAlert.GetLogAlerts();
|
||||
}
|
||||
|
||||
//
|
||||
void SetAlertLogAlerts(bool value)
|
||||
{
|
||||
mAlert.SetLogAlerts(value);
|
||||
}
|
||||
|
||||
//
|
||||
bool GetAlertEnableAlerts()
|
||||
{
|
||||
return mAlert.GetEnableAlerts();
|
||||
}
|
||||
|
||||
//
|
||||
void SetAlertEnableAlerts(bool value)
|
||||
{
|
||||
mAlert.SetEnableAlerts(value);
|
||||
}
|
||||
|
||||
//
|
||||
bool GetAlertPushAlerts()
|
||||
{
|
||||
return mAlert.GetPushAlerts();
|
||||
}
|
||||
|
||||
//
|
||||
void SetAlertPushAlerts(bool value)
|
||||
{
|
||||
mAlert.SetPushAlerts(value);
|
||||
}
|
||||
|
||||
//
|
||||
bool GetAlertMailAlerts()
|
||||
{
|
||||
return mAlert.GetMailAlerts();
|
||||
}
|
||||
|
||||
//
|
||||
void SetAlertMailAlerts(bool value)
|
||||
{
|
||||
mAlert.SetMailAlerts(value);
|
||||
}
|
||||
|
||||
//
|
||||
bool GetAlertTerminalAlerts()
|
||||
{
|
||||
return mAlert.GetTerminalAlerts();
|
||||
}
|
||||
|
||||
//
|
||||
void SetAlertTerminalAlerts(bool value)
|
||||
{
|
||||
mAlert.SetTerminalAlerts(value);
|
||||
}
|
||||
|
||||
//
|
||||
// Alert Actions ...
|
||||
|
||||
//
|
||||
// Logging an Alert ...
|
||||
void LogAlert(string message)
|
||||
{
|
||||
mAlert.LogAlert(message);
|
||||
}
|
||||
|
||||
//
|
||||
// Terminal Alert ...
|
||||
void TerminalAlert(string message)
|
||||
{
|
||||
mAlert.TerminalAlert(message);
|
||||
}
|
||||
|
||||
//
|
||||
// Mail Alert ...
|
||||
void MailAlert(string message)
|
||||
{
|
||||
mAlert.MailAlert(message);
|
||||
}
|
||||
|
||||
//
|
||||
// Send Push Notification ...
|
||||
void PushAlert(string message)
|
||||
{
|
||||
mAlert.PushAlert(message);
|
||||
}
|
||||
|
||||
//
|
||||
// Send an Alert by Handling all Different Specified
|
||||
// type's of Alert's if they are Enabled ...
|
||||
void SendAlert(string message)
|
||||
{
|
||||
mAlert.SendAlert(message);
|
||||
}
|
||||
|
||||
//
|
||||
// Logs ...
|
||||
|
||||
//
|
||||
// Log a Message ...
|
||||
void Log(string message)
|
||||
{
|
||||
mAlert.Log(message);
|
||||
}
|
||||
void Log(string tag, string message)
|
||||
{
|
||||
mAlert.Log(tag, message);
|
||||
}
|
||||
void LogEmpty()
|
||||
{
|
||||
mAlert.LogEmpty();
|
||||
}
|
||||
|
||||
//
|
||||
// Log Specific Array ...
|
||||
template <typename T>
|
||||
void LogArray(
|
||||
T &array[], // Array to Log
|
||||
string label = NULL // Array Label
|
||||
)
|
||||
{
|
||||
mAlert.LogArray(array, label);
|
||||
}
|
||||
|
||||
//
|
||||
// Error ...
|
||||
|
||||
//
|
||||
// Log an Error ...
|
||||
void LogError(
|
||||
int error = -1 // Specific Error, if it's equal to -1, use Last Error ...
|
||||
)
|
||||
{
|
||||
mAlert.LogError(error);
|
||||
}
|
||||
|
||||
//
|
||||
// Retrieve Specified Error Code Description ...
|
||||
string GetErrorDescription(int err_code)
|
||||
{
|
||||
return mAlert.GetErrorDescription(err_code);
|
||||
}
|
||||
|
||||
//
|
||||
// Retrieve Specified Error Code Description ...
|
||||
string GetTradeServerReturnCodeDescription(int return_code)
|
||||
{
|
||||
return mAlert.GetTradeServerReturnCodeDescription(return_code);
|
||||
}
|
||||
|
||||
//
|
||||
// Protected ...
|
||||
protected:
|
||||
//
|
||||
// Alert ...
|
||||
XCAlert *mAlert;
|
||||
|
||||
//
|
||||
// Private ...
|
||||
private:
|
||||
};
|
||||
Reference in New Issue
Block a user