YugabyteDB (2.13.1.0-b60, 21121d69985fbf76aa6958d8f04a9bfa936293b5)

Coverage Report

Created: 2022-03-22 16:43

/Users/deen/code/yugabyte-db/src/yb/yql/cql/ql/ptree/list_node.h
Line
Count
Source (jump to first uncovered line)
1
//--------------------------------------------------------------------------------------------------
2
// Copyright (c) YugaByte, Inc.
3
//
4
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5
// in compliance with the License.  You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software distributed under the License
10
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11
// or implied.  See the License for the specific language governing permissions and limitations
12
// under the License.
13
//
14
//
15
// List Node Declaration.
16
//
17
// This modules includes specifications for nodes that contain a list of tree nodes.
18
//
19
// YCQL audit expects these nodes to be DMLs encased between PTStartTransaction and PTCommit,
20
// which is verified during Analyze step.
21
//--------------------------------------------------------------------------------------------------
22
23
#ifndef YB_YQL_CQL_QL_PTREE_LIST_NODE_H_
24
#define YB_YQL_CQL_QL_PTREE_LIST_NODE_H_
25
26
#include "yb/util/math_util.h"
27
#include "yb/util/memory/arena.h"
28
#include "yb/util/status.h"
29
30
#include "yb/yql/cql/ql/ptree/tree_node.h"
31
#include "yb/yql/cql/ql/util/errcodes.h"
32
33
namespace yb {
34
namespace ql {
35
36
// Operations that apply to each treenode of this list.
37
template<typename ContextType, typename NodeType = TreeNode>
38
using TreeNodePtrOperator = std::function<Status(NodeType*, ContextType*)>;
39
40
// TreeNode base class.
41
template<typename NodeType>
42
class TreeListNode : public TreeNode {
43
 public:
44
  //------------------------------------------------------------------------------------------------
45
  // Public types.
46
  typedef MCSharedPtr<TreeListNode> SharedPtr;
47
  typedef MCSharedPtr<const TreeListNode> SharedPtrConst;
48
49
  //------------------------------------------------------------------------------------------------
50
  // Public functions.
51
  explicit TreeListNode(MemoryContext *memory_context,
52
                        YBLocationPtr loc,
53
                        const MCSharedPtr<NodeType>& tnode = nullptr)
54
      : TreeNode(memory_context, loc),
55
1.04M
        node_list_(memory_context) {
56
1.04M
    Append(tnode);
57
1.04M
  }
yb::ql::TreeListNode<yb::ql::PTKeyspaceProperty>::TreeListNode(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::YBLocation>, std::__1::shared_ptr<yb::ql::PTKeyspaceProperty> const&)
Line
Count
Source
55
380
        node_list_(memory_context) {
56
380
    Append(tnode);
57
380
  }
yb::ql::TreeListNode<yb::ql::PTTableProperty>::TreeListNode(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::YBLocation>, std::__1::shared_ptr<yb::ql::PTTableProperty> const&)
Line
Count
Source
55
1.91k
        node_list_(memory_context) {
56
1.91k
    Append(tnode);
57
1.91k
  }
yb::ql::TreeListNode<yb::ql::PTDmlWriteProperty>::TreeListNode(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::YBLocation>, std::__1::shared_ptr<yb::ql::PTDmlWriteProperty> const&)
Line
Count
Source
55
112
        node_list_(memory_context) {
56
112
    Append(tnode);
57
112
  }
yb::ql::TreeListNode<yb::ql::PTExpr>::TreeListNode(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::YBLocation>, std::__1::shared_ptr<yb::ql::PTExpr> const&)
Line
Count
Source
55
317k
        node_list_(memory_context) {
56
317k
    Append(tnode);
57
317k
  }
yb::ql::TreeListNode<yb::ql::TreeListNode<yb::ql::PTExpr> >::TreeListNode(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::YBLocation>, std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::PTExpr> > const&)
Line
Count
Source
55
49.9k
        node_list_(memory_context) {
56
49.9k
    Append(tnode);
57
49.9k
  }
yb::ql::TreeListNode<yb::ql::TreeNode>::TreeListNode(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::YBLocation>, std::__1::shared_ptr<yb::ql::TreeNode> const&)
Line
Count
Source
55
342k
        node_list_(memory_context) {
56
342k
    Append(tnode);
57
342k
  }
yb::ql::TreeListNode<yb::ql::PTTypeField>::TreeListNode(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::YBLocation>, std::__1::shared_ptr<yb::ql::PTTypeField> const&)
Line
Count
Source
55
85
        node_list_(memory_context) {
56
85
    Append(tnode);
57
85
  }
yb::ql::TreeListNode<yb::ql::PTQualifiedName>::TreeListNode(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::YBLocation>, std::__1::shared_ptr<yb::ql::PTQualifiedName> const&)
Line
Count
Source
55
56.6k
        node_list_(memory_context) {
56
56.6k
    Append(tnode);
57
56.6k
  }
yb::ql::TreeListNode<yb::ql::PTOrderBy>::TreeListNode(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::YBLocation>, std::__1::shared_ptr<yb::ql::PTOrderBy> const&)
Line
Count
Source
55
212
        node_list_(memory_context) {
56
212
    Append(tnode);
57
212
  }
yb::ql::TreeListNode<yb::ql::PTDmlUsingClauseElement>::TreeListNode(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::YBLocation>, std::__1::shared_ptr<yb::ql::PTDmlUsingClauseElement> const&)
Line
Count
Source
55
212
        node_list_(memory_context) {
56
212
    Append(tnode);
57
212
  }
yb::ql::TreeListNode<yb::ql::PTAssign>::TreeListNode(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::YBLocation>, std::__1::shared_ptr<yb::ql::PTAssign> const&)
Line
Count
Source
55
3.34k
        node_list_(memory_context) {
56
3.34k
    Append(tnode);
57
3.34k
  }
yb::ql::TreeListNode<yb::ql::PTTableRef>::TreeListNode(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::YBLocation>, std::__1::shared_ptr<yb::ql::PTTableRef> const&)
Line
Count
Source
55
267k
        node_list_(memory_context) {
56
267k
    Append(tnode);
57
267k
  }
yb::ql::TreeListNode<yb::ql::PTRoleOption>::TreeListNode(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::YBLocation>, std::__1::shared_ptr<yb::ql::PTRoleOption> const&)
Line
Count
Source
55
797
        node_list_(memory_context) {
56
797
    Append(tnode);
57
797
  }
58
1.04M
  virtual ~TreeListNode() {
59
1.04M
  }
yb::ql::TreeListNode<yb::ql::PTKeyspaceProperty>::~TreeListNode()
Line
Count
Source
58
208
  virtual ~TreeListNode() {
59
208
  }
yb::ql::TreeListNode<yb::ql::PTTableProperty>::~TreeListNode()
Line
Count
Source
58
1.75k
  virtual ~TreeListNode() {
59
1.75k
  }
yb::ql::TreeListNode<yb::ql::PTDmlWriteProperty>::~TreeListNode()
Line
Count
Source
58
64
  virtual ~TreeListNode() {
59
64
  }
yb::ql::TreeListNode<yb::ql::PTDmlUsingClauseElement>::~TreeListNode()
Line
Count
Source
58
192
  virtual ~TreeListNode() {
59
192
  }
yb::ql::TreeListNode<yb::ql::PTExpr>::~TreeListNode()
Line
Count
Source
58
321k
  virtual ~TreeListNode() {
59
321k
  }
yb::ql::TreeListNode<yb::ql::TreeListNode<yb::ql::PTExpr> >::~TreeListNode()
Line
Count
Source
58
49.1k
  virtual ~TreeListNode() {
59
49.1k
  }
yb::ql::TreeListNode<yb::ql::TreeNode>::~TreeListNode()
Line
Count
Source
58
347k
  virtual ~TreeListNode() {
59
347k
  }
yb::ql::TreeListNode<yb::ql::PTTypeField>::~TreeListNode()
Line
Count
Source
58
58
  virtual ~TreeListNode() {
59
58
  }
yb::ql::TreeListNode<yb::ql::PTQualifiedName>::~TreeListNode()
Line
Count
Source
58
55.7k
  virtual ~TreeListNode() {
59
55.7k
  }
yb::ql::TreeListNode<yb::ql::PTOrderBy>::~TreeListNode()
Line
Count
Source
58
210
  virtual ~TreeListNode() {
59
210
  }
yb::ql::TreeListNode<yb::ql::PTAssign>::~TreeListNode()
Line
Count
Source
58
3.22k
  virtual ~TreeListNode() {
59
3.22k
  }
yb::ql::TreeListNode<yb::ql::PTTableRef>::~TreeListNode()
Line
Count
Source
58
269k
  virtual ~TreeListNode() {
59
269k
  }
yb::ql::TreeListNode<yb::ql::PTRoleOption>::~TreeListNode()
Line
Count
Source
58
797
  virtual ~TreeListNode() {
59
797
  }
60
61
  // Node type.
62
507k
  virtual TreeNodeOpcode opcode() const override {
63
507k
    return TreeNodeOpcode::kPTListNode;
64
507k
  }
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTProperty>::opcode() const
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTKeyspaceProperty>::opcode() const
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTTableProperty>::opcode() const
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTDmlWriteProperty>::opcode() const
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTDmlUsingClauseElement>::opcode() const
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTExpr>::opcode() const
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::TreeListNode<yb::ql::PTExpr> >::opcode() const
yb::ql::TreeListNode<yb::ql::TreeNode>::opcode() const
Line
Count
Source
62
507k
  virtual TreeNodeOpcode opcode() const override {
63
507k
    return TreeNodeOpcode::kPTListNode;
64
507k
  }
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTTypeField>::opcode() const
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTQualifiedName>::opcode() const
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTOrderBy>::opcode() const
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTAssign>::opcode() const
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTTableRef>::opcode() const
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTRoleOption>::opcode() const
65
66
  // Add a tree node at the end.
67
1.75M
  void Append(const MCSharedPtr<NodeType>& tnode) {
68
1.75M
    if (tnode != nullptr) {
69
1.69M
      node_list_.push_back(tnode);
70
1.69M
    }
71
1.75M
  }
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTProperty>::Append(std::__1::shared_ptr<yb::ql::PTProperty> const&)
yb::ql::TreeListNode<yb::ql::PTKeyspaceProperty>::Append(std::__1::shared_ptr<yb::ql::PTKeyspaceProperty> const&)
Line
Count
Source
67
748
  void Append(const MCSharedPtr<NodeType>& tnode) {
68
748
    if (tnode != nullptr) {
69
576
      node_list_.push_back(tnode);
70
576
    }
71
748
  }
yb::ql::TreeListNode<yb::ql::PTTableProperty>::Append(std::__1::shared_ptr<yb::ql::PTTableProperty> const&)
Line
Count
Source
67
3.34k
  void Append(const MCSharedPtr<NodeType>& tnode) {
68
3.34k
    if (tnode != nullptr) {
69
2.81k
      node_list_.push_back(tnode);
70
2.81k
    }
71
3.34k
  }
yb::ql::TreeListNode<yb::ql::PTDmlWriteProperty>::Append(std::__1::shared_ptr<yb::ql::PTDmlWriteProperty> const&)
Line
Count
Source
67
170
  void Append(const MCSharedPtr<NodeType>& tnode) {
68
170
    if (tnode != nullptr) {
69
114
      node_list_.push_back(tnode);
70
114
    }
71
170
  }
yb::ql::TreeListNode<yb::ql::PTExpr>::Append(std::__1::shared_ptr<yb::ql::PTExpr> const&)
Line
Count
Source
67
779k
  void Append(const MCSharedPtr<NodeType>& tnode) {
68
779k
    if (tnode != nullptr) {
69
774k
      node_list_.push_back(tnode);
70
774k
    }
71
779k
  }
yb::ql::TreeListNode<yb::ql::TreeListNode<yb::ql::PTExpr> >::Append(std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::PTExpr> > const&)
Line
Count
Source
67
99.9k
  void Append(const MCSharedPtr<NodeType>& tnode) {
68
99.9k
    if (tnode != nullptr) {
69
49.9k
      node_list_.push_back(tnode);
70
49.9k
    }
71
99.9k
  }
yb::ql::TreeListNode<yb::ql::PTDmlUsingClauseElement>::Append(std::__1::shared_ptr<yb::ql::PTDmlUsingClauseElement> const&)
Line
Count
Source
67
429
  void Append(const MCSharedPtr<NodeType>& tnode) {
68
429
    if (tnode != nullptr) {
69
217
      node_list_.push_back(tnode);
70
217
    }
71
429
  }
yb::ql::TreeListNode<yb::ql::TreeNode>::Append(std::__1::shared_ptr<yb::ql::TreeNode> const&)
Line
Count
Source
67
354k
  void Append(const MCSharedPtr<NodeType>& tnode) {
68
354k
    if (tnode != nullptr) {
69
353k
      node_list_.push_back(tnode);
70
353k
    }
71
354k
  }
yb::ql::TreeListNode<yb::ql::PTTypeField>::Append(std::__1::shared_ptr<yb::ql::PTTypeField> const&)
Line
Count
Source
67
133
  void Append(const MCSharedPtr<NodeType>& tnode) {
68
133
    if (tnode != nullptr) {
69
133
      node_list_.push_back(tnode);
70
133
    }
71
133
  }
yb::ql::TreeListNode<yb::ql::PTQualifiedName>::Append(std::__1::shared_ptr<yb::ql::PTQualifiedName> const&)
Line
Count
Source
67
241k
  void Append(const MCSharedPtr<NodeType>& tnode) {
68
241k
    if (tnode != nullptr) {
69
241k
      node_list_.push_back(tnode);
70
241k
    }
71
241k
  }
yb::ql::TreeListNode<yb::ql::PTOrderBy>::Append(std::__1::shared_ptr<yb::ql::PTOrderBy> const&)
Line
Count
Source
67
308
  void Append(const MCSharedPtr<NodeType>& tnode) {
68
308
    if (tnode != nullptr) {
69
308
      node_list_.push_back(tnode);
70
308
    }
71
308
  }
yb::ql::TreeListNode<yb::ql::PTAssign>::Append(std::__1::shared_ptr<yb::ql::PTAssign> const&)
Line
Count
Source
67
7.06k
  void Append(const MCSharedPtr<NodeType>& tnode) {
68
7.06k
    if (tnode != nullptr) {
69
7.06k
      node_list_.push_back(tnode);
70
7.06k
    }
71
7.06k
  }
yb::ql::TreeListNode<yb::ql::PTTableRef>::Append(std::__1::shared_ptr<yb::ql::PTTableRef> const&)
Line
Count
Source
67
267k
  void Append(const MCSharedPtr<NodeType>& tnode) {
68
267k
    if (tnode != nullptr) {
69
264k
      node_list_.push_back(tnode);
70
264k
    }
71
267k
  }
yb::ql::TreeListNode<yb::ql::PTRoleOption>::Append(std::__1::shared_ptr<yb::ql::PTRoleOption> const&)
Line
Count
Source
67
2.19k
  void Append(const MCSharedPtr<NodeType>& tnode) {
68
2.19k
    if (tnode != nullptr) {
69
2.19k
      node_list_.push_back(tnode);
70
2.19k
    }
71
2.19k
  }
72
73
  // Move all listed entries from "tnode" to this node. The list in tnode will become empty after
74
  // this call.
75
1
  void Splice(const MCSharedPtr<TreeListNode>& tnode) {
76
1
    if (tnode != nullptr) {
77
      // tnode->node_list_ would be empty after this call to "splice".
78
1
      node_list_.splice(node_list_.end(), tnode->node_list_);
79
1
    }
80
1
  }
81
82
  // Add a tree node at the beginning.
83
702
  void Prepend(const MCSharedPtr<NodeType>& tnode) {
84
702
    if (tnode != nullptr) {
85
702
      node_list_.push_front(tnode);
86
702
    }
87
702
  }
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::TreeListNode<yb::ql::PTExpr> >::Prepend(std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::PTExpr> > const&)
yb::ql::TreeListNode<yb::ql::TreeNode>::Prepend(std::__1::shared_ptr<yb::ql::TreeNode> const&)
Line
Count
Source
83
62
  void Prepend(const MCSharedPtr<NodeType>& tnode) {
84
62
    if (tnode != nullptr) {
85
62
      node_list_.push_front(tnode);
86
62
    }
87
62
  }
yb::ql::TreeListNode<yb::ql::PTExpr>::Prepend(std::__1::shared_ptr<yb::ql::PTExpr> const&)
Line
Count
Source
83
640
  void Prepend(const MCSharedPtr<NodeType>& tnode) {
84
640
    if (tnode != nullptr) {
85
640
      node_list_.push_front(tnode);
86
640
    }
87
640
  }
88
89
  template<typename... TypeArgs>
90
997k
  inline static TreeListNode::SharedPtr MakeShared(MemoryContext *memctx, TypeArgs&&... args) {
91
997k
    return MCMakeShared<TreeListNode>(memctx, std::forward<TypeArgs>(args)...);
92
997k
  }
std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::PTKeyspaceProperty> > yb::ql::TreeListNode<yb::ql::PTKeyspaceProperty>::MakeShared<std::__1::shared_ptr<yb::ql::YBLocation>&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::YBLocation>&)
Line
Count
Source
90
172
  inline static TreeListNode::SharedPtr MakeShared(MemoryContext *memctx, TypeArgs&&... args) {
91
172
    return MCMakeShared<TreeListNode>(memctx, std::forward<TypeArgs>(args)...);
92
172
  }
std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::PTTableProperty> > yb::ql::TreeListNode<yb::ql::PTTableProperty>::MakeShared<std::__1::shared_ptr<yb::ql::YBLocation>&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::YBLocation>&)
Line
Count
Source
90
529
  inline static TreeListNode::SharedPtr MakeShared(MemoryContext *memctx, TypeArgs&&... args) {
91
529
    return MCMakeShared<TreeListNode>(memctx, std::forward<TypeArgs>(args)...);
92
529
  }
std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::PTDmlWriteProperty> > yb::ql::TreeListNode<yb::ql::PTDmlWriteProperty>::MakeShared<std::__1::shared_ptr<yb::ql::YBLocation>&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::YBLocation>&)
Line
Count
Source
90
56
  inline static TreeListNode::SharedPtr MakeShared(MemoryContext *memctx, TypeArgs&&... args) {
91
56
    return MCMakeShared<TreeListNode>(memctx, std::forward<TypeArgs>(args)...);
92
56
  }
