Logo ROOT   6.14/05
Reference Guide
TCivetweb.h
Go to the documentation of this file.
1 // $Id$
2 // Author: Sergey Linev 21/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_TCivetweb
13 #define ROOT_TCivetweb
14 
15 #include "THttpEngine.h"
16 #include "TString.h"
17 
18 class TCivetweb : public THttpEngine {
19 protected:
20  void *fCtx{nullptr}; ///<! civetweb context
21  void *fCallbacks{nullptr}; ///<! call-back table for civetweb webserver
22  TString fTopName; ///<! name of top item
23  Bool_t fDebug{kFALSE}; ///<! debug mode
24  Bool_t fTerminating{kFALSE}; ///<! server doing shutdown and not react on requests
25  Bool_t fOnlySecured; ///<! if server should run only https protocol
26 
27  virtual void Terminate() { fTerminating = kTRUE; }
28 
29  Bool_t IsSecured() const { return fOnlySecured; }
30 
31 public:
32  TCivetweb(Bool_t only_secured = kFALSE);
33  virtual ~TCivetweb();
34 
35  virtual Bool_t Create(const char *args);
36 
37  const char *GetTopName() const { return fTopName.Data(); }
38 
39  Bool_t IsDebugMode() const { return fDebug; }
40 
41  Bool_t IsTerminating() const { return fTerminating; }
42 
43  Int_t ProcessLog(const char *message);
44 };
45 
46 #endif
TString fTopName
! name of top item
Definition: TCivetweb.h:22
Basic string class.
Definition: TString.h:131
virtual Bool_t Create(const char *args)
Creates embedded civetweb server As main argument, http port should be specified like "8090"...
Definition: TCivetweb.cxx:406
Bool_t IsSecured() const
Definition: TCivetweb.h:29
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Bool_t fDebug
! debug mode
Definition: TCivetweb.h:23
const char * GetTopName() const
Definition: TCivetweb.h:37
void * fCallbacks
! call-back table for civetweb webserver
Definition: TCivetweb.h:21
virtual ~TCivetweb()
destructor
Definition: TCivetweb.cxx:367
Int_t ProcessLog(const char *message)
process civetweb log message, can be used to detect critical errors
Definition: TCivetweb.cxx:378
Bool_t fTerminating
! server doing shutdown and not react on requests
Definition: TCivetweb.h:24
Bool_t fOnlySecured
! if server should run only https protocol
Definition: TCivetweb.h:25
TCivetweb(Bool_t only_secured=kFALSE)
constructor
Definition: TCivetweb.cxx:358
const Bool_t kFALSE
Definition: RtypesCore.h:88
Bool_t IsDebugMode() const
Definition: TCivetweb.h:39
const Bool_t kTRUE
Definition: RtypesCore.h:87
void * fCtx
! civetweb context
Definition: TCivetweb.h:20
virtual void Terminate()
Method called when server want to be terminated.
Definition: TCivetweb.h:27
const char * Data() const
Definition: TString.h:364
Bool_t IsTerminating() const
Definition: TCivetweb.h:41