MCPcopy Create free account
hub / github.com/apache/trafficserver / Iterator

Class Iterator

include/cripts/Certs.hpp:424–502  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

422 SAN::SANType<cripts::Certs::SAN::IPADD> ipadd;
423
424 class Iterator
425 {
426 public:
427 using iterator_category = std::forward_iterator_tag;
428 using value_type = std::tuple<cripts::Certs::SAN, cripts::Certs::String>;
429 using reference = value_type; // Return by value instead of const reference
430 using base_iterator = SANBase::Container::const_iterator;
431
432 explicit Iterator(std::nullptr_t) : _ended(true) {}
433 explicit Iterator(const SAN *san) : _san(san) { _advance(); }
434
435 Iterator() = default;
436 Iterator(const Iterator &) = default;
437 Iterator &operator=(const Iterator &) = default;
438 Iterator(Iterator &&) = default;
439 Iterator &operator=(Iterator &&) = default;
440
441 ~Iterator() = default;
442
443 [[nodiscard]] reference
444 operator*() const
445 {
446 return {_current};
447 }
448
449 Iterator &
450 operator++()
451 {
452 if (_ended) {
453 return *this;
454 }
455
456 ++_iter;
457 if (_iter == _san->_sans[_index - 1]->Data().end()) {
458 _advance();
459 } else {
460 _update_current();
461 }
462
463 return *this;
464 }
465
466 [[nodiscard]] bool
467 operator!=(const Iterator &other) const
468 {
469 if (_ended && other._ended) {
470 return false;
471 }
472
473 return _san != other._san || _index != other._index || _iter != other._iter;
474 }
475
476 [[nodiscard]] bool
477 operator==(const Iterator &other) const
478 {
479 if (_ended && other._ended) {
480 return true;
481 }

Callers 3

beginMethod · 0.70
endMethod · 0.70
beginMethod · 0.70

Calls 2

endMethod · 0.45
DataMethod · 0.45

Tested by

no test coverage detected