std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::PTExpr> > yb::ql::TreeListNode<yb::ql::PTExpr>::MakeShared<std::__1::shared_ptr<yb::ql::YBLocation> const&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::YBLocation> const&)
Line
Count
Source
90
542
  inline static TreeListNode::SharedPtr MakeShared(MemoryContext *memctx, TypeArgs&&... args) {
91
542
    return MCMakeShared<TreeListNode>(memctx, std::forward<TypeArgs>(args)...);
92
542
  }
std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::TreeNode> > yb::ql::TreeListNode<yb::ql::TreeNode>::MakeShared<std::__1::shared_ptr<yb::ql::Location>, std::__1::shared_ptr<yb::ql::TreeNode>&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::Location>&&, std::__1::shared_ptr<yb::ql::TreeNode>&)
Line
Count
Source
90
340k
  inline static TreeListNode::SharedPtr MakeShared(MemoryContext *memctx, TypeArgs&&... args) {
91
340k
    return MCMakeShared<TreeListNode>(memctx, std::forward<TypeArgs>(args)...);
92
340k
  }
std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::PTTypeField> > yb::ql::TreeListNode<yb::ql::PTTypeField>::MakeShared<std::__1::shared_ptr<yb::ql::Location>, std::__1::shared_ptr<yb::ql::PTTypeField>&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::Location>&&, std::__1::shared_ptr<yb::ql::PTTypeField>&)
Line
Count
Source
90
85
  inline static TreeListNode::SharedPtr MakeShared(MemoryContext *memctx, TypeArgs&&... args) {
91
85
    return MCMakeShared<TreeListNode>(memctx, std::forward<TypeArgs>(args)...);
92
85
  }
