Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ if(BUILD_PYBIND11_BINDINGS AND BUILD_TESTING)
SOURCES
"${_pluginplay_examples_dir}/classical_force.cpp"
"${_pluginplay_examples_dir}/coulombs_law.cpp"
"${_pluginplay_examples_dir}/load_modules.cpp"
"${_pluginplay_examples_dir}/pluginplay_examples.cpp"
"${_pluginplay_examples_dir}/screened_coulombs_law.cpp"
"${_pluginplay_examples_dir}/templated_coulombs_law.cpp"
TYPE STATIC
Expand Down
11 changes: 10 additions & 1 deletion cxx/include/pluginplay/module/module_class.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#pragma once
#include "pluginplay/types.hpp"
#include <memory>
#include <pluginplay/fields/fields.hpp>
#include <pluginplay/property_type/python_only_property_type.hpp>
#include <pluginplay/utility/uuid.hpp>
Expand Down Expand Up @@ -49,8 +50,13 @@ struct ModuleManagerPIMPL;
* and is needed by the pluginplay framework to correctly use the module. This
* state is not accessible (nor relevant) once the module is running. For the
* most part users will only be interested in algorithm state.
*
* Modules stored in a ModuleManager, ModuleMap, or SubmoduleRequest are owned
* by shared_ptrs. Module derives from enable_shared_from_this so the Python
* bindings can hand out shared ownership of those modules; a copy of a
* Module is still an independent module.
*/
class Module {
class Module : public std::enable_shared_from_this<Module> {
public:
/// Type of a pointer to a PIMPL
using pimpl_ptr = std::unique_ptr<detail_::ModulePIMPL>;
Expand Down Expand Up @@ -745,6 +751,9 @@ class Module {
bool operator!=(const Module& rhs) const { return !((*this) == rhs); }

private:
/// Lets the ModuleManager attach its runtime and caches to the module
friend struct detail_::ModuleManagerPIMPL;

/** @brief Unlocks a locked module
*
* There are very select circumstances when we need to unlock a locked
Expand Down
1 change: 1 addition & 0 deletions cxx/include/pluginplay/module_manager/module_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
#pragma once
#include <pluginplay/module_manager/module_manager_class.hpp>
#include <pluginplay/module_manager/module_map.hpp>
#include <pluginplay/module_manager/qualified_key.hpp>
Loading
Loading