MQTTSuite
Loading...
Searching...
No Matches
inja::StatisticsVisitor Class Reference

A class for counting statistics on a Template. More...

#include <inja.hpp>

Inheritance diagram for inja::StatisticsVisitor:
Collaboration diagram for inja::StatisticsVisitor:

Public Member Functions

 StatisticsVisitor ()
Public Member Functions inherited from inja::NodeVisitor
virtual ~NodeVisitor ()=default

Public Attributes

size_t variable_counter {0}

Private Member Functions

void visit (const BlockNode &node) override
void visit (const TextNode &) override
void visit (const ExpressionNode &) override
void visit (const LiteralNode &) override
void visit (const DataNode &) override
void visit (const FunctionNode &node) override
void visit (const ExpressionListNode &node) override
void visit (const StatementNode &) override
void visit (const ForStatementNode &) override
void visit (const ForArrayStatementNode &node) override
void visit (const ForObjectStatementNode &node) override
void visit (const IfStatementNode &node) override
void visit (const IncludeStatementNode &) override
void visit (const ExtendsStatementNode &) override
void visit (const BlockStatementNode &node) override
void visit (const SetStatementNode &) override

Detailed Description

A class for counting statistics on a Template.

Definition at line 834 of file inja.hpp.

Constructor & Destructor Documentation

◆ StatisticsVisitor()

inja::StatisticsVisitor::StatisticsVisitor ( )
inlineexplicit

Definition at line 899 of file inja.hpp.

899 {
900 }

Referenced by inja::Template::count_variables().

Here is the caller graph for this function:

Member Function Documentation

◆ visit() [1/16]

void inja::StatisticsVisitor::visit ( const BlockNode & node)
inlineoverrideprivatevirtual

Implements inja::NodeVisitor.

Definition at line 835 of file inja.hpp.

835 {
836 for (const auto& n : node.nodes) {
837 n->accept(*this);
838 }
839 }

References inja::AstNode::accept(), and inja::BlockNode::nodes.

Here is the call graph for this function:

◆ visit() [2/16]

void inja::StatisticsVisitor::visit ( const BlockStatementNode & node)
inlineoverrideprivatevirtual

Implements inja::NodeVisitor.

Definition at line 889 of file inja.hpp.

889 {
890 node.block.accept(*this);
891 }

References inja::BlockNode::accept(), and inja::BlockStatementNode::block.

Here is the call graph for this function:

◆ visit() [3/16]

void inja::StatisticsVisitor::visit ( const DataNode & )
inlineoverrideprivatevirtual

Implements inja::NodeVisitor.

Definition at line 848 of file inja.hpp.

848 {
849 variable_counter += 1;
850 }

References variable_counter.

◆ visit() [4/16]

void inja::StatisticsVisitor::visit ( const ExpressionListNode & node)
inlineoverrideprivatevirtual

Implements inja::NodeVisitor.

Definition at line 858 of file inja.hpp.

858 {
859 node.root->accept(*this);
860 }

References inja::ExpressionNode::accept(), and inja::ExpressionListNode::root.

Here is the call graph for this function:

◆ visit() [5/16]

void inja::StatisticsVisitor::visit ( const ExpressionNode & )
inlineoverrideprivatevirtual

Implements inja::NodeVisitor.

Definition at line 843 of file inja.hpp.

843 {
844 }

◆ visit() [6/16]

void inja::StatisticsVisitor::visit ( const ExtendsStatementNode & )
inlineoverrideprivatevirtual

Implements inja::NodeVisitor.

Definition at line 886 of file inja.hpp.

886 {
887 }

◆ visit() [7/16]

void inja::StatisticsVisitor::visit ( const ForArrayStatementNode & node)
inlineoverrideprivatevirtual

Implements inja::NodeVisitor.

Definition at line 867 of file inja.hpp.

867 {
868 node.condition.accept(*this);
869 node.body.accept(*this);
870 }

References inja::BlockNode::accept(), inja::ExpressionListNode::accept(), inja::ForStatementNode::body, and inja::ForStatementNode::condition.

Here is the call graph for this function:

◆ visit() [8/16]

void inja::StatisticsVisitor::visit ( const ForObjectStatementNode & node)
inlineoverrideprivatevirtual

Implements inja::NodeVisitor.

Definition at line 872 of file inja.hpp.

872 {
873 node.condition.accept(*this);
874 node.body.accept(*this);
875 }

References inja::BlockNode::accept(), inja::ExpressionListNode::accept(), inja::ForStatementNode::body, and inja::ForStatementNode::condition.

Here is the call graph for this function:

◆ visit() [9/16]

void inja::StatisticsVisitor::visit ( const ForStatementNode & )
inlineoverrideprivatevirtual

Implements inja::NodeVisitor.

Definition at line 864 of file inja.hpp.

864 {
865 }

◆ visit() [10/16]

void inja::StatisticsVisitor::visit ( const FunctionNode & node)
inlineoverrideprivatevirtual

Implements inja::NodeVisitor.

Definition at line 852 of file inja.hpp.

852 {
853 for (const auto& n : node.arguments) {
854 n->accept(*this);
855 }
856 }

References inja::ExpressionNode::accept(), and inja::FunctionNode::arguments.

Here is the call graph for this function:

◆ visit() [11/16]

void inja::StatisticsVisitor::visit ( const IfStatementNode & node)
inlineoverrideprivatevirtual

Implements inja::NodeVisitor.

Definition at line 877 of file inja.hpp.

877 {
878 node.condition.accept(*this);
879 node.true_statement.accept(*this);
880 node.false_statement.accept(*this);
881 }

References inja::BlockNode::accept(), inja::ExpressionListNode::accept(), inja::IfStatementNode::condition, inja::IfStatementNode::false_statement, and inja::IfStatementNode::true_statement.

Here is the call graph for this function:

◆ visit() [12/16]

void inja::StatisticsVisitor::visit ( const IncludeStatementNode & )
inlineoverrideprivatevirtual

Implements inja::NodeVisitor.

Definition at line 883 of file inja.hpp.

883 {
884 }

◆ visit() [13/16]

void inja::StatisticsVisitor::visit ( const LiteralNode & )
inlineoverrideprivatevirtual

Implements inja::NodeVisitor.

Definition at line 845 of file inja.hpp.

845 {
846 }

◆ visit() [14/16]

void inja::StatisticsVisitor::visit ( const SetStatementNode & )
inlineoverrideprivatevirtual

Implements inja::NodeVisitor.

Definition at line 893 of file inja.hpp.

893 {
894 }

◆ visit() [15/16]

void inja::StatisticsVisitor::visit ( const StatementNode & )
inlineoverrideprivatevirtual

Implements inja::NodeVisitor.

Definition at line 862 of file inja.hpp.

862 {
863 }

◆ visit() [16/16]

void inja::StatisticsVisitor::visit ( const TextNode & )
inlineoverrideprivatevirtual

Implements inja::NodeVisitor.

Definition at line 841 of file inja.hpp.

841 {
842 }

Member Data Documentation

◆ variable_counter

size_t inja::StatisticsVisitor::variable_counter {0}

Definition at line 897 of file inja.hpp.

897{0};

Referenced by inja::Template::count_variables(), and visit().


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