std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::TreeNode> > yb::ql::TreeListNode<yb::ql::TreeNode>::MakeShared<std::__1::shared_ptr<yb::ql::Location>, std::__1::shared_ptr<yb::ql::PTStatic>&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::Location>&&, std::__1::shared_ptr<yb::ql::PTStatic>&)
Line
Count
Source
90
46
  inline static TreeListNode::SharedPtr MakeShared(MemoryContext *memctx, TypeArgs&&... args) {
91
46
    return MCMakeShared<TreeListNode>(memctx, std::forward<TypeArgs>(args)...);
92
46
  }
std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::TreeNode> > yb::ql::TreeListNode<yb::ql::TreeNode>::MakeShared<std::__1::shared_ptr<yb::ql::Location>, std::__1::shared_ptr<yb::ql::PTIndexColumn>&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::Location>&&, std::__1::shared_ptr<yb::ql::PTIndexColumn>&)
Line
Count
Source
90
1.92k
  inline static TreeListNode::SharedPtr MakeShared(MemoryContext *memctx, TypeArgs&&... args) {
91
1.92k
    return MCMakeShared<TreeListNode>(memctx, std::forward<TypeArgs>(args)...);
92
1.92k
  }
std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::TreeNode> > yb::ql::TreeListNode<yb::ql::TreeNode>::MakeShared<std::__1::shared_ptr<yb::ql::Location>, std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::TreeNode> >&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::Location>&&, std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::TreeNode> >&)
Line
Count
Source
90
970
  inline static TreeListNode::SharedPtr MakeShared(MemoryContext *memctx, TypeArgs&&... args) {
91
970
    return MCMakeShared<TreeListNode>(memctx, std::forward<TypeArgs>(args)...);
92
970
  }
