Scine::Core  3.0.0
Module management and core interface definitions
 All Classes Files Functions Variables Typedefs Pages
sample_namespace::SampleModule Class Reference

Your module class definition. More...

#include <SampleModule.h>

Inheritance diagram for sample_namespace::SampleModule:
Inheritance graph
Collaboration diagram for sample_namespace::SampleModule:
Collaboration graph

Public Member Functions

std::string name () const noexceptfinal
 Creates a type-erased wrapper around a shared_ptr to a model of a interface. More...
 
boost::any get (const std::string &interface, const std::string &model) const final
 Creates a type-erased wrapper around a shared_ptr to a model of a interface. More...
 
bool has (const std::string &interface, const std::string &model) const noexceptfinal
 Checks if this module supplies a particular model of an interface. More...
 
std::vector< std::string > announceInterfaces () const noexceptfinal
 Announces all interfaces of which the module provides at least one model. More...
 
std::vector< std::string > announceModels (const std::string &interface) const noexceptfinal
 
Mandatory virtual interface

Announces the module's name

Static Public Member Functions

static std::shared_ptr
< Scine::Core::Module
make ()
 

Detailed Description

Your module class definition.

Member Function Documentation

std::vector< std::string > sample_namespace::SampleModule::announceInterfaces ( ) const
finalvirtualnoexcept

Announces all interfaces of which the module provides at least one model.

Note
Derived classes can implement this function using DerivedModule.h:
bool FooModule::announceInterfaces() const noexcept final {
return Core::DerivedModule::announceInterfaces<InterfaceModelMap>();
}

Implements Scine::Core::Module.

std::vector< std::string > sample_namespace::SampleModule::announceModels ( const std::string &  interface) const
finalvirtualnoexcept

Announces all models of a particular interface that the module provides

Note
If the class supplies no models of a particular interface, this list is empty.
Derived classes can implement this function using DerivedModule.h:
bool FooModule::announceModels(const std::string& interface) const noexcept final {
return Core::DerivedModule::announceModels<InterfaceModelMap>(interface);
}

Implements Scine::Core::Module.

boost::any sample_namespace::SampleModule::get ( const std::string &  ,
const std::string &   
) const
finalvirtual

Creates a type-erased wrapper around a shared_ptr to a model of a interface.

Note
Derived classes can implement this function using DerivedModule.h:
boost::any FooModule::get(const std::string& interface, const std::string& model) const final {
boost::any resolved = Scine::Core::DerivedModule::resolve<InterfaceModelMap>(interface, model);
if (resolved.empty()) {
}
return resolved;
}
Exceptions
XIf the derived class does not supply models of the interface.
Returns
A type-erased interface model. Use try_cast to extract a pointer to the desired interface interface.

Implements Scine::Core::Module.

bool sample_namespace::SampleModule::has ( const std::string &  ,
const std::string &   
) const
finalvirtualnoexcept

Checks if this module supplies a particular model of an interface.

Note
Derived classes can implement this function using DerivedModule.h:
bool FooModule::has(const std::string& interface, const std::string& model) const noexcept final {
return Core::DerivedModule::has<InterfaceModelMap>(interface, model);
}

Implements Scine::Core::Module.

std::string sample_namespace::SampleModule::name ( ) const
finalvirtualnoexcept

Creates a type-erased wrapper around a shared_ptr to a model of a interface.

Note
Derived classes can implement this function using DerivedModule.h:
boost::any FooModule::get(const std::string& interface, const std::string& model) const final {
boost::any resolved = Scine::Core::DerivedModule::resolve<InterfaceModelMap>(interface, model);
if (resolved.empty()) {
}
return resolved;
}
Exceptions
XIf the derived class does not supply models of the interface.
Returns
A type-erased interface model. Use try_cast to extract a pointer to the desired interface interface.

Implements Scine::Core::Module.


The documentation for this class was generated from the following files: