EchoMap 2026-07-25 6d3977c
An experimental cross-platform digital signal processing application for sound-source localisation.
Loading...
Searching...
No Matches
anonymous_namespace{JSONPartialDeserialiser.cpp} Namespace Reference

Functions

auto get_signals (simdjson::ondemand::object &root, echomap::PartialProject &project, std::unordered_map< std::string_view, echomap::id_type > &loaded)

Variables

echomap::Workerparent_worker = nullptr

Function Documentation

◆ get_signals()

auto anonymous_namespace{JSONPartialDeserialiser.cpp}::get_signals ( simdjson::ondemand::object & root,
echomap::PartialProject & project,
std::unordered_map< std::string_view, echomap::id_type > & loaded )

Definition at line 24 of file JSONPartialDeserialiser.cpp.

31{
32 // Step 1. Create our factories which detain only the signal metadata (sample rate, etc.) and source information.
34 if (const auto error = root["signals"].get(factories))
35 return error;
36
37 /*
38 * Step 2. The factories can't be used yet, since we need to establish VFS mappings. In this case, we declare them
39 * to the project to use later on, once the VFS mappings are done.
40 */
41 for (auto factory : factories | std::views::as_rvalue) {
42 if (const auto& signal = factory->observe_signal(); !loaded.emplace(signal.get_name(), signal.get_id()).second)
43 throw std::runtime_error(std::format("Project contains duplicate signal {}.", signal.get_name()));
44
45 project.indicate_unloaded_signal(std::move(factory));
46 }
47
48 return simdjson::SUCCESS;
49}
void indicate_unloaded_signal(std::unique_ptr< SignalFactory > &&factory)
Provide the factory for an unloaded Signal.
T emplace(T... args)
T format(T... args)

Variable Documentation

◆ parent_worker

echomap::Worker* anonymous_namespace{JSONPartialDeserialiser.cpp}::parent_worker = nullptr

Definition at line 22 of file JSONPartialDeserialiser.cpp.