std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::PTQualifiedName> > yb::ql::TreeListNode<yb::ql::PTQualifiedName>::MakeShared<std::__1::shared_ptr<yb::ql::Location>, std::__1::shared_ptr<yb::ql::PTQualifiedName>&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::Location>&&, std::__1::shared_ptr<yb::ql::PTQualifiedName>&)
Line
Count
Source
90
56.6k
  inline static TreeListNode::SharedPtr MakeShared(MemoryContext *memctx, TypeArgs&&... args) {
91
56.6k
    return MCMakeShared<TreeListNode>(memctx, std::forward<TypeArgs>(args)...);
92
56.6k
  }
std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::PTOrderBy> > yb::ql::TreeListNode<yb::ql::PTOrderBy>::MakeShared<std::__1::shared_ptr<yb::ql::Location>, std::__1::shared_ptr<yb::ql::PTOrderBy>&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::Location>&&, std::__1::shared_ptr<yb::ql::PTOrderBy>&)
Line
Count
Source
90
212
  inline static TreeListNode::SharedPtr MakeShared(MemoryContext *memctx, TypeArgs&&... args) {
91
212
    return MCMakeShared<TreeListNode>(memctx, std::forward<TypeArgs>(args)...);
92
212
  }
std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::PTExpr> > yb::ql::TreeListNode<yb::ql::PTExpr>::MakeShared<std::__1::shared_ptr<yb::ql::Location>, std::__1::shared_ptr<yb::ql::PTExpr>&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::Location>&&, std::__1::shared_ptr<yb::ql::PTExpr>&)
Line
Count
Source
90
319k
  inline static TreeListNode::SharedPtr MakeShared(MemoryContext *memctx, TypeArgs&&... args) {
91
319k
    return MCMakeShared<TreeListNode>(memctx, std::forward<TypeArgs>(args)...);
92
319k
  }
