proxygen
QPACKContext.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
10 #pragma once
11 
15 
16 namespace proxygen {
17 
18 class QPACKContext {
19  public:
20  QPACKContext(uint32_t tableSize, bool trackReferences);
22 
26  const HPACKHeader& getHeader(bool isStatic, uint32_t index, uint32_t base,
27  bool aboveBase);
28 
29  const QPACKHeaderTable& getTable() const {
30  return table_;
31  }
32 
34  return table_.capacity();
35  }
36 
38  return table_.bytes();
39  }
40 
42  return table_.size();
43  }
44 
45  void seedHeaderTable(std::vector<HPACKHeader>& headers);
46 
47  void describe(std::ostream& os) const;
48 
49  protected:
51  return StaticHeaderTable::get();
52  }
53 
55 };
56 
57 std::ostream& operator<<(std::ostream& os, const QPACKContext& context);
58 
59 }
QPACKHeaderTable table_
Definition: QPACKContext.h:54
uint32_t capacity() const
Definition: HeaderTable.h:86
std::ostream & operator<<(std::ostream &os, const HeaderTable &table)
const QPACKHeaderTable & getTable() const
Definition: QPACKContext.h:29
context
Definition: CMakeCache.txt:563
uint32_t bytes() const
Definition: HeaderTable.h:112
QPACKContext(uint32_t tableSize, bool trackReferences)
uint32_t getTableSize() const
Definition: QPACKContext.h:33
const HPACKHeader & getHeader(bool isStatic, uint32_t index, uint32_t base, bool aboveBase)
static const StaticHeaderTable & get()
uint32_t getBytesStored() const
Definition: QPACKContext.h:37
void seedHeaderTable(std::vector< HPACKHeader > &headers)
uint32_t getHeadersStored() const
Definition: QPACKContext.h:41
const StaticHeaderTable & getStaticTable() const
Definition: QPACKContext.h:50
uint32_t size() const
Definition: HeaderTable.h:105
void describe(std::ostream &os) const