《彭博_C++反射的核心原理实践与最新进展.pdf》由会员分享,可在线阅读,更多相关《彭博_C++反射的核心原理实践与最新进展.pdf(64页珍藏版)》请在三个皮匠报告上搜索。
1、C+反射的核心原理、实践与最新进展Overview of basic C+reflection usages,applications,and ongoing workMeya Zhao,Henry Haorong Yang,Zhenchao Lin 2025 Bloomberg Finance L.P.All rights reserved.C+Reflection 101Overview of basic C+reflection usages,applications,and ongoing workCPP-SummitDecember 13,2025Meya Zhao,Henry Ha
2、orong Yang,Zhenchao LinSoftware Engineers,Real-Time Market Data FeedsWho are we?Bloomberg Feeds Engineering-We design,build,and operate exchange and contributor facing real-time market data systems-Our mandate is to model every exchange event,and propagate to downstream Bloomberg systems in real tim
3、e-We engineer for resiliency,low latency,and scale-A single one of our many applications can process hundreds of millions of events in a day3A problem in real-time market data pipelines_Case study FIXmessage-received34=160=20210830-12:34:56.789+0855=AAPL44=2.3387=44A problem in real-time market data
4、 pipelines_Case study FIXmessage-receivedC+object-representedstruct QuoteMessage unsigned long MsgSeqNum;sys_time TransactTime;std:string Symbol;double Price;int Volume;myQuoteMessage 1,2021-08-30 12:34:56.789,AAPL,2.3,4;34=160=20210830-12:34:56.789+0855=AAPL44=2.3387=45A problem in real-time market
5、 data pipelines_Case study FIXmessage-receivedC+object-representedMsgSeqNum:1,TransactTime:2021-08-30 12:34:56.789,Symbol:AAPL,Price:2.3,Volume:4JSONobject-serializedstruct QuoteMessage unsigned long MsgSeqNum;sys_time TransactTime;std:string Symbol;double Price;int Volume;myQuoteMessage 1,2021-08-3
6、0 12:34:56.789,AAPL,2.3,4;34=160=20210830-12:34:56.789+0855=AAPL44=2.3387=46Without reflectionstruct QuoteMessage .;template struct std:formatter /.auto format(const QuoteMessage&msg,FormatContext&ctx)const return std:format_to(ctx.out(),MsgSeqNum:,TransactTime:%F%T,Symbol:,Price:,Volume:,msg.d_MsgS