Squid Web Cache master
Loading...
Searching...
No Matches
PrecomputedCodeContext.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2025 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9#ifndef SQUID_SRC_BASE_PRECOMPUTEDCODECONTEXT_H
10#define SQUID_SRC_BASE_PRECOMPUTEDCODECONTEXT_H
11
12#include "base/CodeContext.h"
13#include "base/InstanceId.h"
14#include "sbuf/SBuf.h"
15
16#include <ostream>
17
20{
21public:
23
24 PrecomputedCodeContext(const char *gist, const SBuf &detail): gist_(gist), detail_(detail)
25 {}
26
27 /* CodeContext API */
28 ScopedId codeContextGist() const override { return ScopedId(gist_); }
29 std::ostream &detailCodeContext(std::ostream &os) const override { return os << Debug::Extra << detail_; }
30
31private:
32 const char *gist_;
33 const SBuf detail_;
34};
35
36#endif /* SQUID_SRC_BASE_PRECOMPUTEDCODECONTEXT_H */
37
static std::ostream & Extra(std::ostream &)
Definition debug.cc:1316
CodeContext with constant details known at construction time.
ScopedId codeContextGist() const override
std::ostream & detailCodeContext(std::ostream &os) const override
appends human-friendly context description line(s) to a cache.log record
RefCount< PrecomputedCodeContext > Pointer
const SBuf detail_
the detail used in detailCodeContext()
PrecomputedCodeContext(const char *gist, const SBuf &detail)
const char * gist_
the id used in codeContextGist()
Definition SBuf.h:94