| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
proto_node.h
Go to the documentation of this file.
1
9
10#ifndef PROTO_NODE_H_
11#define PROTO_NODE_H_
12
13#include <config.h>
14
15#include <epan/proto.h>
16
17#include <QObject>
18#include <QVector>
19
23 class ProtoNode
24{
25 public:
26
30 class ChildIterator {
31 public:
33 typedef struct _proto_node * NodePtr;
34
39 ChildIterator(NodePtr n = Q_NULLPTR);
40
45 bool hasNext();
46
51 ChildIterator next();
52
57 ProtoNode element();
58
59 protected:
61 NodePtr node;
62 };
63
69 explicit ProtoNode(proto_node * node = NULL, ProtoNode *parent = nullptr);
70
74 ~ProtoNode();
75
80 bool isValid() const;
81
86 bool isChild() const;
87
92 bool isExpanded() const;
93
98 proto_node *protoNode() const;
99
105 ProtoNode *child(int row);
106
111 int childrenCount() const;
112
117 int row();
118
123 ProtoNode *parentNode();
124
129 QString labelText() const;
130
135 ChildIterator children() const;
136
137 private:
139 proto_node * node_;
140
142 QVector<ProtoNode*>m_children;
143
145 ProtoNode *parent_;
146
152 static bool isHidden(proto_node * node);
153};
154
155
156#endif // PROTO_NODE_H_
ProtoNode::ChildIterator
An iterator for traversing the child nodes of a ProtoNode.
Definition proto_node.h:30
ProtoNode::ChildIterator::element
ProtoNode element()
Retrieves the ProtoNode element at the current iterator position.
Definition proto_node.cpp:160
ProtoNode::ChildIterator::node
NodePtr node
Definition proto_node.h:61
ProtoNode::ChildIterator::hasNext
bool hasNext()
Checks if there is a subsequent child node.
Definition proto_node.cpp:145
ProtoNode::ChildIterator::next
ChildIterator next()
Advances the iterator to the next child node.
Definition proto_node.cpp:152
ProtoNode::ChildIterator::NodePtr
struct _proto_node * NodePtr
Pointer type for the underlying proto_node structure.
Definition proto_node.h:33
ProtoNode::ChildIterator::ChildIterator
ChildIterator(NodePtr n=Q_NULLPTR)
Constructs a new ChildIterator.
Definition proto_node.cpp:140
ProtoNode::isValid
bool isValid() const
Checks if the protocol node is valid.
Definition proto_node.cpp:44
ProtoNode::children
ChildIterator children() const
Retrieves a child iterator for traversing this node's children.
Definition proto_node.cpp:128
ProtoNode::row
int row()
Retrieves the row index of this node relative to its parent.
Definition proto_node.cpp:99
ProtoNode::protoNode
proto_node * protoNode() const
Retrieves the underlying core proto_node structure.
Definition proto_node.cpp:116
ProtoNode::~ProtoNode
~ProtoNode()
Destroys the ProtoNode.
Definition proto_node.cpp:39
ProtoNode::childrenCount
int childrenCount() const
Retrieves the total number of child nodes.
Definition proto_node.cpp:92
ProtoNode::isChild
bool isChild() const
Checks if this node is a child of another node.
Definition proto_node.cpp:49
ProtoNode::labelText
QString labelText() const
Retrieves the display label text for this node.
Definition proto_node.cpp:59
ProtoNode::ProtoNode
ProtoNode(proto_node *node=NULL, ProtoNode *parent=nullptr)
Constructs a new ProtoNode instance.
Definition proto_node.cpp:16
ProtoNode::isExpanded
bool isExpanded() const
Checks if the node is expanded in the view.
Definition proto_node.cpp:108
ProtoNode::parentNode
ProtoNode * parentNode()
Retrieves the parent node of this node.
Definition proto_node.cpp:54
ProtoNode::child
ProtoNode * child(int row)
Retrieves a specific child node by its row index.
Definition proto_node.cpp:121
proto_node
struct _proto_node proto_node
proto.h
_proto_node
Definition proto.h:914