proxygen
proxygen::StaticHeaderTable Class Reference

#include <StaticHeaderTable.h>

Inheritance diagram for proxygen::StaticHeaderTable:
proxygen::HeaderTable

Public Member Functions

 StaticHeaderTable (const char *entries[][2], int size)
 
- Public Member Functions inherited from proxygen::HeaderTable
 HeaderTable (uint32_t capacityVal)
 
virtual ~HeaderTable ()
 
 HeaderTable (const HeaderTable &)=delete
 
HeaderTableoperator= (const HeaderTable &)=delete
 
virtual bool add (HPACKHeader header)
 
uint32_t getIndex (const HPACKHeader &header) const
 
const HPACKHeadergetHeader (uint32_t index) const
 
bool isValid (uint32_t index) const
 
bool hasName (const HPACKHeaderName &headerName)
 
const names_mapnames () const
 
uint32_t nameIndex (const HPACKHeaderName &headerName) const
 
uint32_t capacity () const
 
uint32_t getMaxTableLength (uint32_t capacityVal)
 
virtual bool setCapacity (uint32_t capacity)
 
uint32_t size () const
 
uint32_t bytes () const
 
size_t length () const
 
bool operator== (const HeaderTable &other) const
 

Static Public Member Functions

static const StaticHeaderTableget ()
 
static bool isHeaderCodeInTableWithNonEmptyValue (HTTPHeaderCode headerCode)
 
- Static Public Member Functions inherited from proxygen::HeaderTable
static uint32_t toExternal (uint32_t head, uint32_t length, uint32_t internalIndex)
 
static uint32_t toInternal (uint32_t head, uint32_t length, uint32_t externalIndex)
 

Additional Inherited Members

- Public Types inherited from proxygen::HeaderTable
using names_map = std::unordered_map< HPACKHeaderName, std::list< uint32_t >>
 
- Protected Member Functions inherited from proxygen::HeaderTable
void init (uint32_t capacityVal)
 
virtual void increaseTableLengthTo (uint32_t newLength)
 
virtual void resizeTable (uint32_t newLength)
 
virtual void updateResizedTable (uint32_t oldTail, uint32_t oldLength, uint32_t newLength)
 
virtual uint32_t removeLast ()
 
void reset ()
 
virtual uint32_t evict (uint32_t needed, uint32_t desiredCapacity)
 
uint32_t next (uint32_t i) const
 
uint32_t tail () const
 
uint32_t toExternal (uint32_t internalIndex) const
 
uint32_t toInternal (uint32_t externalIndex) const
 
- Protected Attributes inherited from proxygen::HeaderTable
uint32_t capacity_ {0}
 
uint32_t bytes_ {0}
 
std::vector< HPACKHeadertable_
 
uint32_t size_ {0}
 
uint32_t head_ {0}
 
names_map names_
 

Detailed Description

Definition at line 19 of file StaticHeaderTable.h.

Constructor & Destructor Documentation

proxygen::StaticHeaderTable::StaticHeaderTable ( const char *  entries[][2],
int  size 
)
explicit

Definition at line 107 of file StaticHeaderTable.cpp.

References proxygen::HeaderTable::add(), i, proxygen::HeaderTable::init(), folly::gen::move, proxygen::HeaderTable::size(), and uint32_t.

110  : HeaderTable(0) {
111  // calculate the size
112  list<HPACKHeader> hlist;
113  uint32_t byteCount = 0;
114  for (int i = 0; i < size; ++i) {
115  hlist.push_back(HPACKHeader(entries[i][0], entries[i][1]));
116  byteCount += hlist.back().bytes();
117  }
118  // initialize with a capacity that will exactly fit the static headers
119  init(byteCount);
120  hlist.reverse();
121  for (auto& header : hlist) {
122  add(std::move(header));
123  }
124 }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
void init(uint32_t capacityVal)
Definition: HeaderTable.cpp:20
uint32_t size() const
Definition: HeaderTable.h:105
HeaderTable(uint32_t capacityVal)
Definition: HeaderTable.h:30
virtual bool add(HPACKHeader header)
Definition: HeaderTable.cpp:33

Member Function Documentation

const StaticHeaderTable & proxygen::StaticHeaderTable::get ( )
static

Definition at line 126 of file StaticHeaderTable.cpp.

Referenced by proxygen::QPACKContext::getStaticTable(), and proxygen::HPACKContext::getStaticTable().

126  {
127  static const folly::Indestructible<StaticHeaderTable> table(
129  return *table;
130 }
const int kEntriesSize
const char * s_tableEntries[][2]

The documentation for this class was generated from the following files: