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

JSON parser for Project objects. More...

#include <JSONFullDeserialiser.hpp>

Public Member Functions

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

Private Attributes

simdjson::ondemand::parser parser

Detailed Description

JSON parser for Project objects.

To parse PartialProject instances, see JSONPartialDeserialiser.

Definition at line 30 of file JSONFullDeserialiser.hpp.

Member Function Documentation

◆ deserialise_project()

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

Definition at line 147 of file JSONFullDeserialiser.cpp.

151{
152 parent_worker = worker;
153 const auto json = simdjson::padded_string::load(path.c_str());
154 auto doc = parser.iterate(json);
155 auto project = std::make_unique<Project>();
156
157 if (const auto error = doc.get(*project); error)
158 throw std::runtime_error(
160 "Could not load Project at {} due to error: {}",
161 path.c_str(),
162 simdjson::error_message(error)
163 )
164 );
165
166 return project;
167}
T format(T... args)
T make_unique(T... args)

Member Data Documentation

◆ parser

simdjson::ondemand::parser echomap::JSONFullDeserialiser::parser
private

Definition at line 39 of file JSONFullDeserialiser.hpp.


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