Fabric 0.2.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
fabric::ParserBase Class Referenceabstract

Abstract base class for XML plan parsing plugins. More...

#include <parser_base.hpp>

Inheritance diagram for fabric::ParserBase:
Inheritance graph
[legend]

Public Member Functions

virtual ~ParserBase ()=default
 
virtual void initialize (const rclcpp::Node::SharedPtr &node)
 Initialize the validation plugin with the given ROS2 node.
 
virtual bool load_file (const std::string &file_path, fabric::Plan &plan)=0
 load a file into an XML document
 
virtual void parse (fabric::Plan &plan)=0
 Parse the given XML plan.
 
virtual bool check_compatibility (const fabric::Plan &plan)=0
 Check the compatibility of the given plan with the given parser.
 

Protected Member Functions

void initialize_base (const rclcpp::Node::SharedPtr &node, const std::string &plugin_name)
 Base initialization method for derived classes.
 

Protected Attributes

rclcpp::Node::SharedPtr node_
 Shared pointer to the ROS2 node.
 
std::string plugin_name_
 Name of the validation plugin.
 

Detailed Description

Abstract base class for XML plan parsing plugins.

Implementations should provide a parse() method that extracts information from the XML plan and return a fabric::Plan object.

Constructor & Destructor Documentation

◆ ~ParserBase()

virtual fabric::ParserBase::~ParserBase ( )
virtualdefault

Member Function Documentation

◆ check_compatibility()

virtual bool fabric::ParserBase::check_compatibility ( const fabric::Plan plan)
pure virtual

Check the compatibility of the given plan with the given parser.

Parameters
planThe plan to check for compatibility.
Returns
true if the plan is compatible, false otherwise.

Implemented in fabric::XMLParser.

◆ initialize()

virtual void fabric::ParserBase::initialize ( const rclcpp::Node::SharedPtr &  node)
inlinevirtual

Initialize the validation plugin with the given ROS2 node.

Parameters
nodeShared pointer to the ROS2 node.
Returns
true if initialization was successful, false otherwise.

Reimplemented in fabric::XMLParser.

◆ initialize_base()

void fabric::ParserBase::initialize_base ( const rclcpp::Node::SharedPtr &  node,
const std::string &  plugin_name 
)
inlineprotected

Base initialization method for derived classes.

Parameters
nodeShared pointer to the ROS2 node.
plugin_nameName of the validation plugin.

◆ load_file()

virtual bool fabric::ParserBase::load_file ( const std::string &  file_path,
fabric::Plan plan 
)
pure virtual

load a file into an XML document

Parameters
documentThe path to the XML file to be loaded
Returns
true if the file was loaded successfully, false otherwise

Implemented in fabric::XMLParser.

◆ parse()

virtual void fabric::ParserBase::parse ( fabric::Plan plan)
pure virtual

Parse the given XML plan.

Parameters
documentThe XMLDocument representing the plan.
planThe parsed plan.

Implemented in fabric::XMLParser.

Member Data Documentation

◆ node_

rclcpp::Node::SharedPtr fabric::ParserBase::node_
protected

Shared pointer to the ROS2 node.

◆ plugin_name_

std::string fabric::ParserBase::plugin_name_
protected

Name of the validation plugin.


The documentation for this class was generated from the following file: