Scine::Core  3.0.0
Module management and core interface definitions
 All Classes Files Functions Variables Typedefs Pages
Module.h
Go to the documentation of this file.
1 
7 #ifndef CORE_MODULE_H_
8 #define CORE_MODULE_H_
9 /* Internal Includes */
10 #include "Core/Exceptions.h"
11 
12 /* External Includes */
13 #include <boost/any.hpp>
14 #include <cassert>
15 #include <memory>
16 #include <string>
17 #include <vector>
18 
19 namespace Scine {
20 namespace Core {
21 
68 class Module {
69  public:
70  // Virtual destructor necessary
71  virtual ~Module() = default;
72 
76  virtual std::string name() const noexcept = 0;
77 
98  virtual boost::any get(const std::string& /* interface */, const std::string& /* model */
99  ) const = 0;
100 
111  virtual bool has(const std::string& /* interface */, const std::string& /* model */
112  ) const noexcept = 0;
113 
124  virtual std::vector<std::string> announceInterfaces() const noexcept = 0;
125 
138  virtual std::vector<std::string> announceModels(const std::string& interface) const noexcept = 0;
140 };
141 
142 } /* namespace Core */
143 } /* namespace Scine */
144 
145 #endif /* CORE_MODULE_H_ */
virtual std::vector< std::string > announceInterfaces() const noexcept=0
Announces all interfaces of which the module provides at least one model.
virtual std::vector< std::string > announceModels(const std::string &interface) const noexcept=0
Abstract base class for a module, which flexibly provides consumers with common interface derived cla...
Definition: Module.h:68
virtual bool has(const std::string &, const std::string &) const noexcept=0
Checks if this module supplies a particular model of an interface.
virtual std::string name() const noexcept=0
Creates a type-erased wrapper around a shared_ptr to a model of a interface.