Ignition Gazebo

API Reference

2.10.0
ServerConfig.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 IGNITION_GAZEBO_SERVERCONFIG_HH_
18 #define IGNITION_GAZEBO_SERVERCONFIG_HH_
19 
20 #include <chrono>
21 #include <list>
22 #include <memory>
23 #include <optional> // NOLINT(*)
24 #include <string>
25 #include <sdf/Element.hh>
26 #include <ignition/gazebo/config.hh>
27 #include <ignition/gazebo/Export.hh>
28 
29 namespace ignition
30 {
31  namespace gazebo
32  {
33  // Inline bracket to help doxygen filtering.
34  inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
35  // Forward declarations.
36  class ServerConfigPrivate;
37 
42  class IGNITION_GAZEBO_VISIBLE ServerConfig
43  {
44  class PluginInfoPrivate;
51  public: class PluginInfo
52  {
54  public: PluginInfo();
55 
57  public: ~PluginInfo();
58 
70  public: PluginInfo(const std::string &_entityName,
71  const std::string &_entityType,
72  const std::string &_filename,
73  const std::string &_name,
74  const sdf::ElementPtr &_sdf);
75 
78  public: PluginInfo(const PluginInfo &_info);
79 
83  public: PluginInfo &operator=(const PluginInfo &_info);
84 
89  public: const std::string &EntityName() const;
90 
95  public: void SetEntityName(const std::string &_entityName);
96 
101  public: const std::string &EntityType() const;
102 
107  public: void SetEntityType(const std::string &_entityType);
108 
111  public: const std::string &Filename() const;
112 
117  public: void SetFilename(const std::string &_filename);
118 
122  public: const std::string &Name() const;
123 
127  public: void SetName(const std::string &_name);
128 
131  public: const sdf::ElementPtr &Sdf() const;
132 
135  public: void SetSdf(const sdf::ElementPtr &_sdf);
136 
139  };
140 
142  public: ServerConfig();
143 
146  public: ServerConfig(const ServerConfig &_config);
147 
149  public: ~ServerConfig();
150 
157  public: bool SetSdfFile(const std::string &_file);
158 
162  public: std::string SdfFile() const;
163 
170  public: bool SetSdfString(const std::string &_sdfString);
171 
175  public: std::string SdfString() const;
176 
179  public: void SetUpdateRate(const double &_hz);
180 
184  public: std::optional<double> UpdateRate() const;
185 
188  public: bool UseLevels() const;
189 
192  public: void SetUseLevels(const bool _levels);
193 
198  public: bool UseDistributedSimulation() const;
199 
204  public: void IGN_DEPRECATED(2) SetUseDistributedSimulation(
205  const bool _distributed);
206 
213  public: void SetNetworkSecondaries(unsigned int _secondaries);
214 
219  public: unsigned int NetworkSecondaries() const;
220 
228  public: void SetNetworkRole(const std::string &_role);
229 
235  public: std::string NetworkRole() const;
236 
239  public: bool UseLogRecord() const;
240 
243  public: void SetUseLogRecord(const bool _record);
244 
247  public: const std::string LogRecordPath() const;
248 
251  public: void SetLogRecordPath(const std::string &_recordPath);
252 
255  public: const std::string LogPlaybackPath() const;
256 
259  public: void SetLogPlaybackPath(const std::string &_playbackPath);
260 
263  public: unsigned int Seed() const;
264 
267  public: void SetSeed(unsigned int _seed);
268 
272  public: std::optional<std::chrono::steady_clock::duration>
273  UpdatePeriod() const;
274 
280  public: const std::string &ResourceCache() const;
281 
287  public: void SetResourceCache(const std::string &_path);
288 
292  public: void AddPlugin(const PluginInfo &_info);
293 
297  public: const std::list<PluginInfo> &Plugins() const;
298 
302  public: ServerConfig &operator=(const ServerConfig &_cfg);
303 
310  Timestamp() const;
311 
313  private: std::unique_ptr<ServerConfigPrivate> dataPtr;
314  };
315  }
316  }
317 }
318 
319 #endif
Configuration parameters for a Server. An instance of this object can be used to construct a Server w...
Definition: ServerConfig.hh:42
Component< std::string, class NameTag > Name
This component holds an entity&#39;s name. The component has no concept of scoped names nor does it care ...
Definition: Name.hh:35
STL class.
STL class.
std::chrono::steady_clock::time_point Timestamp
Information about a plugin that should be loaded by the server. Currently supports attaching a plugi...
Definition: ServerConfig.hh:51
This library is part of the Ignition Robotics project.