module.hh
Go to the documentation of this file.
/* -*- mia-c++ -*-
*
* This file is part of MIA - a toolbox for medical image analysis
* Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
*
* MIA is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MIA; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef ph_modules_hh
#define ph_modules_hh
#include <memory>
#include <string>
#include <mia/core/defines.hh>
#include <mia/core/dlloader.hh>
NS_MIA_BEGIN
class CPluginBase;
typedef CPluginBase *(*FPluginInterface)(void);
class EXPORT_CORE CPluginModule
{
public:
CPluginModule(const char *path);
~CPluginModule();
CPluginBase *get_interface() const;
const std::string& get_name() const;
void set_unload_library();
void set_keep_library();
private:
CDLLoader m_loader;
std::string m_name;
};
typedef std::shared_ptr<CPluginModule > PPluginModule;
NS_MIA_END
#endif
CDLLoader
Portabe Dynamic Link Library Loader.
Definition dlloader.hh:37
CPluginBase
The base class for all plug-ins.
Definition plugin_base.hh:65
CPluginModule::~CPluginModule
~CPluginModule()
CPluginModule::get_interface
CPluginBase * get_interface() const
CPluginModule::set_unload_library
void set_unload_library()
CPluginModule::CPluginModule
CPluginModule(const char *path)
CPluginModule::set_keep_library
void set_keep_library()
CPluginModule::get_name
const std::string & get_name() const
defines.hh
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
EXPORT_CORE
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
Definition defines.hh:101
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36
dlloader.hh
PPluginModule
std::shared_ptr< CPluginModule > PPluginModule
Definition module.hh:81