Root class that acts as an entry point to the SDF document model. More...
#include <Root.hh>
Public Member Functions | |
Root () | |
Default constructor. More... | |
~Root () | |
Destructor. More... | |
Errors | Load (const std::string &_filename) |
Parse the given SDF file, and generate objects based on types specified in the SDF file. More... | |
void | SetVersion (const std::string &_version) |
Set the SDF version string. More... | |
std::string | Version () const |
Get the SDF version specified in the parsed file or SDF pointer. More... | |
const World * | WorldByIndex (const uint64_t _index) const |
Get a world based on an index. More... | |
uint64_t | WorldCount () const |
Get the number of worlds. More... | |
bool | WorldNameExists (const std::string &_name) const |
Get whether a world name exists. More... | |
Root class that acts as an entry point to the SDF document model.
In this example, a root object is loaded from a file specified in the first command line argument to a program.
sdf::Root::Root | ( | ) |
Default constructor.
sdf::Root::~Root | ( | ) |
Destructor.
Errors sdf::Root::Load | ( | const std::string & | _filename | ) |
void sdf::Root::SetVersion | ( | const std::string & | _version | ) |
std::string sdf::Root::Version | ( | ) | const |
Get the SDF version specified in the parsed file or SDF pointer.
const World* sdf::Root::WorldByIndex | ( | const uint64_t | _index | ) | const |
Get a world based on an index.
[in] | _index | Index of the world. The index should be in the range [0..WorldCount()). |
uint64_t sdf::Root::WorldCount | ( | ) | const |
Get the number of worlds.
bool sdf::Root::WorldNameExists | ( | const std::string & | _name | ) | const |
Get whether a world name exists.
[in] | _name | Name of the world to check. |