Go to the documentation of this file.
26 #include <ignition/plugin/EnablePluginFromThis.hh>
28 namespace ignition
36 template <typename Interface> class ProductDeleter;
50 using ProductPtr =
75 class Factory : public EnablePluginFromThis
77 public: using ProductPtrType = ProductPtr<Interface>;
85 public: ProductPtrType Construct(Args&&... _args);
135 void IGNITION_PLUGIN_VISIBLE CleanupLostProducts(
136 const std::chrono::nanoseconds &_safetyWait =
142 std::size_t IGNITION_PLUGIN_VISIBLE LostProductCount();
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...
EnablePluginFromThis is an optional base class which can be inherited by Plugin classes. When a Plugin class inherits it and that Plugin class is instantiated using the Loader class, its instance will be able to access the PluginPtr that manages its lifecycle. This interface will also be available by calling instance->QueryInterface<EnablePluginFromThis>()
Get the number of lost products that have currently accumulated since the last time CleanupLostProduc...
ProductPtrType Construct(Args &&... _args)
This function is called by Loader to construct the class that implements the InterfacePtr interface...
This class provides a unary operator for safely deleting pointers to plugin factory products with the...
The Factory class defines a plugin factory that can be used by the Loader class to produce products t...