diff --git a/vn.ib/vnib/vnib/vnib.h b/vn.ib/vnib/vnib/vnib.h index f316d9eb..c3283e2b 100644 --- a/vn.ib/vnib/vnib/vnib.h +++ b/vn.ib/vnib/vnib/vnib.h @@ -1,21 +1,21 @@ -//说明部分 +//璇存槑閮ㄥ垎 -//系统 +//绯荤粺 #include "StdAfx.h" #include //Boost #define BOOST_PYTHON_STATIC_LIB -#include //python封装 -#include //python封装 -#include //python封装 +#include //python灏佽 +#include //python灏佽 +#include //python灏佽 -#include //Python封装 -#include //Python封装 +#include //Python灏佽 +#include //Python灏佽 -#include //python封装 -#include //任务队列的线程功能 -#include //任务队列的线程功能 +#include //python灏佽 +#include //浠诲姟闃熷垪鐨勭嚎绋嬪姛鑳 +#include //浠诲姟闃熷垪鐨勭嚎绋嬪姛鑳 #include @@ -25,31 +25,31 @@ #include "EClientSocket.h" #include "EReader.h" -//命名空间 +//鍛藉悕绌洪棿 using namespace std; using namespace boost::python; using namespace boost; ///------------------------------------------------------------------------------------- -///API中的部分组件 +///API涓殑閮ㄥ垎缁勪欢 ///------------------------------------------------------------------------------------- -//GIL全局锁简化获取用, -//用于帮助C++线程获得GIL锁,从而防止python崩溃 +//GIL鍏ㄥ眬閿佺畝鍖栬幏鍙栫敤锛 +//鐢ㄤ簬甯姪C++绾跨▼鑾峰緱GIL閿侊紝浠庤岄槻姝ython宕╂簝 class PyLock { private: PyGILState_STATE gil_state; public: - //在某个函数方法中创建该对象时,获得GIL锁 + //鍦ㄦ煇涓嚱鏁版柟娉曚腑鍒涘缓璇ュ璞℃椂锛岃幏寰桮IL閿 PyLock() { gil_state = PyGILState_Ensure(); }; - //在某个函数完成后销毁该对象时,解放GIL锁 + //鍦ㄦ煇涓嚱鏁板畬鎴愬悗閿姣佽瀵硅薄鏃讹紝瑙f斁GIL閿 ~PyLock() { PyGILState_Release(gil_state); @@ -58,7 +58,7 @@ public: ///------------------------------------------------------------------------------------- -///强制转化相关 +///寮哄埗杞寲鐩稿叧 ///------------------------------------------------------------------------------------- boost::python::list tagvaluelist_to_pylist(); @@ -66,7 +66,7 @@ boost::python::list tagvaluelist_to_pylist(); TagValueListSPtr pylist_to_tagvaluelist(); ///------------------------------------------------------------------------------------- -///声明类 +///澹版槑绫 ///------------------------------------------------------------------------------------- class VnIbApi; @@ -74,7 +74,7 @@ class VnIbApi; class IbWrapper; ///------------------------------------------------------------------------------------- -///C++ SPI的回调函数方法实现 +///C++ SPI鐨勫洖璋冨嚱鏁版柟娉曞疄鐜 ///------------------------------------------------------------------------------------- class IbWrapper : public EWrapper @@ -223,7 +223,7 @@ public: ///------------------------------------------------------------------------------------- -///封装后的API类 +///灏佽鍚庣殑API绫 ///------------------------------------------------------------------------------------- class VnIbApi @@ -248,24 +248,17 @@ public: ~VnIbApi() { - if (this->client) - { - delete this->client; - } - - if (this->wrapper) - { - delete this->wrapper; - } + delete this->client; + delete this->wrapper; }; //------------------------------------------------------------------------------------- - //负责调用checkMessages的线程工作函数 + //璐熻矗璋冪敤checkMessages鐨勭嚎绋嬪伐浣滃嚱鏁 //------------------------------------------------------------------------------------- void run(); //------------------------------------------------------------------------------------- - //回调函数 + //鍥炶皟鍑芥暟 //------------------------------------------------------------------------------------- virtual void nextValidId(OrderId orderId){}; @@ -408,7 +401,7 @@ public: */ //------------------------------------------------------------------------------------- - //主动函数 + //涓诲姩鍑芥暟 //------------------------------------------------------------------------------------- bool eConnect(string host, int port, int clientId, bool extraAuth);