blob: e9a99ba02fc1359e1c39d8c8997af4f6896af534 [file] [log] [blame]
QUICHE team03c62942019-12-19 15:09:40 -08001// Copyright 2019 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef QUICHE_QUIC_TEST_TOOLS_QUIC_INTERVAL_DEQUE_PEER_H_
6#define QUICHE_QUIC_TEST_TOOLS_QUIC_INTERVAL_DEQUE_PEER_H_
7
8#include "net/third_party/quiche/src/quic/core/quic_interval_deque.h"
9
10namespace quic {
11
12namespace test {
13
14class QuicIntervalDequePeer {
15 public:
16 template <class T, class C>
17 static int32_t GetCachedIndex(QuicIntervalDeque<T, C>* interval_deque) {
18 if (!interval_deque->cached_index_.has_value()) {
19 return -1;
20 }
21 return interval_deque->cached_index_.value();
22 }
23
24 template <class T, class C>
25 static T* GetItem(QuicIntervalDeque<T, C>* interval_deque,
26 const std::size_t index) {
27 return &interval_deque->container_[index];
28 }
29};
30
31} // namespace test
32
33} // namespace quic
34
35#endif // QUICHE_QUIC_TEST_TOOLS_QUIC_INTERVAL_DEQUE_PEER_H_