![]() |
VR-Forces Developer's Guide
|
DtJsonSerializer - Converts data source types to JSON.
This is the single point of JSON conversion from VRF-agnostic data. All JSON generation for entity data should go through these methods.
Static Public Member Functions | |
| static Json::Value | entitySnapshotToJson (const DtDatasource::DtEntitySnapshot &snapshot, bool omitSpatial=false) |
| static Json::Value | entityIdentifierToJson (const DtEntityIdentifier &id) |
| static Json::Value | entityTypeToJson (const DtEntityType &type) |
| static DtEntityType | entityTypeFromJson (const Json::Value &arr) |
| static Json::Value | geocentricToJson (const DtVector &ecef) |
| static DtVector | geocentricFromJson (const Json::Value &arr) |
| static Json::Value | uuidToJson (const DtUUID &uuid) |
| static Json::Value | tacticalGraphicSnapshotToJson (const DtDatasource::DtTacticalGraphicSnapshot &snapshot, bool omitSpatial=false) |
| static Json::Value | aggregateSnapshotToJson (const DtDatasource::DtAggregateSnapshot &snapshot, bool omitSpatial=false) |
| static Json::Value | contactReportSnapshotToJson (const DtDatasource::DtContactReportSnapshot &snapshot, bool omitSpatial=false) |
| static Json::Value | createObjectDeletedMessage (const std::string &objectName, const std::string &objectType) |
| static bool | hasChanges (const Json::Value ¤t, const Json::Value &lastSent) |
Static Private Member Functions | |
| static Json::Value | location3dToJson (const std::array< double, 3 > &loc) |
| static Json::Value | stringVectorToJson (const std::vector< std::string > &strings) |
|
static |
Convert an DtEntitySnapshot to JSON attributes.
| snapshot | The entity snapshot to convert |
|
static |
Convert DtEntityIdentifier to JSON array [site, app, entity].
|
static |
Convert DtEntityType to JSON array [kind, domain, country, category, subcategory, specific, extra].
|
static |
Convert a JSON array [kind, domain, country, category, subcategory, specific, extra] to DtEntityType.
|
static |
Convert a geocentric ECEF position to a JSON array [lat_deg, lon_deg, alt_m].
|
static |
Convert a JSON array [lat_deg, lon_deg, alt_m] (or [lat_deg, lon_deg]) to a geocentric ECEF DtVector. When only two elements are present, altitude defaults to 0.
|
static |
Convert a DtUUID to a JSON string, or an empty string if the UUID is invalid.
|
static |
Convert a DtTacticalGraphicSnapshot to JSON attributes.
| snapshot | The tactical graphic snapshot to convert |
|
static |
Convert a DtAggregateSnapshot to JSON attributes.
| snapshot | The aggregate snapshot to convert |
|
static |
Convert a DtContactReportSnapshot to JSON attributes.
| snapshot | The contact report snapshot to convert |
|
static |
Create a WebLVC ObjectDeleted message.
| objectName | The name of the deleted object |
| objectType | The type of the deleted object |
|
static |
Check if any attributes have changed between two JSON objects.
| current | Current attributes |
| lastSent | Previously sent attributes |
Referenced by DtDetectChangedItems().
|
staticprivate |
Convert a 3-element [lat, lon, alt] or [x, y, z] array to a JSON array.
|
staticprivate |
Convert a vector of strings to a JSON array.