1#ifndef INCLUDE_TINYURDF_CORE_PARSER_BASE_H_
2#define INCLUDE_TINYURDF_CORE_PARSER_BASE_H_
6#include <loguru/loguru.hpp>
7#include <tinyxml2/tinyxml2.h>
18 const char*
getNameOf(
const tinyxml2::XMLElement* xml) {
19 const char* name = xml->Attribute(
"name");
27 virtual void parse(
const tinyxml2::XMLElement* xml) {
29 LOG_F(ERROR,
"Parser::parse() passed nullptr");
34 template <
typename... Args>
35 void parse(
const tinyxml2::XMLElement* xml) {
38 if constexpr (
sizeof...(Args) > 0) {
43 template <
typename Base,
typename... Iter>
44 void parse(
const tinyxml2::XMLElement* xml) {
49 if constexpr (
sizeof...(Iter) > 0) {
54 virtual std::shared_ptr<T>
get() {
return Tptr; }
Definition object_base.h:11
Definition parser_base.h:16
const char * getNameOf(const tinyxml2::XMLElement *xml)
Definition parser_base.h:18
virtual std::shared_ptr< T > get()
Definition parser_base.h:54
ParserBase()
Definition parser_base.h:57
void parse(const tinyxml2::XMLElement *xml)
Definition parser_base.h:44
void parse(const tinyxml2::XMLElement *xml)
Definition parser_base.h:35
std::shared_ptr< T > Tptr
Definition parser_base.h:60
virtual ~ParserBase()
Definition parser_base.h:58
virtual void parse(const tinyxml2::XMLElement *xml)
Definition parser_base.h:27