00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00023 #pragma once
00024
00025
00026 #include "DataSource.h"
00027 #include "RTRobotStateInfo.h"
00028
00029 #include "RTExceptions.h"
00030
00031
00032 #include "IMarketDataHelper.h"
00033 #include "IOrderHelper.h"
00034 #include "ITechnicalAnalysisHelper.h"
00035 #include "IScriptExecutorHelper.h"
00036 #include "IRiskInfoHelper.h"
00037
00038 using namespace corelib;
00039
00040 namespace RT
00041 {
00042
00043 class IMarketDataHelper;
00044 class IOrderHelper;
00045 class ITimerHelper;
00046 class IControlTransportHelper;
00047 class ITechnicalAnalysisHelper;
00048 class IScriptExecutorHelper;
00049 class ILogger;
00050 class IRiskInfoHelper;
00051
00057 class RobotHelperInterfacesProvider
00058 {
00059 public:
00060 virtual IMarketDataHelper * market_data_handler() = 0;
00061 virtual IOrderHelper * order_handler() = 0;
00062 virtual ITimerHelper * timer_helper() = 0;
00063 virtual IControlTransportHelper * transport_helper() = 0;
00064 virtual ITechnicalAnalysisHelper * ta_helper() = 0;
00065 virtual IScriptExecutorHelper * scripting_engine() = 0;
00066 virtual ILogger * logger() = 0;
00067 virtual IRiskInfoHelper * risk_info_helper() = 0;
00068 };
00069
00070 class RoboTrader;
00071
00072 class RTNode;
00073 class RTNodeList;
00074
00080 class IControlTransportHelper
00081 {
00082 public:
00083
00090 virtual int sendMessage (char* buf, int lenght)=0;
00091
00096 virtual int send(RTNodeList*) = 0;
00097
00102 virtual int send(RTNode*) = 0;
00103
00107 virtual RTNodeList* get_root_output_templates () = 0;
00111 virtual RTNodeList* get_root_input_templates () = 0;
00112
00113
00115 struct node_callback {
00116 virtual void operator()(RTNode*) = 0;
00117 };
00121 virtual int for_each_output_node (node_callback& cb) = 0;
00122
00126 virtual int for_each_input_node (node_callback& cb) = 0;
00127 };
00128
00129
00131 struct timeout_callback
00132 {
00133 virtual void operator()(const time_t&, int timer_id) = 0;
00134 };
00135
00141 class ITimerHelper
00142 {
00143 public:
00144
00152 virtual long add_Timer (int milliseconds, const timeout_callback* cb, int timer_id = 0)=0;
00158 virtual long delete_Timer(const long& timer_id)=0;
00159
00160 };
00161
00162
00163 enum RTLogSeverityType
00164 {
00165 lst_TraceUndef,
00166 lst_TraceError,
00167 lst_TraceWarning,
00168 lst_TraceInfo,
00169 lst_TraceDebug,
00170 lst_TraceExtra,
00171 };
00178 class ILogger
00179 {
00180 public:
00181 virtual void log(const char* msg_to_log, RTLogSeverityType = lst_TraceExtra ) = 0;
00182 };
00183
00184
00185 }