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 #include <ignition/utils/ImplPtr.hh>
22 
23 #include "sdf/SDFImpl.hh"
24 #include "sdf/Types.hh"
25 #include "sdf/sdf_config.h"
26 #include "sdf/system_util.hh"
27 
28 namespace sdf
29 {
30  // Inline bracket to help doxygen filtering.
31  inline namespace SDF_VERSION_NAMESPACE {
32  //
33 
34  // Forward declarations.
35  class Actor;
36  class Light;
37  class Model;
38  class World;
39 
55  {
57  public: Root();
58 
64  public: Errors Load(const std::string &_filename);
65 
72  public: Errors Load(
73  const std::string &_filename, const ParserConfig &_config);
74 
80  public: Errors LoadSdfString(const std::string &_sdf);
81 
88  public: Errors LoadSdfString(
89  const std::string &_sdf, const ParserConfig &_config);
90 
96  public: Errors Load(const SDFPtr _sdf);
97 
104  public: Errors Load(const SDFPtr _sdf, const ParserConfig &_config);
105 
110  public: std::string Version() const;
111 
115  public: void SetVersion(const std::string &_version);
116 
119  public: uint64_t WorldCount() const;
120 
126  public: const World *WorldByIndex(const uint64_t _index) const;
127 
131  public: bool WorldNameExists(const std::string &_name) const;
132 
136  public: const sdf::Model *Model() const;
137 
141  public: const sdf::Light *Light() const;
142 
146  public: const sdf::Actor *Actor() const;
147 
152  public: sdf::ElementPtr Element() const;
153 
155  IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr)
156  };
157  }
158 }
159 #endif
sdf::v12::World
Definition: World.hh:54
sdf::v12::ParserConfig
This class contains configuration options for the libsdformat parser.
Definition: ParserConfig.hh:84
sdf::v12::Actor
Provides a description of an actor.
Definition: Actor.hh:190
sdf
namespace for Simulation Description Format parser
Definition: Actor.hh:33
sdf::v12::Light
Provides a description of a light source.
Definition: Light.hh:63
sdf::v12::Model
Definition: Model.hh:48
sdf::v12::Errors
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:106
Types.hh
SDFORMAT_VISIBLE
#define SDFORMAT_VISIBLE
Definition: system_util.hh:41
sdf::v12::SDFPtr
std::shared_ptr< SDF > SDFPtr
Definition: SDFImpl.hh:52
sdf::v12::Element
SDF Element class.
Definition: Element.hh:73
sdf::v12::Root
Root class that acts as an entry point to the SDF document model.
Definition: Root.hh:54
SDFImpl.hh
system_util.hh
sdf::v12::ElementPtr
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:54