TinyURDF 1.0.0
Loading...
Searching...
No Matches
color_parser.h
Go to the documentation of this file.
1#ifndef INCLUDE_TINYURDF_INTERNAL_COLOR_PARSER_H_
2#define INCLUDE_TINYURDF_INTERNAL_COLOR_PARSER_H_
3
4// Copyright 2025 Wissem CHIHA
5
7#include "core/color.h"
8#include "utility/utils.h"
9
10/***
11 * \brief Base parser for color description element
12 * \note This is an elementary base parser.
13 * \example <color rgba="1.0 0.01 0.0 1.0"/>
14 * \note There is no other acceptable format for color definition!
15 */
16class ColorParser final : public ParserBase<Color>
17{
18 public:
20 std::string toString() const override;
21 bool empty() const override;
22 void clear() override;
23 const char* getTypename() const override;
24 bool isA(const char* name) const override;
25 void parse(const tinyxml2::XMLElement* xml) override;
26 std::shared_ptr<Color> get() override;
27
28 private:
29 std::shared_ptr<Color> p_;
30};
31#endif // INCLUDE_TINYURDF_INTERNAL_COLOR_PARSER_H_
Definition color_parser.h:17
ColorParser()
Definition color_parser.cc:3
bool empty() const override
Definition color_parser.cc:15
void parse(const tinyxml2::XMLElement *xml) override
Definition color_parser.cc:31
const char * getTypename() const override
Definition color_parser.cc:23
std::string toString() const override
Definition color_parser.cc:7
bool isA(const char *name) const override
Definition color_parser.cc:27
void clear() override
Definition color_parser.cc:19
std::shared_ptr< Color > get() override
Definition color_parser.cc:37
Definition parser_base.h:15