Ignition Gazebo

API Reference

3.5.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 <vector>
26 #include <sdf/Element.hh>
27 #include <ignition/gazebo/config.hh>
28 #include <ignition/gazebo/Export.hh>
29 
30 namespace ignition
31 {
32  namespace gazebo
33  {
34  // Inline bracket to help doxygen filtering.
35  inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
36  // Forward declarations.
37  class ServerConfigPrivate;
38 
43  class IGNITION_GAZEBO_VISIBLE ServerConfig
44  {
45  class PluginInfoPrivate;
52  public: class PluginInfo
53  {
55  public: PluginInfo();
56 
58  public: ~PluginInfo();
59 
71  public: PluginInfo(const std::string &_entityName,
72  const std::string &_entityType,
73  const std::string &_filename,
74  const std::string &_name,
75  const sdf::ElementPtr &_sdf);
76 
79  public: PluginInfo(const PluginInfo &_info);
80 
84  public: PluginInfo &operator=(const PluginInfo &_info);
85 
90  public: const std::string &EntityName() const;
91 
96  public: void SetEntityName(const std::string &_entityName);
97 
102  public: const std::string &EntityType() const;
103 
108  public: void SetEntityType(const std::string &_entityType);
109 
112  public: const std::string &Filename() const;
113 
118  public: void SetFilename(const std::string &_filename);
119 
123  public: const std::string &Name() const;
124 
128  public: void SetName(const std::string &_name);
129 
132  public: const sdf::ElementPtr &Sdf() const;
133 
136  public: void SetSdf(const sdf::ElementPtr &_sdf);
137 
140  };
141 
143  public: ServerConfig();
144 
147  public: ServerConfig(const ServerConfig &_config);
148 
150  public: ~ServerConfig();
151 
158  public: bool SetSdfFile(const std::string &_file);
159 
163  public: std::string SdfFile() const;
164 
171  public: bool SetSdfString(const std::string &_sdfString);
172 
176  public: std::string SdfString() const;
177 
180  public: void SetUpdateRate(const double &_hz);
181 
185  public: std::optional<double> UpdateRate() const;
186 
189  public: bool UseLevels() const;
190 
193  public: void SetUseLevels(const bool _levels);
194 
199  public: bool UseDistributedSimulation() const;
200 
207  public: void SetNetworkSecondaries(unsigned int _secondaries);
208 
213  public: unsigned int NetworkSecondaries() const;
214 
222  public: void SetNetworkRole(const std::string &_role);
223 
229  public: std::string NetworkRole() const;
230 
233  public: bool UseLogRecord() const;
234 
237  public: void SetUseLogRecord(const bool _record);
238 
241  public: const std::string LogRecordPath() const;
242 
245  public: void SetLogRecordPath(const std::string &_recordPath);
246 
250  public: bool LogIgnoreSdfPath() const;
251 
257  public: void SetLogIgnoreSdfPath(bool _ignore);
258 
261  public: void AddLogRecordTopic(const std::string &_topic);
262 
265  public: void ClearLogRecordTopics();
266 
270  public: const std::vector<std::string> &LogRecordTopics() const;
271 
274  public: const std::string LogPlaybackPath() const;
275 
278  public: void SetLogPlaybackPath(const std::string &_playbackPath);
279 
282  public: bool LogRecordResources() const;
283 
286  public: void SetLogRecordResources(bool _recordResources);
287 
290  public: std::string LogRecordCompressPath() const;
291 
294  public: void SetLogRecordCompressPath(const std::string &_path);
295 
298  public: unsigned int Seed() const;
299 
302  public: void SetSeed(unsigned int _seed);
303 
307  public: std::optional<std::chrono::steady_clock::duration>
308  UpdatePeriod() const;
309 
315  public: const std::string &ResourceCache() const;
316 
322  public: void SetResourceCache(const std::string &_path);
323 
326  public: const std::string &PhysicsEngine() const;
327 
330  public: void SetPhysicsEngine(const std::string &_physicsEngine);
331 
334  public: const std::string &RenderEngineServer() const;
335 
338  public: const std::string &RenderEngineGui() const;
339 
342  public: void SetRenderEngineServer(
343  const std::string &_renderEngineServer);
344 
347  public: void SetRenderEngineGui(const std::string &_renderEngineGui);
348 
352  public: void AddPlugin(const PluginInfo &_info);
353 
357  public: const std::list<PluginInfo> &Plugins() const;
358 
362  public: ServerConfig &operator=(const ServerConfig &_cfg);
363 
370  Timestamp() const;
371 
373  private: std::unique_ptr<ServerConfigPrivate> dataPtr;
374  };
375  }
376  }
377 }
378 
379 #endif
Configuration parameters for a Server. An instance of this object can be used to construct a Server w...
Definition: ServerConfig.hh:43
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.
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:52
This library is part of the Ignition Robotics project.