mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-01-21 20:39:32 -05:00
26 lines
683 B
C++
26 lines
683 B
C++
// Copyright (c) 2017-2024, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/blob/master/LICENSE.md
|
|
|
|
#include "WindowsFactory.hpp"
|
|
#include <AppWindow.hpp>
|
|
#include <utility>
|
|
|
|
namespace app
|
|
{
|
|
|
|
void WindowsFactory::attach(const std::string &name, builder builder)
|
|
{
|
|
builders[name] = std::move(builder);
|
|
}
|
|
|
|
auto WindowsFactory::isRegistered(const std::string &name) const -> bool
|
|
{
|
|
return builders.find(name) != std::end(builders);
|
|
}
|
|
|
|
auto WindowsFactory::build(ApplicationCommon *app, const std::string &name) -> handle
|
|
{
|
|
return builders[name](app, name);
|
|
}
|
|
} // namespace app
|