16 #ifndef SAMPLE_MODULE_H
17 #define SAMPLE_MODULE_H
20 #include <boost/dll/alias.hpp>
23 namespace sample_namespace {
30 std::string
name()
const noexcept
final;
32 boost::any
get(
const std::string& interface,
const std::string& model)
const final;
34 bool has(
const std::string& interface,
const std::string& model)
const noexcept
final;
38 std::vector<std::string>
announceModels(
const std::string& interface)
const noexcept
final;
40 static std::shared_ptr<Scine::Core::Module> make();
44 std::vector<std::shared_ptr<Scine::Core::Module>> moduleFactory();
65 const void* moduleFactory =
reinterpret_cast<const void*
>(
reinterpret_cast<intptr_t
>(&sample_namespace::moduleFactory));
68 BOOST_DLL_ALIAS(sample_namespace::moduleFactory, moduleFactory);
std::vector< std::string > announceInterfaces() const noexceptfinal
Announces all interfaces of which the module provides at least one model.
Definition: SampleModule.cpp:80
bool has(const std::string &interface, const std::string &model) const noexceptfinal
Checks if this module supplies a particular model of an interface.
Definition: SampleModule.cpp:76
Abstract base class for a module, which flexibly provides consumers with common interface derived cla...
Definition: Module.h:68
std::string name() const noexceptfinal
Creates a type-erased wrapper around a shared_ptr to a model of a interface.
Definition: SampleModule.cpp:61
Your module class definition.
Definition: SampleModule.h:28
std::vector< std::string > announceModels(const std::string &interface) const noexceptfinal
Definition: SampleModule.cpp:84