ANNA Suite  2020b
Multipurpose development suite for Telco applications
Abstract.hpp
Go to the documentation of this file.
1 // ANNA - Anna is Not Nothingness Anymore //
2 // //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
4 // //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7 
8 
9 #ifndef anna_http_parser_Abstract_hpp
10 #define anna_http_parser_Abstract_hpp
11 
12 #include <anna/config/defines.hpp>
15 
16 namespace anna {
17 
18 class DataBlock;
19 
20 namespace http {
21 
22 class Transport;
23 class Token;
24 class Message;
25 
26 namespace parser {
27 
28 class Abstract {
29 public:
30  struct ClassType {
33  };
34 
35 protected:
36  Abstract(const ClassType::_v classType) : a_classType(classType) {;}
37 
38  static void setState(Transport&, const ClassType::_v) ;
39  static void setLastChunkedByte(Transport&, const int lastChunkedByte) ;
40  static const DataBlock& getFullMessage(Transport&) ;
41  static void appendExtraParameter(Message*, const std::string& extraParameter) ;
42 
43  virtual int processLine(Transport&, const DataBlock&, const Token& line) const noexcept(false) = 0;
44 
45 private:
46  const ClassType::_v a_classType;
47 
48  ClassType::_v getClassType() const { return a_classType; }
49  std::string asString() const ;
50 
51  friend class http::Transport;
52 };
53 
54 }
55 }
56 }
57 
58 #endif
59 
static void setLastChunkedByte(Transport &, const int lastChunkedByte)
Definition: Message.hpp:30
virtual int processLine(Transport &, const DataBlock &, const Token &line) const noexcept(false)=0
#define anna_declare_enum(name)
Definition: define.autoenum.hpp:48
Definition: Abstract.hpp:28
Abstract(const ClassType::_v classType)
Definition: Abstract.hpp:36
static void setState(Transport &, const ClassType::_v)
Definition: Abstract.hpp:30
Definition: Token.hpp:20
Definition: ReadChunkTrailers.hpp:20
Definition: app.hpp:12
Definition: Transport.hpp:36
static const DataBlock & getFullMessage(Transport &)
static void appendExtraParameter(Message *, const std::string &extraParameter)
Definition: DataBlock.hpp:24
_v
Definition: Abstract.hpp:31