23#include <gz/utils/ImplPtr.hh>
32#pragma warning(disable: 4251)
38 inline namespace SDF_VERSION_NAMESPACE {
73 ATTRIBUTE_INCORRECT_TYPE,
87 ELEMENT_INCORRECT_TYPE,
99 DIRECTORY_NONEXISTANT,
102 MODEL_CANONICAL_LINK_INVALID,
108 NESTED_MODELS_UNSUPPORTED,
111 LINK_INERTIA_INVALID,
114 JOINT_CHILD_LINK_INVALID,
117 JOINT_PARENT_LINK_INVALID,
120 JOINT_PARENT_SAME_AS_CHILD,
124 FRAME_ATTACHED_TO_INVALID,
127 FRAME_ATTACHED_TO_CYCLE,
130 FRAME_ATTACHED_TO_GRAPH_ERROR,
134 POSE_RELATIVE_TO_INVALID,
137 POSE_RELATIVE_TO_CYCLE,
140 POSE_RELATIVE_TO_GRAPH_ERROR,
143 ROTATION_SNAP_CONFIG_ERROR,
149 MODEL_PLACEMENT_FRAME_INVALID,
156 MERGE_INCLUDE_UNSUPPORTED,
164 UNKNOWN_PARAMETER_TYPE,
175 JOINT_AXIS_EXPRESSED_IN_INVALID,
185 JOINT_AXIS_MIMIC_INVALID,
208 const std::string &_filePath);
218 const std::string &_filePath,
int _lineNumber);
236 public: std::optional<std::string>
FilePath()
const;
254 public: std::optional<std::string>
XmlPath()
const;
265 public:
explicit operator bool()
const;
284 GZ_UTILS_IMPL_PTR(dataPtr)
std::string Message() const
Get the error message, which is a description of the error.
friend GZ_SDFORMAT_VISIBLE std::ostream & operator<<(std::ostream &_out, const sdf::Error &_err)
Output operator for an error.
std::optional< std::string > FilePath() const
Get the file path associated with this error.
Error(const ErrorCode _code, const std::string &_message, const std::string &_filePath, int _lineNumber)
Constructor.
bool operator==(const bool _value) const
Compare this Error to a boolean value.
void SetLineNumber(int _lineNumber)
Sets the line number that is associated with this error.
ErrorCode Code() const
Get the error code.
void SetFilePath(const std::string &_filePath)
Sets the file path that is associated with this error.
void SetMessage(const std::string &_message)
Sets the message associated with this error.
Error()
Default constructor.
void SetXmlPath(const std::string &_xmlPath)
Safe bool conversion.
Error(const ErrorCode _code, const std::string &_message, const std::string &_filePath)
Constructor.
std::optional< int > LineNumber() const
Get the line number associated with this error.
std::optional< std::string > XmlPath() const
Get the XPath-like trace that is associated with this error.
Error(const ErrorCode _code, const std::string &_message)
Constructor.
void GZ_SDFORMAT_VISIBLE throwOrPrintError(sdf::Console::ConsoleStream &_out, const sdf::Error &_error)
Prints the error to _out or throw using SDF_ASSERT depending on the ErrorCode in _error.
ErrorCode
Set of error codes.
Definition: Error.hh:48
namespace for Simulation Description Format parser
Definition: Actor.hh:35
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system_util.hh:25