Lunchbox  1.17.0
Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs.
pluginRegisterer.h
1 
2 /* Copyright (c) 2013-2017, EPFL/Blue Brain Project
3  * Raphael Dumusc <raphael.dumusc@epfl.ch>
4  * Stefan.Eilemann@epfl.ch
5  *
6  * This file is part of Lunchbox <https://github.com/Eyescale/Lunchbox>
7  *
8  * This library is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU Lesser General Public License version 2.1 as published
10  * by the Free Software Foundation.
11  *
12  * This library is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15  * details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 
22 #ifndef LUNCHBOX_PLUGINREGISTERER_H
23 #define LUNCHBOX_PLUGINREGISTERER_H
24 
25 #include <lunchbox/plugin.h> // used inline
26 #include <lunchbox/pluginFactory.h> // used inline
27 
28 #include <boost/functional/factory.hpp>
29 #include <functional>
30 
31 namespace lunchbox
32 {
65 template <typename T>
67 {
68 public:
71  {
73  {std::bind(boost::factory<T*>(), std::placeholders::_1),
74  std::bind(&T::handles, std::placeholders::_1),
75  std::bind(&T::getDescription)});
76  }
77 };
78 }
79 
80 #endif
Helper class to statically register derived plugin classes.
PluginRegisterer()
Construct and register the Plugin< T > class.
void register_(const PluginT &plugin)
Register a plugin type.
Abstraction layer and common utilities for multi-threaded programming.
Definition: algorithm.h:29
static PluginFactory & getInstance()
Get the single class instance.