std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::PTAssign> > yb::ql::TreeListNode<yb::ql::PTAssign>::MakeShared<std::__1::shared_ptr<yb::ql::Location>, std::__1::shared_ptr<yb::ql::PTAssign>&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::Location>&&, std::__1::shared_ptr<yb::ql::PTAssign>&)
Line
Count
Source
90
3.34k
  inline static TreeListNode::SharedPtr MakeShared(MemoryContext *memctx, TypeArgs&&... args) {
91
3.34k
    return MCMakeShared<TreeListNode>(memctx, std::forward<TypeArgs>(args)...);
92
3.34k
  }
std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::PTExpr> > yb::ql::TreeListNode<yb::ql::PTExpr>::MakeShared<std::__1::shared_ptr<yb::ql::Location> >(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::Location>&&)
Line
Count
Source
90
263
  inline static TreeListNode::SharedPtr MakeShared(MemoryContext *memctx, TypeArgs&&... args) {
91
263
    return MCMakeShared<TreeListNode>(memctx, std::forward<TypeArgs>(args)...);
92
263
  }
std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::PTTableRef> > yb::ql::TreeListNode<yb::ql::PTTableRef>::MakeShared<std::__1::shared_ptr<yb::ql::Location>, std::__1::shared_ptr<yb::ql::PTTableRef>&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::Location>&&, std::__1::shared_ptr<yb::ql::PTTableRef>&)
Line
Count
Source
90
268k
  inline static TreeListNode::SharedPtr MakeShared(MemoryContext *memctx, TypeArgs&&... args) {
91
268k
    return MCMakeShared<TreeListNode>(memctx, std::forward<TypeArgs>(args)...);
92
268k
  }
std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::PTExpr> > yb::ql::TreeListNode<yb::ql::PTExpr>::MakeShared<std::__1::shared_ptr<yb::ql::Location>, std::__1::shared_ptr<yb::ql::PTJsonOperator>&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::Location>&&, std::__1::shared_ptr<yb::ql::PTJsonOperator>&)
Line
Count
Source
90
1.08k
  inline static TreeListNode::SharedPtr MakeShared(MemoryContext *memctx, TypeArgs&&... args) {
91
1.08k
    return MCMakeShared<TreeListNode>(memctx, std::forward<TypeArgs>(args)...);
92
1.08k
  }
std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::PTRoleOption> > yb::ql::TreeListNode<yb::ql::PTRoleOption>::MakeShared<std::__1::shared_ptr<yb::ql::Location>, std::__1::shared_ptr<yb::ql::PTRoleOption>&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::Location>&&, std::__1::shared_ptr<yb::ql::PTRoleOption>&)
Line
Count
Source
90
797
  inline static TreeListNode::SharedPtr MakeShared(MemoryContext *memctx, TypeArgs&&... args) {
91
797
    return MCMakeShared<TreeListNode>(memctx, std::forward<TypeArgs>(args)...);
92
797
  }
std::__1::shared_ptr<yb::ql::TreeListNode<yb::ql::TreeNode> > yb::ql::TreeListNode<yb::ql::TreeNode>::MakeShared<std::__1::shared_ptr<yb::ql::Location>, std::__1::shared_ptr<yb::ql::PTPrimaryKey>&>(yb::internal::ArenaBase<yb::internal::ArenaTraits>*, std::__1::shared_ptr<yb::ql::Location>&&, std::__1::shared_ptr<yb::ql::PTPrimaryKey>&)
Line
Count
Source
90
512
  inline static TreeListNode::SharedPtr MakeShared(MemoryContext *memctx, TypeArgs&&... args) {
91
512
    return MCMakeShared<TreeListNode>(memctx, std::forward<TypeArgs>(args)...);
92
512
  }
93
94
  // Run semantics analysis on this node.
