EchoMap 2026-07-25 6d3977c
An experimental cross-platform digital signal processing application for sound-source localisation.
Loading...
Searching...
No Matches
echomap::JSONPartialDeserialiser Class Reference

JSON parser for PartialProject objects. More...

#include <JSONPartialDeserialiser.hpp>

Public Member Functions

std::unique_ptr< PartialProjectdeserialise_project (const std::filesystem::path &path, Worker *worker)

Private Attributes

simdjson::ondemand::parser parser

Detailed Description

JSON parser for PartialProject objects.

To parse full Project instances, see JSONFullDeserialiser.

Definition at line 30 of file JSONPartialDeserialiser.hpp.

Member Function Documentation

◆ deserialise_project()

std::unique_ptr< PartialProject > echomap::JSONPartialDeserialiser::deserialise_project ( const std::filesystem::path & path,
Worker * worker )

Definition at line 94 of file JSONPartialDeserialiser.cpp.

98{
99 parent_worker = worker;
100 const auto json = simdjson::padded_string::load(path.c_str());
101 auto doc = parser.iterate(json);
102 auto partial_project = std::make_unique<PartialProject>();
103
104 if (const auto error = doc.get(*partial_project); error)
105 throw std::runtime_error(
107 "Could not load Project at {} due to error: {}",
108 path.c_str(),
109 simdjson::error_message(error)
110 )
111 );
112
113 return partial_project;
114}
T format(T... args)
T make_unique(T... args)

Member Data Documentation

◆ parser

simdjson::ondemand::parser echomap::JSONPartialDeserialiser::parser
private

Definition at line 39 of file JSONPartialDeserialiser.hpp.


The documentation for this class was generated from the following files: