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

unsigned int variable_counter

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 807 of file inja.hpp.

Constructor & Destructor Documentation

◆ StatisticsVisitor()

inja::StatisticsVisitor::StatisticsVisitor ( )
inlineexplicit

Definition at line 872 of file inja.hpp.

873 : variable_counter(0) {
874 }
unsigned int variable_counter
Definition inja.hpp:870

References variable_counter.

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 808 of file inja.hpp.

808 {
809 for (auto& n : node.nodes) {
810 n->accept(*this);
811 }
812 }

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 862 of file inja.hpp.

862 {
863 node.block.accept(*this);
864 }

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 821 of file inja.hpp.

821 {
822 variable_counter += 1;
823 }

References variable_counter.

◆ visit() [4/16]

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

Implements inja::NodeVisitor.

Definition at line 831 of file inja.hpp.

831 {
832 node.root->accept(*this);
833 }

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 816 of file inja.hpp.

816 {
817 }

◆ visit() [6/16]

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

Implements inja::NodeVisitor.

Definition at line 859 of file inja.hpp.

859 {
860 }

◆ visit() [7/16]

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

Implements inja::NodeVisitor.

Definition at line 840 of file inja.hpp.

840 {
841 node.condition.accept(*this);
842 node.body.accept(*this);
843 }

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 845 of file inja.hpp.

845 {
846 node.condition.accept(*this);
847 node.body.accept(*this);
848 }

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 837 of file inja.hpp.

837 {
838 }

◆ visit() [10/16]

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

Implements inja::NodeVisitor.

Definition at line 825 of file inja.hpp.

825 {
826 for (auto& n : node.arguments) {
827 n->accept(*this);
828 }
829 }

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 850 of file inja.hpp.

850 {
851 node.condition.accept(*this);
852 node.true_statement.accept(*this);
853 node.false_statement.accept(*this);
854 }

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 856 of file inja.hpp.

856 {
857 }

◆ visit() [13/16]

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

Implements inja::NodeVisitor.

Definition at line 818 of file inja.hpp.

818 {
819 }

◆ visit() [14/16]

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

Implements inja::NodeVisitor.

Definition at line 866 of file inja.hpp.

866 {
867 }

◆ visit() [15/16]

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

Implements inja::NodeVisitor.

Definition at line 835 of file inja.hpp.

835 {
836 }

◆ visit() [16/16]

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

Implements inja::NodeVisitor.

Definition at line 814 of file inja.hpp.

814 {
815 }

Member Data Documentation

◆ variable_counter

unsigned int inja::StatisticsVisitor::variable_counter

Definition at line 870 of file inja.hpp.

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


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