summaryrefslogtreecommitdiffhomepage
path: root/plugin.h
blob: 18e5aca67fa1a1c085cb1d51bcbaaf740f7aa302 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#pragma once

#include "config.h"
#include "plugin_interface.h"

#include <boost/shared_ptr.hpp>

#include <memory>
#include <unordered_map>

typedef boost::shared_ptr<webserver_plugin_interface> plugin_type;
typedef std::unordered_map<std::string, plugin_type> plugins_container_type;

class PluginLoader
{
 Config& m_config;
 plugins_container_type m_plugins;

public:
 PluginLoader(Config& config);

 void load_plugins(); // Load all plugins from configured paths
 bool validate_config(); // Check if all configured plugins exist
 plugins_container_type& get_plugins();
};