VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
objectConsoleSender.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (c) 2026 MAK Technologies, Inc.
3  * All rights reserved.
4  ******************************************************************************/
5 
6 #pragma once
7 
10 
11 #include <vrfMsgTransport/event.h>
12 #include <json/json.h>
13 #include <tbb/spin_mutex.h>
14 #include <boost/signals2.hpp>
15 #include <memory>
16 #include <string>
17 #include <vector>
18 
19 namespace makVrfEvents
20 {
21  class DtCommentEvent;
22 }
23 
24 // ============================================================================
25 // DtObjectConsoleEventSource
26 // ============================================================================
27 
35 {
36 public:
37  DtObjectConsoleEventSource() = default;
38  ~DtObjectConsoleEventSource() override = default;
39 
40  void subscribe(makVrfEvents::DtEventManager* em) override;
41  void unsubscribe() override;
42 
44  std::vector<Json::Value> drainEvents();
45 
46 private:
47  void onCommentEvent(const makVrfEvents::DtEvent& event);
48 
49  mutable tbb::spin_mutex myQueueMutex;
50  std::vector<Json::Value> myPendingEvents;
51 
52  boost::signals2::connection myCommentConnection;
53 };
54 
55 // ============================================================================
56 // DtObjectConsoleSender
57 // ============================================================================
58 
68 {
69 public:
71  ~DtObjectConsoleSender() override = default;
72 
74  std::shared_ptr<DtIInteractionEventSource> eventSource() const override { return myEventSource; }
75 
76  std::vector<Json::Value> drainFiltered(DtWebLvcClientSession& session) override;
77 
78 private:
79  std::shared_ptr<DtObjectConsoleEventSource> myEventSource;
80 };
tbb::spin_mutex myQueueMutex
Definition: objectConsoleSender.h:49
DtIInteractionTypeSender - Abstract interface for a single interaction type sub-sender.
Definition: iInteractionTypeSender.h:26
The DtEventManager handles the sending and receipt of system events (fire, detonate, command, etc). It provides a thread-safe way for the sim engine to send and receive such events, between both components within this sim engine and other remote applications.
Definition: eventManager.h:33
void onCommentEvent(const makVrfEvents::DtEvent &event)
~DtObjectConsoleEventSource() override=default
std::shared_ptr< DtIInteractionEventSource > eventSource() const override
Returns the event source for registration with DtInteractionProcessor.
Definition: objectConsoleSender.h:74
std::vector< Json::Value > drainFiltered(DtWebLvcClientSession &session) override
Drain events from the owned source, apply filtering against session, and return the JSON records that...
std::vector< Json::Value > myPendingEvents
Definition: objectConsoleSender.h:50
DtObjectConsoleEventSource()=default
void subscribe(makVrfEvents::DtEventManager *em) override
Subscribe to relevant signals on em. Called once by DtInteractionProcessor::initialize().
Definition: event.h:13
boost::signals2::connection myCommentConnection
Definition: objectConsoleSender.h:52
DtObjectConsoleEventSource - Subscribes to VRF comment (Object Console) signals, serializes events to...
Definition: objectConsoleSender.h:34
std::vector< Json::Value > drainEvents()
Atomically swap-and-return all pending Object Console event records.
~DtObjectConsoleSender() override=default
std::shared_ptr< DtObjectConsoleEventSource > myEventSource
Definition: objectConsoleSender.h:79
DtObjectConsoleSender - Filters and delivers ObjectConsoleMessage interactions for one WebSocket conn...
Definition: objectConsoleSender.h:67
void unsubscribe() override
Disconnect all signal subscriptions. Called once by DtInteractionProcessor::shutdown().
WebLVC Client Session - Tracks state for each connected client per SISO-STD-017-2022 Section 5...
Definition: webLVCClientSession.h:28
DtIInteractionEventSource - Abstract interface for a per-interaction-type event collector.
Definition: iInteractionEventSource.h:27

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)