Gazebo Gazebo

API Reference

6.16.0
gz/sim/SystemLoader.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 #ifndef GZ_GAZEBO_SYSTEMLOADER_HH_
18 #define GZ_GAZEBO_SYSTEMLOADER_HH_
19 
20 #include <list>
21 #include <memory>
22 #include <optional>
23 #include <string>
24 
25 #include <sdf/Element.hh>
26 #include <sdf/Plugin.hh>
27 
28 #include <gz/sim/Export.hh>
29 #include <gz/sim/System.hh>
31 
32 namespace ignition
33 {
34  namespace gazebo
35  {
36  // Inline bracket to help doxygen filtering.
37  inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
38  // Forward declarations.
39  class IGNITION_GAZEBO_HIDDEN SystemLoaderPrivate;
40 
43  class IGNITION_GAZEBO_VISIBLE SystemLoader
44  {
46  public: explicit SystemLoader();
47 
49  public: ~SystemLoader();
50 
53  public: void AddSystemPluginPath(const std::string &_path);
54 
60  public: std::optional<SystemPluginPtr> LoadPlugin(
61  const sdf::ElementPtr &_sdf);
62 
71  public: std::optional<SystemPluginPtr> LoadPlugin(
72  const std::string &_filename,
73  const std::string &_name,
74  const sdf::ElementPtr &_sdf);
75 
79  public: std::optional<SystemPluginPtr> LoadPlugin(
80  const sdf::Plugin &_plugin);
81 
84  public: std::string PrettyStr() const;
85 
88  public: std::list<std::string> PluginPaths() const;
89 
91  private: std::unique_ptr<SystemLoaderPrivate> dataPtr;
92  };
93  }
95  }
96 }
97 #endif // GZ_GAZEBO_SYSTEMLOADER_HH_
98 
This library is part of the Gazebo project.
STL class.
STL class.
std::string PrettyStr() const
Makes a printable string with info about systems.
STL class.
class IGNITION_GAZEBO_HIDDEN SystemLoaderPrivate
Definition: gz/sim/SystemLoader.hh:39
void AddSystemPluginPath(const std::string &_path)
Add path to search for plugins.
std::optional< SystemPluginPtr > LoadPlugin(const sdf::ElementPtr &_sdf)
Load and instantiate system plugin from an SDF element.
Class for loading/unloading System plugins.
Definition: gz/sim/SystemLoader.hh:43
std::list< std::string > PluginPaths() const
Get the plugin search paths used for loading system plugins.