VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
jsonSerializer.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 <json/json.h>
9 #include "dataTypes.h"
10 #include "webLVCTypes.h"
11 #include <vrfutil/rwUUID.h>
12 
13 namespace DtSerialization
14 {
15 
21 {
22 public:
28  bool omitSpatial = false);
29 
31  static Json::Value entityIdentifierToJson(const DtEntityIdentifier& id);
32 
34  static Json::Value entityTypeToJson(const DtEntityType& type);
35 
37  static DtEntityType entityTypeFromJson(const Json::Value& arr);
38 
40  static Json::Value geocentricToJson(const DtVector& ecef);
41 
44  static DtVector geocentricFromJson(const Json::Value& arr);
45 
47  static Json::Value uuidToJson(const DtUUID& uuid);
48 
54  bool omitSpatial = false);
55 
61  bool omitSpatial = false);
62 
68  bool omitSpatial = false);
69 
74  static Json::Value createObjectDeletedMessage(const std::string& objectName, const std::string& objectType);
75 
80  static bool hasChanges(const Json::Value& current, const Json::Value& lastSent);
81 
82 private:
84  static Json::Value location3dToJson(const std::array<double, 3>& loc);
85 
87  static Json::Value stringVectorToJson(const std::vector<std::string>& strings);
88 };
89 
90 } // namespace DtSerialization
UUID is a unique ID wrapper class.
Definition: uuid.h:59
DtContactReportSnapshot - Complete state of a contact report at a point in time. Contact reports repr...
Definition: dataTypes.h:227
DtTacticalGraphicSnapshot - Complete state of a tactical graphic at a point in time. Represents waypoints, routes, boundaries, areas, and other tactical overlays.
Definition: dataTypes.h:124
DtJsonSerializer - Converts data source types to JSON.
Definition: jsonSerializer.h:20
static Json::Value uuidToJson(const DtUUID &uuid)
Convert a DtUUID to a JSON string, or an empty string if the UUID is invalid.
static Json::Value geocentricToJson(const DtVector &ecef)
Convert a geocentric ECEF position to a JSON array [lat_deg, lon_deg, alt_m].
static Json::Value entityTypeToJson(const DtEntityType &type)
Convert DtEntityType to JSON array [kind, domain, country, category, subcategory, specific...
static Json::Value entitySnapshotToJson(const DtDatasource::DtEntitySnapshot &snapshot, bool omitSpatial=false)
Convert an DtEntitySnapshot to JSON attributes.
static DtVector geocentricFromJson(const Json::Value &arr)
Convert a JSON array [lat_deg, lon_deg, alt_m] (or [lat_deg, lon_deg]) to a geocentric ECEF DtVector...
Contains the DtUUID class declaration.
static Json::Value location3dToJson(const std::array< double, 3 > &loc)
Convert a 3-element [lat, lon, alt] or [x, y, z] array to a JSON array.
DtEntitySnapshot - Complete state of an entity at a point in time. VRF-agnostic intermediate represen...
Definition: dataTypes.h:57
static bool hasChanges(const Json::Value &current, const Json::Value &lastSent)
Check if any attributes have changed between two JSON objects.
static Json::Value stringVectorToJson(const std::vector< std::string > &strings)
Convert a vector of strings to a JSON array.
IMGUI_API void Value(const char *prefix, bool b)
static Json::Value aggregateSnapshotToJson(const DtDatasource::DtAggregateSnapshot &snapshot, bool omitSpatial=false)
Convert a DtAggregateSnapshot to JSON attributes.
static Json::Value contactReportSnapshotToJson(const DtDatasource::DtContactReportSnapshot &snapshot, bool omitSpatial=false)
Convert a DtContactReportSnapshot to JSON attributes.
static Json::Value entityIdentifierToJson(const DtEntityIdentifier &id)
Convert DtEntityIdentifier to JSON array [site, app, entity].
static DtEntityType entityTypeFromJson(const Json::Value &arr)
Convert a JSON array [kind, domain, country, category, subcategory, specific, extra] to DtEntityType...
static Json::Value createObjectDeletedMessage(const std::string &objectName, const std::string &objectType)
Create a WebLVC ObjectDeleted message.
DtAggregateSnapshot- Complete state of an aggregate entity at a point in time. VRF-agnostic intermedi...
Definition: dataTypes.h:171
static Json::Value tacticalGraphicSnapshotToJson(const DtDatasource::DtTacticalGraphicSnapshot &snapshot, bool omitSpatial=false)
Convert a DtTacticalGraphicSnapshot to JSON attributes.

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)