gz/plugin/Factory.hh File Reference
#include <chrono>
#include <functional>
#include <memory>
#include <tuple>
#include <gz/plugin/EnablePluginFromThis.hh>
#include <gz/plugin/detail/Factory.hh>
Go to the source code of this file.
Classes | |
class | Factory< Interface, Args > |
The Factory class defines a plugin factory that can be used by the Loader class to produce products that implement an interface. More... | |
Namespaces | |
gz | |
gz::plugin | |
Typedefs | |
template<typename Interface > | |
using | ProductPtr = std::unique_ptr< Interface, ProductDeleter< Interface > > |
ProductPtr is a derivative of std::unique_ptr that can safely manage the products that come out of a plugin factory. It is strongly recommended that factory products use a ProductPtr to manage the lifecycle of a factory product. More... | |
Functions | |
void | CleanupLostProducts (const std::chrono::nanoseconds &_safetyWait=std::chrono::nanoseconds(5)) |
Call this function to cleanup the Factories of any Products which were not managed by a ProductPtr or deleted by a ProductDeleter (in other words, the Product was released from its ProductPtr and then its lifecycle was managed by a framework that does not know it has special deletion requirements). More... | |
std::size_t | LostProductCount () |
Get the number of lost products that have currently accumulated since the last time CleanupLostProducts() was called (or since the program began, if CleanupLostProducts() has not been called yet). More... | |