-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnxcoreCallback.cpp
More file actions
45 lines (40 loc) · 1.63 KB
/
Copy pathnxcoreCallback.cpp
File metadata and controls
45 lines (40 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// nxcoreCallback.cpp
#include "nxcoreCallback.hpp"
#include "processNxCoreCategoryMessage.hpp"
#include "processNxCoreStatusMessage.hpp"
#include "processNxCoreSymbolSpinMessage.hpp"
// extern NxCoreClass NxCore;
// still needed if you use NxCore functions inside handlers
// Consider: passing a context object instead of relying on global in the future
[[nodiscard]] int OnNxCoreCallback(
const NxCoreSystem *pNxCoreSys,
const NxCoreMessage *pNxCoreMsg) noexcept
{
// ────────────────────────────────────────────────────────────────
// Future / optional message types — placeholders only for now
// Add [[fallthrough]]; when intentionally falling through
switch (pNxCoreMsg->MessageType)
{
case NxMSG_STATUS:
return processNxCoreStatusMessage(pNxCoreSys, pNxCoreMsg, std::cout);
case NxMSG_EXGQUOTE:
[[fallthrough]];
case NxMSG_MMQUOTE:
[[fallthrough]];
case NxMSG_TRADE:
break;
case NxMSG_CATEGORY:
return processNxCoreCategoryMessage(pNxCoreSys, pNxCoreMsg, std::cout);
case NxMSG_SYMBOLCHANGE:
break;
case NxMSG_SYMBOLSPIN:
// Intentionally ignored for now — future expansion point
return processNxCoreSymbolSpinMessage(pNxCoreSys, pNxCoreMsg, std::cout);
default:
// Defensive: unknown message type
// In production you might log, count, or return NxCALLBACKRETURN_STOP
// For now we just continue (silent ignore)
break;
}
return NxCALLBACKRETURN_CONTINUE;
}