HttpHdrCc.cc File Reference
#include "squid.h"
#include "base/EnumIterator.h"
#include "base/LookupTable.h"
#include "HttpHdrCc.h"
#include "HttpHeader.h"
#include "HttpHeaderFieldStat.h"
#include "HttpHeaderStat.h"
#include "HttpHeaderTools.h"
#include "sbuf/SBuf.h"
#include "SquidMath.h"
#include "StatHist.h"
#include "Store.h"
#include "StrList.h"
#include "util.h"
#include <map>
#include <vector>
#include <optional>
#include <ostream>
Include dependency graph for HttpHdrCc.cc:

Go to the source code of this file.

Functions

constexpr const auto & CcAttrs ()
 
static auto ccTypeByName (const SBuf &name)
 
template<typename RawId >
static std::optional< const char * > ccNameByType (const RawId rawId)
 
std::vector< HttpHeaderFieldStatccHeaderStats (HttpHdrCcType::CC_ENUM_END)
 
static HttpHdrCcTypeoperator++ (HttpHdrCcType &aHeader)
 used to walk a table of http_header_cc_type structs More...
 
void httpHdrCcUpdateStats (const HttpHdrCc *cc, StatHist *hist)
 
void httpHdrCcStatDumper (StoreEntry *sentry, int, double val, double, int count)
 
std::ostream & operator<< (std::ostream &s, HttpHdrCcType c)
 

Variables

constexpr LookupTable< HttpHdrCcType >::Record attrsList []
 

Function Documentation

◆ CcAttrs()

constexpr const auto& CcAttrs ( )
constexpr

Definition at line 51 of file HttpHdrCc.cc.

References attrsList, and CC_ENUM_END.

Referenced by ccNameByType(), and ccTypeByName().

◆ ccHeaderStats()

◆ ccNameByType()

template<typename RawId >
static std::optional<const char *> ccNameByType ( const RawId  rawId)
static

Safely converts an integer into a Cache-Control directive name.

Returns
std::nullopt if the given integer is not a valid index of a named attrsList entry

Definition at line 73 of file HttpHdrCc.cc.

References CC_ENUM_END, CcAttrs(), and Less().

Referenced by httpHdrCcStatDumper(), operator<<(), and HttpHdrCc::packInto().

◆ ccTypeByName()

static auto ccTypeByName ( const SBuf name)
static

Definition at line 64 of file HttpHdrCc.cc.

References CC_OTHER, and CcAttrs().

Referenced by HttpHdrCc::parse().

◆ httpHdrCcStatDumper()

void httpHdrCcStatDumper ( StoreEntry sentry,
int  ,
double  val,
double  ,
int  count 
)

◆ httpHdrCcUpdateStats()

void httpHdrCcUpdateStats ( const HttpHdrCc cc,
StatHist hist 
)

Definition at line 346 of file HttpHdrCc.cc.

References assert, CC_ENUM_END, CC_PUBLIC, StatHist::count(), and HttpHdrCc::isSet().

Referenced by HttpHeader::getCc().

◆ operator++()

static HttpHdrCcType& operator++ ( HttpHdrCcType aHeader)
static

Definition at line 87 of file HttpHdrCc.cc.

References int.

◆ operator<<()

std::ostream& operator<< ( std::ostream &  s,
HttpHdrCcType  c 
)

Definition at line 367 of file HttpHdrCc.cc.

References ccNameByType().

Variable Documentation

◆ attrsList

constexpr LookupTable<HttpHdrCcType>::Record attrsList[]
constexpr
Initial value:

Definition at line 31 of file HttpHdrCc.cc.

Referenced by CcAttrs().

@ CC_NO_TRANSFORM
Definition: HttpHdrCc.h:25
@ CC_MIN_FRESH
Definition: HttpHdrCc.h:31
@ CC_MAX_AGE
Definition: HttpHdrCc.h:28
@ CC_MAX_STALE
Definition: HttpHdrCc.h:30
@ CC_OTHER
Definition: HttpHdrCc.h:35
@ CC_IMMUTABLE
Definition: HttpHdrCc.h:34
@ CC_MUST_REVALIDATE
Definition: HttpHdrCc.h:26
@ CC_NO_STORE
Definition: HttpHdrCc.h:24
@ CC_S_MAXAGE
Definition: HttpHdrCc.h:29
@ CC_PRIVATE
Definition: HttpHdrCc.h:22
@ CC_STALE_IF_ERROR
Definition: HttpHdrCc.h:33
@ CC_PROXY_REVALIDATE
Definition: HttpHdrCc.h:27
@ CC_ENUM_END
Definition: HttpHdrCc.h:36
@ CC_NO_CACHE
Definition: HttpHdrCc.h:23
@ CC_PUBLIC
Definition: HttpHdrCc.h:21
@ CC_ONLY_IF_CACHED
Definition: HttpHdrCc.h:32

 

Introduction

Documentation

Support

Miscellaneous