.\" Copyright (c) 2018-2023, OARC, Inc. .\" All rights reserved. .\" .\" This file is part of dnsjit. .\" .\" dnsjit is free software: you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation, either version 3 of the License, or .\" (at your option) any later version. .\" .\" dnsjit is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with dnsjit. If not, see . .\" .TH dnsjit.lib.trie.iter 3 "1.3.0" "dnsjit" .SH NAME dnsjit.lib.trie.iter \- Iterator of the trie. .SH SYNOPSIS .SS Iterate over all trie's key-value pairs local trie = require("dnsjit.lib.trie").new("uint64_t") local iter = trie:iter() local node = iter:node() while node ~= nil do local key = node:key() local value = tonumber(node:get()) print(key..": "..value) iter:next() node = iter:node() end .SH DESCRIPTION Beware that iterator is only valid as long as the trie's key-set remains unchanged. .SS Functions .TP .BR TrieIter.new "(trie)" Create a new iterator pointing to the first element (if any). .TP .BR TrieIter:log "()" Return the Log object to control logging of this instance or module. .TP .BR TrieIter:node "()" Return the node pointer to by the iterator. Returns nil when iterator has gone past the last element. .TP .BR TrieIter:next "()" Advance the iterator to the next element. Iteration is in ascending lexicographical order. Empty string would be considered as the very first. You may not use this function if the trie's key-set has been modified during the lifetime of the iterator (modifying only values is OK). .SH SEE ALSO .BR dnsjit.lib.trie (3), dnsjit.lib.trie.node (3) .SH AUTHORS and CONTRIBUTORS Jerry Lundström (DNS-OARC), Tomáš Křížek (CZ.NIC), Petr Špaček (ISC) .LP Maintained by DNS-OARC .LP .RS .I https://www.dns-oarc.net/ .RE .LP .SH BUGS For issues and feature requests please use: .LP .RS \fIhttps://github.com/DNS-OARC/dnsjit/issues\fP .RE .LP For question and help please use: .LP .RS \fIadmin@dns-oarc.net\fP .RE .LP