95
545k
  CHECKED_STATUS Analyze(SemContext *sem_context) override {
96
826k
    for (auto tnode : node_list_) {
97
826k
      RETURN_NOT_OK(tnode->Analyze(sem_context));
98
826k
    }
99
545k
    return Status::OK();
100
545k
  }
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTProperty>::Analyze(yb::ql::SemContext*)
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTKeyspaceProperty>::Analyze(yb::ql::SemContext*)
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTTableProperty>::Analyze(yb::ql::SemContext*)
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTDmlWriteProperty>::Analyze(yb::ql::SemContext*)
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTDmlUsingClauseElement>::Analyze(yb::ql::SemContext*)
yb::ql::TreeListNode<yb::ql::PTExpr>::Analyze(yb::ql::SemContext*)
Line
Count
Source
95
272k
  CHECKED_STATUS Analyze(SemContext *sem_context) override {
96
546k
    for (auto tnode : node_list_) {
97
546k
      RETURN_NOT_OK(tnode->Analyze(sem_context));
98
546k
    }
99
272k
    return Status::OK();
100
272k
  }
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::TreeListNode<yb::ql::PTExpr> >::Analyze(yb::ql::SemContext*)
yb::ql::TreeListNode<yb::ql::TreeNode>::Analyze(yb::ql::SemContext*)
Line
Count
Source
95
4.39k
  CHECKED_STATUS Analyze(SemContext *sem_context) override {
96
14.4k
    for (auto tnode : node_list_) {
97
14.4k
      RETURN_NOT_OK(tnode->Analyze(sem_context));
98
14.4k
    }
99
4.35k
    return Status::OK();
100
4.39k
  }
yb::ql::TreeListNode<yb::ql::PTTypeField>::Analyze(yb::ql::SemContext*)
Line
Count
Source
95
81
  CHECKED_STATUS Analyze(SemContext *sem_context) override {
96
129
    for (auto tnode : node_list_) {
97
129
      RETURN_NOT_OK(tnode->Analyze(sem_context));
98
129
    }
99
65
    return Status::OK();
100
81
  }
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTQualifiedName>::Analyze(yb::ql::SemContext*)
yb::ql::TreeListNode<yb::ql::PTOrderBy>::Analyze(yb::ql::SemContext*)
Line
Count
Source
95
212
  CHECKED_STATUS Analyze(SemContext *sem_context) override {
96
308
    for (auto tnode : node_list_) {
97
308
      RETURN_NOT_OK(tnode->Analyze(sem_context));
98
308
    }
99
211
    return Status::OK();
100
212
  }
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTAssign>::Analyze(yb::ql::SemContext*)
yb::ql::TreeListNode<yb::ql::PTTableRef>::Analyze(yb::ql::SemContext*)
Line
Count
Source
95
267k
  CHECKED_STATUS Analyze(SemContext *sem_context) override {
96
267k
    for (auto tnode : node_list_) {
97
263k
      RETURN_NOT_OK(tnode->Analyze(sem_context));
98
263k
    }
99
267k
    return Status::OK();
100
267k
  }
yb::ql::TreeListNode<yb::ql::PTRoleOption>::Analyze(yb::ql::SemContext*)
Line
Count
Source
95
797
  CHECKED_STATUS Analyze(SemContext *sem_context) override {
96
2.19k
    for (auto tnode : node_list_) {
97
2.19k
      RETURN_NOT_OK(tnode->Analyze(sem_context));
98
2.19k
    }
99
797
    return Status::OK();
100
797
  }
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTKeyspaceProperty>::Analyze(yb::ql::SemContext*)
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTTableProperty>::Analyze(yb::ql::SemContext*)
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTDmlWriteProperty>::Analyze(yb::ql::SemContext*)
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTDmlUsingClauseElement>::Analyze(yb::ql::SemContext*)
101
102
  virtual CHECKED_STATUS Analyze(SemContext *sem_context,
103
3.39k
                                 TreeNodePtrOperator<SemContext, NodeType> node_op) {
104
7.11k
    for (auto tnode : node_list_) {
105
7.11k
      RETURN_NOT_OK(node_op(tnode.get(), sem_context));
106
7.11k
    }
107
3.22k
    return Status::OK();
108
3.39k
  }
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTProperty>::Analyze(yb::ql::SemContext*, std::__1::function<yb::Status (yb::ql::PTProperty*, yb::ql::SemContext*)>)
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTKeyspaceProperty>::Analyze(yb::ql::SemContext*, std::__1::function<yb::Status (yb::ql::PTKeyspaceProperty*, yb::ql::SemContext*)>)
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTTableProperty>::Analyze(yb::ql::SemContext*, std::__1::function<yb::Status (yb::ql::PTTableProperty*, yb::ql::SemContext*)>)
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTDmlWriteProperty>::Analyze(yb::ql::SemContext*, std::__1::function<yb::Status (yb::ql::PTDmlWriteProperty*, yb::ql::SemContext*)>)
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTDmlUsingClauseElement>::Analyze(yb::ql::SemContext*, std::__1::function<yb::Status (yb::ql::PTDmlUsingClauseElement*, yb::ql::SemContext*)>)
yb::ql::TreeListNode<yb::ql::PTExpr>::Analyze(yb::ql::SemContext*, std::__1::function<yb::Status (yb::ql::PTExpr*, yb::ql::SemContext*)>)
Line
Count
Source
103
68
                                 TreeNodePtrOperator<SemContext, NodeType> node_op) {
104
83
    for (auto tnode : node_list_) {
105
83
      RETURN_NOT_OK(node_op(tnode.get(), sem_context));
106
83
    }
107
62
    return Status::OK();
108
68
  }
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::TreeListNode<yb::ql::PTExpr> >::Analyze(yb::ql::SemContext*, std::__1::function<yb::Status (yb::ql::TreeListNode<yb::ql::PTExpr>*, yb::ql::SemContext*)>)
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::TreeNode>::Analyze(yb::ql::SemContext*, std::__1::function<yb::Status (yb::ql::TreeNode*, yb::ql::SemContext*)>)
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTTypeField>::Analyze(yb::ql::SemContext*, std::__1::function<yb::Status (yb::ql::PTTypeField*, yb::ql::SemContext*)>)
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTQualifiedName>::Analyze(yb::ql::SemContext*, std::__1::function<yb::Status (yb::ql::PTQualifiedName*, yb::ql::SemContext*)>)
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTOrderBy>::Analyze(yb::ql::SemContext*, std::__1::function<yb::Status (yb::ql::PTOrderBy*, yb::ql::SemContext*)>)
yb::ql::TreeListNode<yb::ql::PTAssign>::Analyze(yb::ql::SemContext*, std::__1::function<yb::Status (yb::ql::PTAssign*, yb::ql::SemContext*)>)
Line
Count
Source
103
3.32k
                                 TreeNodePtrOperator<SemContext, NodeType> node_op) {
104
7.03k
    for (auto tnode : node_list_) {
105
7.03k
      RETURN_NOT_OK(node_op(tnode.get(), sem_context));
106
7.03k
    }
107
3.16k
    return Status::OK();
108
3.32k
  }
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTTableRef>::Analyze(yb::ql::SemContext*, std::__1::function<yb::Status (yb::ql::PTTableRef*, yb::ql::SemContext*)>)
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTRoleOption>::Analyze(yb::ql::SemContext*, std::__1::function<yb::Status (yb::ql::PTRoleOption*, yb::ql::SemContext*)>)
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTKeyspaceProperty>::Analyze(yb::ql::SemContext*, std::__1::function<yb::Status (yb::ql::PTKeyspaceProperty*, yb::ql::SemContext*)>)
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTTableProperty>::Analyze(yb::ql::SemContext*, std::__1::function<yb::Status (yb::ql::PTTableProperty*, yb::ql::SemContext*)>)
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTDmlWriteProperty>::Analyze(yb::ql::SemContext*, std::__1::function<yb::Status (yb::ql::PTDmlWriteProperty*, yb::ql::SemContext*)>)
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTDmlUsingClauseElement>::Analyze(yb::ql::SemContext*, std::__1::function<yb::Status (yb::ql::PTDmlUsingClauseElement*, yb::ql::SemContext*)>)
109
110
  // Apply an operator on each node in the list.
