Go to the documentation of this file.
17 #ifndef SDFORMAT_TYPES_HH_
18 #define SDFORMAT_TYPES_HH_
35 inline namespace SDF_VERSION_NAMESPACE {
53 std::vector<std::string>
split(
const std::string &_str,
54 const std::string &_splitter);
60 std::string
trim(
const char *_in);
66 std::string
trim(
const std::string &_in);
73 inline bool equal(
const T &_a,
const T &_b,
74 const T &_epsilon = 1e-6f)
76 return std::fabs(_a - _b) <= _epsilon;
102 public:
Time(int32_t _sec, int32_t _nsec)
103 : sec(_sec), nsec(_nsec)
114 _out << _time.
sec <<
" " << _time.
nsec;
126 _in.setf(std::ios_base::skipws);
127 _in >> _time.
sec >> _time.
nsec;
134 public:
bool operator ==(
const Time &_time)
const
136 return this->sec == _time.
sec && this->nsec == _time.
nsec;
162 std::pair<std::string, std::string>
SplitName(
163 const std::string &_absoluteName);
172 const std::string &_scopeName,
const std::string &_localName);
class GZ_SDFORMAT_VISIBLE GZ_DEPRECATED(13) Inertia
A class for inertial information about a link.
Definition: Types.hh:147
std::string GZ_SDFORMAT_VISIBLE lowercase(const std::string &_in)
Transforms a string to its lowercase equivalent.
friend std::ostream & operator<<(std::ostream &_out, const Time &_time)
Stream insertion operator.
Definition: Types.hh:111
GZ_SDFORMAT_VISIBLE std::string trim(const char *_in)
Trim leading and trailing whitespace from a string.
Time(int32_t _sec, int32_t _nsec)
Constructor.
Definition: Types.hh:102
namespace for Simulation Description Format parser
Definition: Actor.hh:34
int32_t nsec
Nanoseconds.
Definition: Types.hh:143
GZ_SDFORMAT_VISIBLE std::pair< std::string, std::string > SplitName(const std::string &_absoluteName)
Split a name into a two strings based on the '::' delimeter.
friend std::istream & operator>>(std::istream &_in, Time &_time)
Stream extraction operator.
Definition: Types.hh:122
A Time class, can be used to hold wall- or sim-time.
Definition: Types.hh:91
#define SDFORMAT_VISIBLE
Definition: system_util.hh:25
constexpr char kSdfStringSource[]
The source path replacement if it was parsed from a string, instead of a file.
Definition: Types.hh:42
std::ostream & operator<<(std::ostream &os, ParamStreamer< T > s)
Definition: Param.hh:94
int32_t sec
Seconds.
Definition: Types.hh:140
bool equal(const T &_a, const T &_b, const T &_epsilon=1e-6f)
check if two values are equal, within a tolerance
Definition: Types.hh:73
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:80
Time()
Constructor.
Definition: Types.hh:94
const std::string kSdfScopeDelimiter
Definition: Types.hh:38
constexpr char kUrdfStringSource[]
The source path replacement if the urdf was parsed from a string, instead of a file.
Definition: Types.hh:46
GZ_SDFORMAT_VISIBLE std::string JoinName(const std::string &_scopeName, const std::string &_localName)
Join two strings with the '::' delimiter.
GZ_SDFORMAT_VISIBLE std::vector< std::string > split(const std::string &_str, const std::string &_splitter)
Split a string using the delimiter in splitter.