Gazebo Plugin

API Reference

3.0.0
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

namespace  gz
 
namespace  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.
 

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).
 
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).