111
  template<typename ContextType, typename DerivedType = NodeType>
112
  CHECKED_STATUS Apply(ContextType *context,
113
                       TreeNodePtrOperator<ContextType, DerivedType> node_op,
114
                       int max_nested_level = 0,
115
                       int max_nested_count = 0,
116
2.83k
                       TreeNodePtrOperator<ContextType, DerivedType> nested_node_op = nullptr) {
117
118
2.83k
    int nested_level = 0;
119
2.83k
    int nested_count = 0;
120
121
4.53k
    for (TreeNode::SharedPtr tnode : node_list_) {
122
4.53k
      if (tnode->opcode() != TreeNodeOpcode::kPTListNode) {
123
        // Cast the node from (TreeNode*) to the given template type.
124
3.58k
        DerivedType *node = static_cast<DerivedType*>(tnode.get());
125
        // Call the given node operation on the node.
126
3.58k
        RETURN_NOT_OK(node_op(node, context));
127
3.58k
      } else {
128
947
        if (++nested_count > max_nested_count) {
129
0
          return context->Error(this, "Number of nested lists exceeds allowable limit",
130
0
                                ErrorCode::SYNTAX_ERROR);
131
0
        }
132
133
947
        if (++nested_level > max_nested_level) {
134
0
          return context->Error(this, "Nested level of parenthesis exceeds allowable limit",
135
0
                                ErrorCode::SYNTAX_ERROR);
136
0
        }
137
138
        // Cast the node from (TreeNode*) to the given template type.
139
947
        TreeListNode *node = static_cast<TreeListNode*>(tnode.get());
140
        // Apply the operation to a nested list.
141
947
        RETURN_NOT_OK((node->Apply<ContextType, DerivedType>(context,
142
947
                                                             nested_node_op,
143
947
                                                             max_nested_level - 1,
144
947
                                                             max_nested_count,
145
947
                                                             nested_node_op)));
146
944
        nested_level--;
147
944
      }
148
4.53k
    }
149
150
2.81k
    return Status::OK();
151
2.83k
  }
152
153
  // List count.
154
663k
  size_t size() const {
155
663k
    return node_list_.size();
156
663k
  }
yb::ql::TreeListNode<yb::ql::TreeNode>::size() const
Line
Count
Source
154
338k
  size_t size() const {
155
338k
    return node_list_.size();
156
338k
  }
yb::ql::TreeListNode<yb::ql::PTQualifiedName>::size() const
Line
Count
Source
154
6.69k
  size_t size() const {
155
6.69k
    return node_list_.size();
156
6.69k
  }
yb::ql::TreeListNode<yb::ql::PTTableRef>::size() const
Line
Count
Source
154
266k
  size_t size() const {
155
266k
    return node_list_.size();
156
266k
  }
yb::ql::TreeListNode<yb::ql::TreeListNode<yb::ql::PTExpr> >::size() const
Line
Count
Source
154
49.7k
  size_t size() const {
155
49.7k
    return node_list_.size();
156
49.7k
  }
