OnixS C++ SGX Titan ITCH Market Data Handler  1.2.2
API documentation
RetransmissionPacketProcessor.cpp
Go to the documentation of this file.
1 /*
2 * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
3 *
4 * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
5 * and international copyright treaties.
6 *
7 * Access to and use of the software is governed by the terms of the applicable ONIXS Software
8 * Services Agreement (the Agreement) and Customer end user license agreements granting
9 * a non-assignable, non-transferable and non-exclusive license to use the software
10 * for it's own data processing purposes under the terms defined in the Agreement.
11 *
12 * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
13 * of this source code or associated reference material to any other location for further reproduction
14 * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
15 *
16 * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
17 * the terms of the Agreement is a violation of copyright law.
18 */
19 
21 
22 #include <OnixS/HandlerCore/FeedEngine/PacketContainer.h>
23 #include <OnixS/ItchCore/MoldUDP64/PacketHeader.h>
24 #include <OnixS/ItchCore/MoldUDP64/PacketProcessor.h>
25 
26 #include "Formatting.h"
27 #include "MessageRepository.h"
28 
29 #include <util/String.h>
30 
31 using namespace OnixS::HandlerCore::Common;
32 using namespace OnixS::HandlerCore::MarketData;
33 
34 ONIXS_HANDLER_NAMESPACE_BEGIN
35 
36  RetransmissionPacketProcessor::RetransmissionPacketProcessor(HandlerLogger* logger, const Logging::LogFacility* parent, MessageRepository* messageRepository) :
37  Logging::LogFacility("Glimpse", parent, OnixS::Logging::LOG_LEVEL_DEBUG),
38  logger_(logger),
39  messageRepository_(messageRepository)
40  {
41  BOOST_ASSERT(logger_ != nullptr);
42  }
43 
45  {
46  }
47 
49  {
50  }
51 
52  void RetransmissionPacketProcessor::onPacket(FE::PacketContainer& packetContainer)
53  {
54  const OnixS::ItchCore::MoldUDP64::PacketHeader* unitHeader =
55  &OnixS::ItchCore::MoldUDP64::PacketHelper::header(packetContainer);
56 
57  DataSource dataSource;
58  dataSource.packetReceptionTime = HANDLER_NAMESPACE::Timestamp::utcNow();
59  dataSource.packetMessageCount = unitHeader->messageCount();
60  dataSource.messageSeqNum = unitHeader->sequenceNumber();
61  dataSource.session = (Byte*)unitHeader->session();
62  dataSource.origin = DataSource::replay;
63 
64  messageRepository_->onPacket(dataSource, packetContainer);
65  }
66 
67 ONIXS_HANDLER_NAMESPACE_END
Origin origin
the way data received
Definition: Defines.h:77
UInt16 packetMessageCount
Message sequence number.
Definition: Defines.h:65
void onPacket(OnixS::HandlerCore::MarketData::FE::PacketContainer &) override
const Byte * session
Session Id.
Definition: Defines.h:74
void onPacket(DataSource &dataSource, OnixS::HandlerCore::MarketData::FE::PacketContainer &packetContainer, bool runProcessCachedMessages=true)
UInt8 Byte
Alias for Byte.
Definition: Memory.h:30
UInt64 messageSeqNum
Message sequence number.
Definition: Defines.h:71
Timestamp packetReceptionTime
Time when the packet was received by Handler from UDP, in system ticks,.
Definition: Defines.h:62