EchoMap 2026-07-25 6d3977c
An experimental cross-platform digital signal processing application for sound-source localisation.
Loading...
Searching...
No Matches
App.cpp
Go to the documentation of this file.
1
7
8#if defined(__EMSCRIPTEN__) || defined(__DOXYGEN__)
10#else
12#endif // __EMSCRIPTEN__
13
16#include "utility/Logger.hpp"
17
23int main()
24{
25 try {
26#if defined(__EMSCRIPTEN__) || defined(__DOXYGEN__)
27
28 // NOLINTBEGIN(*-owning-memory, *-cplusplus.NewDeleteLeaks) - Emscripten will manage our heap memory.
29
30 auto* const application = new echomap::EchoMapWeb();
31 [[maybe_unused]] auto* const controller = new echomap::StaticInstanceController(*application);
32 application->run_event_loop();
33
34 // NOLINTEND(*-owning-memory, *-cplusplus.NewDeleteLeaks)
35
36#else
37
38 // Native platforms can use the RAII facilities of EchoMap and StaticInstanceController.
39
40 echomap::EchoMapNative application;
41 const echomap::StaticInstanceController instance_controller(application);
42 application.run_event_loop();
43
44#endif
45 } catch (const echomap::ConfigurationError& error) {
46 echomap::Logger::log(echomap::Logger::Level::Error, error.what(), error.where());
47 return 1;
48 }
49
50 return 0;
51}
int main()
EchoMap common entry point.
Definition App.cpp:23
EchoMap ConfigurationError exception specification.
EchoMapNative specification.
EchoMapWeb specification.
EchoMap portable logger specification.
StaticInstanceController specification.
A ConfigurationError indicates an error encountered during the initial configuration of the EchoMap g...
EchoMap application implementation for native (non-WebAssembly) platforms.
void run_event_loop() override
Runs the platform-dependent event loop to manage and propagate interaction with the EchoMap applicati...
EchoMap application implementation for WebAssembly/Emscripten platforms.
const std::source_location & where() const noexcept
Retrieves the location of the throwing statement.
static void log(Level level, std::string_view message, std::source_location location=std::source_location::current())
Log an unformatted message to the backend.
Definition Logger.cpp:22
Provides a binding interface to connect static controllers to an instance of EchoMap.
T what(T... args)