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... | |
class | Factory< Interface, Args >::Producing< Product > |
class | ProductDeleter< Interface > |
This class provides a unary operator for safely deleting pointers to plugin factory products with the type Interface . If it gets passed an Interface pointer that is not pointing to a factory plugin product, then this just performs a normal delete. 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... | |