yb::ql::TreeListNode<yb::ql::PTExpr>::size() const
Line
Count
Source
154
1.77k
  size_t size() const {
155
1.77k
    return node_list_.size();
156
1.77k
  }
157
158
  // Access function to node_list_.
159
54.7k
  const MCList<MCSharedPtr<NodeType>>& node_list() const {
160
54.7k
    return node_list_;
161
54.7k
  }
162
163
8.89M
  MCList<MCSharedPtr<NodeType>>& node_list() {
164
8.89M
    return node_list_;
165
8.89M
  }
yb::ql::TreeListNode<yb::ql::PTExpr>::node_list()
Line
Count
Source
163
8.49M
  MCList<MCSharedPtr<NodeType>>& node_list() {
164
8.49M
    return node_list_;
165
8.49M
  }
yb::ql::TreeListNode<yb::ql::TreeNode>::node_list()
Line
Count
Source
163
341k
  MCList<MCSharedPtr<NodeType>>& node_list() {
164
341k
    return node_list_;
165
341k
  }
Unexecuted instantiation: yb::ql::TreeListNode<yb::ql::PTProperty>::node_list()
yb::ql::TreeListNode<yb::ql::PTKeyspaceProperty>::node_list()
Line
Count
Source
163
558
  MCList<MCSharedPtr<NodeType>>& node_list() {
164
558
    return node_list_;
165
558
  }
yb::ql::TreeListNode<yb::ql::PTTableProperty>::node_list()
Line
Count
Source
163
3.25k
  MCList<MCSharedPtr<NodeType>>& node_list() {
164
3.25k
    return node_list_;
165
3.25k
  }
yb::ql::TreeListNode<yb::ql::PTDmlWriteProperty>::node_list()
Line
Count
Source
163
552
  MCList<MCSharedPtr<NodeType>>& node_list() {
164
552
    return node_list_;
165
552
  }
yb::ql::TreeListNode<yb::ql::PTTypeField>::node_list()
Line
Count
Source
163
47
  MCList<MCSharedPtr<NodeType>>& node_list() {
164
47
    return node_list_;
165
47
  }
yb::ql::TreeListNode<yb::ql::PTRoleOption>::node_list()
Line
Count
Source
163
797
  MCList<MCSharedPtr<NodeType>>& node_list() {
164
797
    return node_list_;
165
797
  }
yb::ql::TreeListNode<yb::ql::PTDmlUsingClauseElement>::node_list()
Line
Count
Source
163
199
  MCList<MCSharedPtr<NodeType>>& node_list() {
164
199
    return node_list_;
165
199
  }
yb::ql::TreeListNode<yb::ql::PTOrderBy>::node_list()
Line
Count
Source
163
230
  MCList<MCSharedPtr<NodeType>>& node_list() {
164
230
    return node_list_;
165
230
  }
yb::ql::TreeListNode<yb::ql::PTQualifiedName>::node_list()
Line
Count
Source
163
49.7k
  MCList<MCSharedPtr<NodeType>>& node_list() {
164
49.7k
    return node_list_;
165
49.7k
  }
166
167
  // Returns the nth element.
168
863k
  MCSharedPtr<NodeType> element(size_t n) const {
169
863k
    if (node_list_.size() <= n) {
170
0
      return nullptr;
171
0
    }
172
863k
    auto it = node_list_.begin();
173
863k
    std::advance(it, n);
174
863k
    return *it;
175
863k
  }
yb::ql::TreeListNode<yb::ql::PTTableRef>::element(unsigned long) const
Line
Count
Source
168
786k
  MCSharedPtr<NodeType> element(size_t n) const {
169
786k
    if (node_list_.size() <= n) {
170
0
      return nullptr;
171
0
    }
172
786k
    auto it = node_list_.begin();
173
786k
    std::advance(it, n);
174
786k
    return *it;
175
786k
  }
yb::ql::TreeListNode<yb::ql::PTQualifiedName>::element(unsigned long) const
Line
Count
Source
168
27.1k
  MCSharedPtr<NodeType> element(size_t n) const {
169
27.1k
    if (node_list_.size() <= n) {
170
0
      return nullptr;
171
0
    }
172
27.1k
    auto it = node_list_.begin();
173
27.1k
    std::advance(it, n);
174
27.1k
    return *it;
175
27.1k
  }
yb::ql::TreeListNode<yb::ql::TreeListNode<yb::ql::PTExpr> >::element(unsigned long) const
Line
Count
Source
168
49.7k
  MCSharedPtr<NodeType> element(size_t n) const {
169
49.7k
    if (node_list_.size() <= n) {
170
0
      return nullptr;
171
0
    }
172
49.7k
    auto it = node_list_.begin();
173
49.7k
    std::advance(it, n);
174
49.7k
    return *it;
175
49.7k
  }
yb::ql::TreeListNode<yb::ql::PTExpr>::element(unsigned long) const
Line
Count
Source
168
486
  MCSharedPtr<NodeType> element(size_t n) const {
169
486
    if (node_list_.size() <= n) {
170
0
      return nullptr;
171
0
    }
172
486
    auto it = node_list_.begin();
173
486
    std::advance(it, n);
174
486
    return *it;
175
486
  }
176
177
 private:
178
  MCList<MCSharedPtr<NodeType>> node_list_;
179
};
180
181
class PTListNode : public TreeListNode<> {
182
 public:
183
  // Run semantics analysis on a statement block.
184
  CHECKED_STATUS AnalyzeStatementBlock(SemContext *sem_context);
185
};
186
187
}  // namespace ql
188
}  // namespace yb
189
190
#endif  // YB_YQL_CQL_QL_PTREE_LIST_NODE_H_