PandA-2024.02
Public Member Functions | Private Attributes
tree_node_factory Struct Reference

#include <tree_node_factory.hpp>

Inheritance diagram for tree_node_factory:
Inheritance graph
[legend]
Collaboration diagram for tree_node_factory:
Collaboration graph
[legend]

Public Member Functions

 tree_node_factory (const std::map< TreeVocabularyTokenTypes_TokenEnum, std::string > &_tree_node_schema, tree_manager &_TM)
 default constructor More...
 
void create_tree_node (const unsigned int node_id, enum kind)
 tree_node visitors More...
 
- Public Member Functions inherited from object_visitor
virtual ~object_visitor ()
 destructor More...
 
 BOOST_PP_SEQ_FOR_EACH (OPERATOR_MACRO, BOOST_PP_EMPTY, VISITED_OBJ_SEQ1)
 virtual template object functor More...
 
 BOOST_PP_SEQ_FOR_EACH (OPERATOR_MACRO, BOOST_PP_EMPTY, VISITED_OBJ_SEQ2)
 

Private Attributes

const std::map< TreeVocabularyTokenTypes_TokenEnum, std::string > & tree_node_schema
 tree_node_schema expresses the value of the fields of the tree node we would like to create. More...
 
tree_managerTM
 tree manager More...
 
tree_nodecurr_tree_node_ptr
 current tree node filled according to the tree_node_schema More...
 

Detailed Description

Definition at line 68 of file tree_node_factory.hpp.

Constructor & Destructor Documentation

◆ tree_node_factory()

tree_node_factory::tree_node_factory ( const std::map< TreeVocabularyTokenTypes_TokenEnum, std::string > &  _tree_node_schema,
tree_manager _TM 
)
inline

default constructor

Definition at line 71 of file tree_node_factory.hpp.

References object_visitor::BOOST_PP_SEQ_FOR_EACH(), create_tree_node(), OBJ_NOT_SPECIALIZED_SEQ, OBJ_SPECIALIZED_SEQ, OPERATOR_MACRO, and OPERATOR_MACRO_DECL.

Here is the call graph for this function:

Member Function Documentation

◆ create_tree_node()

void tree_node_factory::create_tree_node ( const unsigned int  node_id,
enum kind  tree_node_type 
)

tree_node visitors

Factory method. It creates a tree_node of type equal tree_node_type by using a relation (tree_node_schema) between tree node fields and their values.

Parameters
node_idis the node id of the created object.
tree_node_typeis the type of the node added to the tree_manager For example the following code: std::map<int, std::string> identifier_schema; int identifier_node_id = TM->get_tree_node_n(); identifier_schema[TOK(TOK_STRG)]= "my_identifier"; tree_node_factory TNF(identifier_schema, TM); TNF.create_tree_node(identifier_node_id, TOK(TOK_IDENTIFIER_NODE));

special care is reserved for identifier_nodes

Definition at line 67 of file tree_node_factory.cpp.

References tree_manager::AddTreeNode(), ATTR_MACRO, ATTR_SEQ, object_visitor::BOOST_PP_SEQ_FOR_EACH(), CREATE_TREE_NODE_CASE_BODY, curr_tree_node_ptr, tree_node::get_kind_text(), STR, template_id_expr(), THROW_ASSERT, THROW_ERROR, THROW_UNREACHABLE, TM, TOK, TOK_OPERATOR, TOK_STRG, tree_node_schema, typename_type(), and using_decl().

Referenced by tree_manager::create_tree_node(), and tree_node_factory().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ curr_tree_node_ptr

tree_node* tree_node_factory::curr_tree_node_ptr
private

current tree node filled according to the tree_node_schema

Definition at line 102 of file tree_node_factory.hpp.

Referenced by create_tree_node().

◆ TM

tree_manager& tree_node_factory::TM
private

tree manager

Definition at line 100 of file tree_node_factory.hpp.

Referenced by create_tree_node().

◆ tree_node_schema

const std::map<TreeVocabularyTokenTypes_TokenEnum, std::string>& tree_node_factory::tree_node_schema
private

tree_node_schema expresses the value of the fields of the tree node we would like to create.

Definition at line 98 of file tree_node_factory.hpp.

Referenced by create_tree_node().


The documentation for this struct was generated from the following files:

Generated on Mon Feb 12 2024 13:04:08 for PandA-2024.02 by doxygen 1.8.13