Gazebo Plugin

API Reference

1.4.0
gz/plugin/Info.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 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 
19 #ifndef GZ_PLUGIN_INFO_HH_
20 #define GZ_PLUGIN_INFO_HH_
21 
22 #include <functional>
23 #include <memory>
24 #include <set>
25 #include <string>
26 #include <unordered_map>
27 
28 #include <gz/utilities/SuppressWarning.hh>
29 
30 #include <gz/plugin/Export.hh>
31 
32 namespace ignition
33 {
34  namespace plugin
35  {
38  //
40  const int INFO_API_VERSION = 1;
41 
42  // We use an inline namespace to assist in forward-compatibility. Eventually
43  // we may want to support a version-2 of the Info API, in which case
44  // we will remove the "inline" declaration here, and create a new inline
45  // namespace called "v2". This original Info object will continue to
46  // be accessible for backwards compatibility, and even its symbol name in
47  // the ABI should remain the same.
48  inline namespace v1
49  {
51  struct IGNITION_PLUGIN_VISIBLE Info
52  {
54  void Clear();
55 
57  IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
59  IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
60 
62  IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
64  IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
65 
71  IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
72  using InterfaceCastingMap =
75  IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
76 
82  IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
84  IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
85 
87  IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
88  std::function<void*()> factory;
89  IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
90 
92  IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
93  std::function<void(void*)> deleter;
94  IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
95  };
96  }
97 
102  }
103 }
104 
105 #endif
Definition: gz/plugin/EnablePluginFromThis.hh:25
STL class.
STL class.
const int INFO_API_VERSION
sentinel value to check if a plugin was built with the same version of the Info struct
Definition: gz/plugin/Info.hh:40
IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING std::function< void(void *)> deleter
A method that safely deletes an instance of the plugin.
Definition: gz/plugin/Info.hh:93
void Clear()
Clear out all information contained in this Info object.
InterfaceCastingMap interfaces
Definition: gz/plugin/Info.hh:74
Holds info required to construct a plugin.
Definition: gz/plugin/Info.hh:51
IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING std::set< std::string > aliases
Alternative names that may be used to instantiate the plugin.
Definition: gz/plugin/Info.hh:63
IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING std::set< std::string > demangledInterfaces
This is a set containing the demangled versions of the names of the interfaces provided by this plugi...
Definition: gz/plugin/Info.hh:83
IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING std::string name
The name of the plugin.
Definition: gz/plugin/Info.hh:58
IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING std::function< void *()> factory
A method that instantiates a new instance of a plugin.
Definition: gz/plugin/Info.hh:88