polybar-dwm/include/modules/meta/factory.hpp
patrick96 3561fd3ad1 Templatify module factory
Saves us a lot of code duplication by generating module type-indexed map
and factory functions from the module class names.
2022-10-16 21:25:48 +02:00

25 lines
638 B
C++

#pragma once
#include "common.hpp"
#include "components/logger.hpp"
#include "components/types.hpp"
#include "modules/meta/base.hpp"
POLYBAR_NS
namespace modules {
using module_t = shared_ptr<module_interface>;
/**
* Creates a new module instance.
*
* @param type The type of the module (as given by each module's TYPE field)
* @param bar An instance of the @ref bar_settings
* @param module_name The user-specified module name
* @param log A @ref logger instance
*/
module_t make_module(string&& type, const bar_settings& bar, string module_name, const logger& log);
} // namespace modules
POLYBAR_NS_END