Skip to content

Commit b4a1e4f

Browse files
author
ubuntu
committed
cleanup
1 parent 371ce9a commit b4a1e4f

34 files changed

Lines changed: 3 additions & 85 deletions

include/ccapi_cpp/service/ccapi_execution_management_service.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ class ExecutionManagementService : public Service {
210210
virtual void logonToExchange(std::shared_ptr<WsConnection> wsConnectionPtr, const TimePoint& now, const std::map<std::string, std::string>& credential) {
211211
CCAPI_LOGGER_INFO("about to logon to exchange");
212212
CCAPI_LOGGER_INFO("exchange is " + this->exchangeName);
213-
WsConnection& wsConnection = *wsConnectionPtr;
214213
CCAPI_LOGGER_FINE("wsConnection = " + toString(*wsConnectionPtr));
215214
auto subscription = wsConnectionPtr->subscriptionList.at(0);
216215
std::vector<std::string> sendStringList = this->createSendStringListFromSubscription(wsConnectionPtr, subscription, now, credential);
@@ -234,7 +233,6 @@ class ExecutionManagementService : public Service {
234233
CCAPI_LOGGER_FUNCTION_ENTER;
235234
Service::onOpen(wsConnectionPtr);
236235
auto now = UtilTime::now();
237-
WsConnection& wsConnection = *wsConnectionPtr;
238236
auto correlationId = wsConnectionPtr->subscriptionList.at(0).getCorrelationId();
239237
this->wsConnectionPtrByCorrelationIdMap.insert({correlationId, wsConnectionPtr});
240238
this->correlationIdByConnectionIdMap.insert({wsConnectionPtr->id, correlationId});
@@ -244,7 +242,6 @@ class ExecutionManagementService : public Service {
244242

245243
void onClose(std::shared_ptr<WsConnection> wsConnectionPtr, ErrorCode ec) override {
246244
CCAPI_LOGGER_FUNCTION_ENTER;
247-
WsConnection& wsConnection = *wsConnectionPtr;
248245
if (this->correlationIdByConnectionIdMap.find(wsConnectionPtr->id) != this->correlationIdByConnectionIdMap.end()) {
249246
this->wsConnectionPtrByCorrelationIdMap.erase(this->correlationIdByConnectionIdMap.at(wsConnectionPtr->id));
250247
this->correlationIdByConnectionIdMap.erase(wsConnectionPtr->id);
@@ -313,7 +310,6 @@ class ExecutionManagementService : public Service {
313310
}
314311

315312
auto wsConnectionPtr = it->second;
316-
auto& wsConnection = *wsConnectionPtr;
317313

318314
CCAPI_LOGGER_TRACE("wsConnection = " + toString(*wsConnectionPtr));
319315
const auto& instrument = request.getInstrument();

include/ccapi_cpp/service/ccapi_execution_management_service_bitget.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,6 @@ class ExecutionManagementServiceBitget : public ExecutionManagementServiceBitget
269269

270270
void onTextMessage(std::shared_ptr<WsConnection> wsConnectionPtr, const Subscription& subscription, boost::beast::string_view textMessageView,
271271
const TimePoint& timeReceived) override {
272-
WsConnection& wsConnection = *wsConnectionPtr;
273-
274272
if (textMessageView != "pong") {
275273
this->jsonDocumentAllocator.Clear();
276274
rj::Document document(&this->jsonDocumentAllocator);

include/ccapi_cpp/service/ccapi_execution_management_service_bitmart.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,6 @@ class ExecutionManagementServiceBitmart : public ExecutionManagementService {
301301

302302
void onTextMessage(std::shared_ptr<WsConnection> wsConnectionPtr, const Subscription& subscription, boost::beast::string_view textMessageView,
303303
const TimePoint& timeReceived) override {
304-
WsConnection& wsConnection = *wsConnectionPtr;
305-
306304
if (textMessageView != "pong") {
307305
this->jsonDocumentAllocator.Clear();
308306
rj::Document document(&this->jsonDocumentAllocator);

include/ccapi_cpp/service/ccapi_execution_management_service_deribit.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,7 @@ class ExecutionManagementServiceDeribit : public ExecutionManagementService {
344344

345345
Event createEvent(const std::shared_ptr<WsConnection> wsConnectionPtr, const Subscription& subscription, boost::beast::string_view textMessageView,
346346
const rj::Document& document, const TimePoint& timeReceived) {
347-
const WsConnection& wsConnection = *wsConnectionPtr;
348-
349-
Event event;
347+
const Event event;
350348
std::vector<Message> messageList;
351349
Message message;
352350
message.setTimeReceived(timeReceived);

include/ccapi_cpp/service/ccapi_execution_management_service_ftx_base.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,6 @@ class ExecutionManagementServiceFtxBase : public ExecutionManagementService {
338338

339339
void onTextMessage(std::shared_ptr<WsConnection> wsConnectionPtr, const Subscription& subscription, boost::beast::string_view textMessageView,
340340
const TimePoint& timeReceived) override {
341-
WsConnection& wsConnection = *wsConnectionPtr;
342-
343341
this->jsonDocumentAllocator.Clear();
344342
rj::Document document(&this->jsonDocumentAllocator);
345343
document.Parse<rj::kParseNumbersAsStringsFlag>(textMessageView.data(), textMessageView.size());

include/ccapi_cpp/service/ccapi_execution_management_service_huobi.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,6 @@ class ExecutionManagementServiceHuobi : public ExecutionManagementServiceHuobiBa
265265

266266
void onTextMessage(std::shared_ptr<WsConnection> wsConnectionPtr, const Subscription& subscription, boost::beast::string_view textMessageView,
267267
const TimePoint& timeReceived) override {
268-
WsConnection& wsConnection = *wsConnectionPtr;
269-
270268
this->jsonDocumentAllocator.Clear();
271269
rj::Document document(&this->jsonDocumentAllocator);
272270
document.Parse<rj::kParseNumbersAsStringsFlag>(textMessageView.data(), textMessageView.size());

include/ccapi_cpp/service/ccapi_execution_management_service_huobi_derivatives_base.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,6 @@ class ExecutionManagementServiceHuobiDerivativesBase : public ExecutionManagemen
256256

257257
void onTextMessage(std::shared_ptr<WsConnection> wsConnectionPtr, const Subscription& subscription, boost::beast::string_view textMessageView,
258258
const TimePoint& timeReceived) override {
259-
WsConnection& wsConnection = *wsConnectionPtr;
260-
261259
this->jsonDocumentAllocator.Clear();
262260
rj::Document document(&this->jsonDocumentAllocator);
263261
document.Parse<rj::kParseNumbersAsStringsFlag>(textMessageView.data(), textMessageView.size());

include/ccapi_cpp/service/ccapi_execution_management_service_kucoin_base.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,7 @@ class ExecutionManagementServiceKucoinBase : public ExecutionManagementService {
386386

387387
Event createEvent(const std::shared_ptr<WsConnection> wsConnectionPtr, const Subscription& subscription, boost::beast::string_view textMessageView,
388388
const rj::Document& document, const TimePoint& timeReceived) {
389-
const WsConnection& wsConnection = *wsConnectionPtr;
390-
391-
Event event;
389+
const Event event;
392390
std::vector<Message> messageList;
393391
Message message;
394392
message.setTimeReceived(timeReceived);

include/ccapi_cpp/service/ccapi_execution_management_service_mexc_futures.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,6 @@ class ExecutionManagementServiceMexcFutures : public ExecutionManagementService
369369
}
370370
void onTextMessage(std::shared_ptr<WsConnection> wsConnectionPtr, const Subscription& subscription, boost::beast::string_view textMessageView,
371371
const TimePoint& timeReceived) override {
372-
WsConnection& wsConnection = *wsConnectionPtr;
373-
374372
// if (textMessageView != "pong") {
375373
// rj::Document document;
376374
// document.Parse<rj::kParseNumbersAsStringsFlag>(textMessageView.data(), textMessageView.size());

include/ccapi_cpp/service/ccapi_market_data_service.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ class MarketDataService : public Service {
7373
that->subscriptionStatusByInstrumentGroupInstrumentMap.find(instrumentGroup) != that->subscriptionStatusByInstrumentGroupInstrumentMap.end()) {
7474
auto wsConnectionId = wsConnectionIdListByInstrumentGroupMap.at(instrumentGroup).at(0);
7575
auto wsConnectionPtr = that->wsConnectionPtrByIdMap.at(wsConnectionId);
76-
WsConnection& wsConnection = *wsConnectionPtr;
7776
for (const auto& subscription : subscriptionListGivenInstrumentGroup) {
7877
auto instrument = subscription.getInstrument();
7978
if (that->subscriptionStatusByInstrumentGroupInstrumentMap[instrumentGroup].find(instrument) !=
@@ -167,7 +166,6 @@ class MarketDataService : public Service {
167166
void processMarketDataMessageList(std::shared_ptr<WsConnection> wsConnectionPtr, boost::beast::string_view textMessage, const TimePoint& timeReceived,
168167
Event& event, std::vector<MarketDataMessage>& marketDataMessageList) {
169168
CCAPI_LOGGER_TRACE("marketDataMessageList = " + toString(marketDataMessageList));
170-
WsConnection& wsConnection = *wsConnectionPtr;
171169
event.setType(Event::Type::SUBSCRIPTION_DATA);
172170
for (auto& marketDataMessage : marketDataMessageList) {
173171
if (marketDataMessage.type == MarketDataMessage::Type::MARKET_DATA_EVENTS_MARKET_DEPTH ||
@@ -327,7 +325,6 @@ class MarketDataService : public Service {
327325

328326
void onOpen(std::shared_ptr<WsConnection> wsConnectionPtr) override {
329327
CCAPI_LOGGER_FUNCTION_ENTER;
330-
WsConnection& wsConnection = *wsConnectionPtr;
331328
auto now = UtilTime::now();
332329
Service::onOpen(wsConnectionPtr);
333330
auto credential = wsConnectionPtr->credential;
@@ -339,14 +336,12 @@ class MarketDataService : public Service {
339336
}
340337

341338
void onFail_(std::shared_ptr<WsConnection> wsConnectionPtr) override {
342-
WsConnection& wsConnection = *wsConnectionPtr;
343339
std::string wsConnectionId = wsConnectionPtr->id;
344340
Service::onFail_(wsConnectionPtr);
345341
this->instrumentGroupByWsConnectionIdMap.erase(wsConnectionId);
346342
}
347343

348344
void clearStates(std::shared_ptr<WsConnection> wsConnectionPtr) override {
349-
WsConnection& wsConnection = *wsConnectionPtr;
350345
Service::clearStates(wsConnectionPtr);
351346
this->fieldByConnectionIdChannelIdSymbolIdMap.erase(wsConnectionPtr->id);
352347
this->optionMapByConnectionIdChannelIdSymbolIdMap.erase(wsConnectionPtr->id);
@@ -388,7 +383,6 @@ class MarketDataService : public Service {
388383

389384
virtual void onClose(std::shared_ptr<WsConnection> wsConnectionPtr, ErrorCode ec) override {
390385
CCAPI_LOGGER_FUNCTION_ENTER;
391-
WsConnection& wsConnection = *wsConnectionPtr;
392386
this->exchangeSubscriptionIdListByConnectionIdExchangeJsonPayloadIdMap.erase(wsConnectionPtr->id);
393387
this->exchangeJsonPayloadIdByConnectionIdMap.erase(wsConnectionPtr->id);
394388
this->instrumentGroupByWsConnectionIdMap.erase(wsConnectionPtr->id);
@@ -397,7 +391,6 @@ class MarketDataService : public Service {
397391
}
398392

399393
virtual void subscribeToExchange(std::shared_ptr<WsConnection> wsConnectionPtr) {
400-
WsConnection& wsConnection = *wsConnectionPtr;
401394
CCAPI_LOGGER_INFO("exchange is " + this->exchangeName);
402395
std::vector<std::string> sendStringList;
403396
if (this->correlationIdByConnectionIdMap.find(wsConnectionPtr->id) == this->correlationIdByConnectionIdMap.end()) {
@@ -417,7 +410,6 @@ class MarketDataService : public Service {
417410
}
418411

419412
void startSubscribe(std::shared_ptr<WsConnection> wsConnectionPtr) {
420-
WsConnection& wsConnection = *wsConnectionPtr;
421413
auto instrumentGroup = wsConnectionPtr->group;
422414
for (const auto& subscription : wsConnectionPtr->subscriptionList) {
423415
auto instrument = subscription.getInstrument();
@@ -433,7 +425,6 @@ class MarketDataService : public Service {
433425
}
434426

435427
virtual void logonToExchange(std::shared_ptr<WsConnection> wsConnectionPtr, const TimePoint& now, const std::map<std::string, std::string>& credential) {
436-
WsConnection& wsConnection = *wsConnectionPtr;
437428
CCAPI_LOGGER_INFO("about to logon to exchange");
438429
CCAPI_LOGGER_INFO("exchange is " + this->exchangeName);
439430
auto subscriptionList = wsConnectionPtr->subscriptionList;

0 commit comments

Comments
 (0)