MIDAS
Loading...
Searching...
No Matches
RequestTraceBuf Class Reference
Collaboration diagram for RequestTraceBuf:

Public Member Functions

 RequestTraceBuf ()
 
void AddTrace (RequestTrace *t)
 
void AddTraceMTS (RequestTrace *t)
 
void Clear ()
 

Public Attributes

MUTEX_TfMutex
 
std::vector< RequestTrace * > fBuf
 

Detailed Description

Definition at line 435 of file mhttpd.cxx.

Constructor & Destructor Documentation

◆ RequestTraceBuf()

RequestTraceBuf::RequestTraceBuf ( )
inline

Definition at line 442 of file mhttpd.cxx.

443 {
444 int status;
446 assert(status==SS_SUCCESS || status==SS_CREATED);
447 }
#define FALSE
Definition cfortran.h:309
MUTEX_T * fMutex
Definition mhttpd.cxx:438
#define SS_SUCCESS
Definition midas.h:663
#define SS_CREATED
Definition midas.h:664
INT ss_mutex_create(MUTEX_T **mutex, BOOL recursive)
Definition system.cxx:2941
DWORD status
Definition odbhist.cxx:39
Here is the call graph for this function:

Member Function Documentation

◆ AddTrace()

void RequestTraceBuf::AddTrace ( RequestTrace t)
inline

Definition at line 456 of file mhttpd.cxx.

457 {
458 fBuf.push_back(t);
459 }
std::vector< RequestTrace * > fBuf
Definition mhttpd.cxx:439

◆ AddTraceMTS()

void RequestTraceBuf::AddTraceMTS ( RequestTrace t)
inline

Definition at line 461 of file mhttpd.cxx.

462 {
464 if (http_trace) {
465 t->PrintTrace0();
466 }
467 delete t;
468 //AddTrace(t);
470 }
void PrintTrace0() const
Definition mhttpd.cxx:411
INT ss_mutex_release(MUTEX_T *mutex)
Definition system.cxx:3157
INT ss_mutex_wait_for(MUTEX_T *mutex, INT timeout)
Definition system.cxx:3037
static int http_trace
Definition mhttpd.cxx:433
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Clear()

void RequestTraceBuf::Clear ( )
inline

Definition at line 472 of file mhttpd.cxx.

473 {
474 // delete all completed requests
475 for (unsigned i=0; i<fBuf.size(); i++) {
476 if (fBuf[i] && fBuf[i]->fCompleted) {
477 delete fBuf[i];
478 fBuf[i] = NULL;
479 }
480 }
481
482 // compact all non-completed requests
483 unsigned k = 0;
484 for (unsigned i=0; i<fBuf.size(); i++) {
485 if (fBuf[i]) {
486 if (fBuf[k] != NULL) {
487 for (; k<i; k++) {
488 if (fBuf[k] == NULL) {
489 break;
490 }
491 }
492 }
493 // if we found an empty spot between "k" and "i" move "i" there
494 // if there is no empty spot, then "i" does not need to be moved
495 if (fBuf[k] == NULL) {
496 fBuf[k] = fBuf[i];
497 fBuf[i] = NULL;
498 }
499 }
500 }
501 }
INT i
Definition mdump.cxx:32
INT k
Definition odbhist.cxx:40
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
Definition rmidas.h:24
Here is the call graph for this function:

Member Data Documentation

◆ fBuf

std::vector<RequestTrace*> RequestTraceBuf::fBuf

Definition at line 439 of file mhttpd.cxx.

◆ fMutex

MUTEX_T* RequestTraceBuf::fMutex

Definition at line 438 of file mhttpd.cxx.


The documentation for this class was generated from the following file: