Pression  1.0.0
Compressor, decompressor, uploader and downloader plugins
 All Classes Files Functions Variables Macros Pages
pluginRegistry.h
1 
2 /* Copyright (c) 2010, Cedric Stalder <cedric.stalder@gmail.com>
3  * 2010-2014, Stefan Eilemann <eile@eyescale.ch>
4  *
5  * This file is part of Pression <https://github.com/Eyescale/Pression>
6  *
7  * This library is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU Lesser General Public License version 2.1 as published
9  * by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14  * details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this library; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20 
21 #ifndef PRESSION_PLUGINREGISTRY_H
22 #define PRESSION_PLUGINREGISTRY_H
23 
24 #include <pression/api.h>
25 #include <pression/types.h>
26 
27 #include <string>
28 
29 namespace pression
30 {
31 namespace detail { class PluginRegistry; }
32 
44 {
45 public:
47  PRESSION_API PluginRegistry();
48 
50  PRESSION_API ~PluginRegistry();
51 
57  PRESSION_API void addDirectory( const std::string& path );
58 
60  PRESSION_API void removeDirectory( const std::string& path );
61 
67  PRESSION_API const Strings& getDirectories() const;
68 
74  PRESSION_API bool addLunchboxPlugins();
75 
77  PRESSION_API void init();
78 
80  PRESSION_API void exit();
81 
90  PRESSION_API VisitorResult accept( PluginVisitor& visitor );
91 
93  PRESSION_API VisitorResult accept( ConstPluginVisitor& visitor ) const;
94 
96  PRESSION_API const Plugins& getPlugins() const;
97 
99  PRESSION_API Plugin* findPlugin( const uint32_t name );
100 
102  PRESSION_API const Plugin* findPlugin( const uint32_t name ) const;
103 
105  PRESSION_API bool addPlugin( const std::string& filename );
106 
107 private:
108  PluginRegistry( const PluginRegistry& );
109  PluginRegistry operator=( const PluginRegistry& );
110  detail::PluginRegistry* const impl_;
111 };
112 }
113 #endif // PRESSION_PLUGINREGISTRY_H
PRESSION_API PluginRegistry()
Construct a new plugin registry.
Defines export visibility macros for library Pression.
Visitor for all plugins and compressors of a Plugin or PluginRegistry.
Definition: pluginVisitor.h:31
Holder for all functions and information of one compression plugin DSO.
Definition: plugin.h:39
PRESSION_API VisitorResult accept(PluginVisitor &visitor)
Visit all plugins and compressors.
PRESSION_API void removeDirectory(const std::string &path)
Remove a plugin directory.
PRESSION_API bool addLunchboxPlugins()
Add the lunchbox library plugins to this registry.
PRESSION_API const Strings & getDirectories() const
PRESSION_API void addDirectory(const std::string &path)
Add a new directory to search for compressor DSOs during init().
PRESSION_API ~PluginRegistry()
Destruct this plugin registry.
A registry for loaded plugins.