VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
entityUpdateSender.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 
8 #include <oatpp-websocket/WebSocket.hpp>
9 #include <json/json.h>
10 #include <vector>
11 #include <utility>
12 
13 #include "dataTypes.h"
14 #include "updateSenderHelpers.h"
15 #include "webLVCClientSession.h"
16 
17 class DtEntityProcessor;
18 
30 {
31 public:
35  void sendInitialState(
36  const oatpp::websocket::WebSocket& conn, DtWebLvcClientSession& session, DtEntityProcessor& processor);
37 
43  const oatpp::websocket::WebSocket& conn, DtWebLvcClientSession& session, DtEntityProcessor& processor);
44 
45 private:
51 
55  void sendObjectsDeleted(
56  const oatpp::websocket::WebSocket& conn, DtWebLvcClientSession& session,
57  const std::vector<std::string>& objectNames);
58 
60  bool matchesSubscription(const DtDatasource::DtEntitySnapshot& snapshot, const DtWebLvcClientSession& session);
61 
66  const DtDatasource::DtEntitySnapshot& snapshot, const DtWebLvcClientSession& session);
67 };
DtEntityUpdateSender - Encapsulates all entity-specific WebLVC message building and sending logic...
Definition: entityUpdateSender.h:29
bool matchesSubscription(const DtDatasource::DtEntitySnapshot &snapshot, const DtWebLvcClientSession &session)
Return true if snapshot should be sent to this client.
DtEntitySnapshot - Complete state of an entity at a point in time. VRF-agnostic intermediate represen...
Definition: dataTypes.h:57
Json::Value buildUpdateMultipleMessage(DtWebLvcClientSession &session, std::vector< DtChangedItem< DtDatasource::DtEntitySnapshot >> &items)
Build an EntityAttributeUpdateMultiple message from a list of snapshots. Updates session.lastSentAttributes for each snapshot included. Caller must hold session.mutex.
void sendPeriodicUpdates(const oatpp::websocket::WebSocket &conn, DtWebLvcClientSession &session, DtEntityProcessor &processor)
Query all entities from the processor, detect changes against the session cache, send a batch EntityA...
IMGUI_API void Value(const char *prefix, bool b)
Definition: updateSenderHelpers.h:17
void sendInitialState(const oatpp::websocket::WebSocket &conn, DtWebLvcClientSession &session, DtEntityProcessor &processor)
Send initial state of all entities to a newly connected client. Builds and sends a single EntityAttri...
void sendObjectsDeleted(const oatpp::websocket::WebSocket &conn, DtWebLvcClientSession &session, const std::vector< std::string > &objectNames)
Send an ObjectDeletedMultiple message for a set of entities that have disappeared. Clears each object&#39;s cache entry and stats. Caller must NOT hold session.mutex.
DtDatasource::DtEntitySnapshot applyRoleModifications(const DtDatasource::DtEntitySnapshot &snapshot, const DtWebLvcClientSession &session)
Return a copy of snapshot with role-based field modifications applied (e.g. availableCommands cleared...
DtEntityProcessor - Lightweight per-client entity processor.
Definition: entityProcessor.h:38
WebLVC Client Session - Tracks state for each connected client per SISO-STD-017-2022 Section 5...
Definition: webLVCClientSession.h:28

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)