Gazebo Plugin
API Reference
2.0.3
insert_drive_file
Tutorials
library_books
Classes
toc
Namespaces
insert_drive_file
Files
launch
Gazebo Website
Index
List
Hierarchy
Members: All
Members: Functions
Members: Variables
Members: Typedefs
Members: Enumerations
Members: Enumerator
List
Members
Functions
Typedefs
Variables
Enumerations
Enumerator
src
gz-plugin
core
include
gz
plugin
gz/plugin/Factory.hh
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2018 Open Source Robotics Foundation
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*
16
*/
17
18
#ifndef GZ_PLUGIN_FACTORY_HH_
19
#define GZ_PLUGIN_FACTORY_HH_
20
21
#include <chrono>
22
#include <functional>
23
#include <memory>
24
#include <tuple>
25
26
#include <
gz/plugin/EnablePluginFromThis.hh
>
27
28
namespace
gz
29
{
30
namespace
plugin
31
{
36
template
<
typename
Interface>
class
ProductDeleter
;
37
49
template
<
typename
Interface>
50
using
ProductPtr
=
51
std::unique_ptr<Interface, ProductDeleter<Interface>
>;
52
74
template
<
typename
Interface,
typename
... Args>
75
class
Factory
:
public
EnablePluginFromThis
76
{
77
public
:
using
ProductPtrType
=
ProductPtr<Interface>
;
78
85
public
:
ProductPtrType
Construct
(Args&&... _args);
86
92
private
:
virtual
Interface *ImplConstruct(Args&&... _args) = 0;
93
96
public
:
template
<
typename
Product>
97
class
Producing
;
98
};
99
135
void
GZ_PLUGIN_VISIBLE
CleanupLostProducts
(
136
const
std::chrono::nanoseconds
&_safetyWait =
137
std::chrono::nanoseconds
(5));
138
142
std::size_t
GZ_PLUGIN_VISIBLE
LostProductCount
();
143
}
144
}
145
146
#include <gz/plugin/detail/Factory.hh>
147
148
#endif