Loading...
Searching...
No Matches
Root.hh
Go to the documentation of this file.
1/*
2 * Copyright 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#ifndef SDF_ROOT_HH_
18#define SDF_ROOT_HH_
19
20#include <string>
21
22#include "sdf/Types.hh"
23#include "sdf/system_util.hh"
24
25namespace sdf
26{
27 // Forward declarations.
28 class RootPrivate;
29 class World;
30
42 {
44 public: Root();
45
47 public: ~Root();
48
54 public: Errors Load(const std::string &_filename);
55
60 public: std::string Version() const;
61
65 public: void SetVersion(const std::string &_version);
66
69 public: uint64_t WorldCount() const;
70
76 public: const World *WorldByIndex(const uint64_t _index) const;
77
81 public: bool WorldNameExists(const std::string &_name) const;
82
84 private: RootPrivate *dataPtr = nullptr;
85 };
86}
87#endif
const World * WorldByIndex(const uint64_t _index) const
Get a world based on an index.
Errors Load(const std::string &_filename)
Parse the given SDF file, and generate objects based on types specified in the SDF file.
std::string Version() const
Get the SDF version specified in the parsed file or SDF pointer.
bool WorldNameExists(const std::string &_name) const
Get whether a world name exists.
Root()
Default constructor.
~Root()
Destructor.
void SetVersion(const std::string &_version)
Set the SDF version string.
uint64_t WorldCount() const
Get the number of worlds.
Definition World.hh:32
namespace for Simulation Description Format parser
Definition Console.hh:36
std::vector< Error > Errors
A vector of Error.
Definition Types.hh:69
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition system_util.hh:48