28 #ifndef NODEINSERTCONDITION_H
29 #define NODEINSERTCONDITION_H
32 #include <boost/variant/polymorphic_get.hpp>
34 namespace jmespath {
namespace parser {
57 template <
typename T,
typename
60 T>::value,
int>::type = 0>
64 int targetNodeRank =
nodeRank(targetNode);
65 int currentNodeRank =
nodeRank(node);
67 = boost::polymorphic_get<ast::BinaryExpressionNode>(
69 return (targetNodeRank < currentNodeRank)
70 || ((targetNodeRank == currentNodeRank)
76 template <
typename T,
typename
79 T>::value,
int>::type = 0>
83 int targetNodeRank =
nodeRank(targetNode);
84 int currentNodeRank =
nodeRank(node);
85 return (targetNodeRank < currentNodeRank);
90 #endif // NODEINSERTCONDITION_H
The NodeInsertCondition class is a functor that will either yield a true or false result based on whe...
Definition: nodeinsertcondition.h:41
ValueType value
The variable which stores the node that this object represents.
Definition: variantnode.h:126
int nodeRank(const T &)
Returns the rank of the given node object's type.
Definition: noderank.h:40
The BinaryExpressionNode class is the base class for all node types which consist of a left and a rig...
Definition: binaryexpressionnode.h:39
bool operator()(const ast::ExpressionNode &targetNode, const T &node) const
Returns true or false based on whether the given node should be inserted at the location of the targe...
Definition: nodeinsertcondition.h:61
virtual bool stopsProjection() const =0
Reports whether the node should stop an ongoing projection or not.
virtual bool isProjection() const =0
Reports whether the right hand side expression is projected onto the result of the operation or not...
The ExpressionNode class represents a JMESPath expression.
Definition: expressionnode.h:56
bool result_type
The result type of the functor.
Definition: nodeinsertcondition.h:47