Answer.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 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_ADAPTATION__ANSWER_H
10 #define SQUID_ADAPTATION__ANSWER_H
11 
12 #include "adaptation/forward.h"
13 #include "http/forward.h"
14 #include "SquidString.h"
15 
16 #include <iosfwd>
17 
18 namespace Adaptation
19 {
20 
22 class Answer
23 {
24 public:
26  typedef enum {
30  } Kind;
31 
32  static Answer Error(bool final);
33  static Answer Forward(Http::Message *aMsg);
34  static Answer Block(const String &aRule);
35 
36  std::ostream &print(std::ostream &os) const;
37 
38 public:
41  bool final;
43 
44 private:
45  explicit Answer(Kind aKind);
46 };
47 
48 inline
49 std::ostream &operator <<(std::ostream &os, const Answer &answer)
50 {
51  return answer.print(os);
52 }
53 
54 } // namespace Adaptation
55 
56 #endif /* SQUID_ADAPTATION__ANSWER_H */
57 
summarizes adaptation service answer for the noteAdaptationAnswer() API
Definition: Answer.h:22
static Answer Error(bool final)
create an akError answer
Definition: Answer.cc:17
String ruleId
ACL (or similar rule) name that blocked forwarding.
Definition: Answer.h:40
static Answer Forward(Http::Message *aMsg)
create an akForward answer
Definition: Answer.cc:26
Http::MessagePointer message
HTTP request or response to forward.
Definition: Answer.h:39
static Answer Block(const String &aRule)
create an akBlock answer
Definition: Answer.cc:35
no adapted message will come; see bypassable
Definition: Answer.h:29
Answer(Kind aKind)
use static creators instead
Definition: Answer.cc:49
common parts of HttpRequest and HttpReply
Definition: Message.h:24
Kind
helps interpret other members without a class hierarchy
Definition: Answer.h:26
std::ostream & print(std::ostream &os) const
Definition: Answer.cc:44
Kind kind
the type of the answer
Definition: Answer.h:42
forward the supplied adapted HTTP message
Definition: Answer.h:27
block or deny the master xaction; see authority
Definition: Answer.h:28
std::ostream & operator<<(std::ostream &os, const Answer &answer)
Definition: Answer.h:49

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors