Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TFastCgi.h
Go to the documentation of this file.
1// $Id$
2// Author: Sergey Linev 28/12/2013
3
4/*************************************************************************
5 * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TFastCgi
13#define ROOT_TFastCgi
14
15#include "THttpEngine.h"
16
17#include <thread>
18#include <memory>
19
20class TFastCgi : public THttpEngine {
21protected:
22 Int_t fSocket{0}; ///<! socket used by fastcgi
23 Bool_t fDebugMode{kFALSE}; ///<! debug mode, may required for fastcgi debugging in other servers
24 TString fTopName; ///<! name of top item
25 std::unique_ptr<std::thread> fThrd; ///<! thread which takes requests, can be many later
26 Bool_t fTerminating{kFALSE}; ///<! set when http server wants to terminate all engines
27
28 void Terminate() override { fTerminating = kTRUE; }
29
30public:
31 TFastCgi();
32 virtual ~TFastCgi();
33
34 Bool_t Create(const char *args) override;
35
36 Int_t GetSocket() const { return fSocket; }
37
38 Bool_t IsTerminating() const { return fTerminating; }
39
40 Bool_t IsDebugMode() const { return fDebugMode; }
41
42 const char *GetTopName() const { return fTopName.Length() > 0 ? fTopName.Data() : nullptr; }
43};
44
45#endif
bool Bool_t
Definition RtypesCore.h:63
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
THttpEngine implementation, based on fastcgi package.
Definition TFastCgi.h:20
TFastCgi()
normal constructor
Definition TFastCgi.cxx:314
Bool_t IsTerminating() const
Definition TFastCgi.h:38
TString fTopName
! name of top item
Definition TFastCgi.h:24
std::unique_ptr< std::thread > fThrd
! thread which takes requests, can be many later
Definition TFastCgi.h:25
Bool_t fDebugMode
! debug mode, may required for fastcgi debugging in other servers
Definition TFastCgi.h:23
void Terminate() override
Method called when server want to be terminated.
Definition TFastCgi.h:28
const char * GetTopName() const
Definition TFastCgi.h:42
Int_t GetSocket() const
Definition TFastCgi.h:36
virtual ~TFastCgi()
destructor
Definition TFastCgi.cxx:322
Bool_t Create(const char *args) override
create engine data
Definition TFastCgi.cxx:343
Int_t fSocket
! socket used by fastcgi
Definition TFastCgi.h:22
Bool_t IsDebugMode() const
Definition TFastCgi.h:40
Bool_t fTerminating
! set when http server wants to terminate all engines
Definition TFastCgi.h:26
Abstract class for implementing http protocol for THttpServer.
Definition THttpEngine.h:19
Basic string class.
Definition TString.h:139
Ssiz_t Length() const
Definition TString.h:417
const char * Data() const
Definition TString.h:376