How xueguoliang/xt works
XT is a small C++ market-data prototype: its entry point subscribes to an instrument through a singleton core, which starts a CTP market-data adapter and runs an epoll loop. The repository also contains timer, thread, heap, locking, and logging support. The README gives no further product detail, and vendor API headers were not inspected; their role is evident only through the adapter declarations and includes.
Main entry points: XTCore.cpp Core Event Loop · XTCtpMd.cpp CTP Adapter · main.cpp Program Entry · XTDef.h Shared Definitions
Components 13
Application
- Program Entry
main.cpp - Core Event Loop
XTCore.cpp
Market Data
- CTP Adapter
ctp/XTCtpMd.cpp - CTP API Headers
ctp/v6.3.6_20160606_api_tradeapi_linux64 - CTP Definitions
ctp/XTCTPDef.h
Runtime Support
- Thread Coordination
XTThread.cpp - Timer Handling
XTTimer.cpp - Timer Heap
util/XTHeap.h - Mutex Utilities
util/XTLock.cpp - Logging
util/XTLog.cpp - Shared Definitions
XTDef.h
Other components
- Caller
- CTP Front
Connections 12
- Caller → Program Entry: starts
main.cpp - Program Entry → Core Event Loop: subscribes, runs
main.cpp - Core Event Loop → CTP Adapter: creates, subscribes
XTCore.cpp - CTP Adapter → CTP API Headers: uses
- CTP Adapter → CTP Front: connects
ctp/XTCtpMd.cpp - CTP Adapter → Thread Coordination: extends
- Core Event Loop → Timer Heap: stores timers
- Core Event Loop → Mutex Utilities: locks timer state
XTCore.cpp - Shared Definitions → Logging: includes
XTDef.h - Core Event Loop → Timer Handling: checks timers
XTCore.cpp - CTP Adapter → Logging: logs events
ctp/XTCtpMd.cpp - CTP Definitions → Shared Definitions: includes
ctp/XTCTPDef.h