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 467 of file mhttpd.cxx.

Constructor & Destructor Documentation

◆ RequestTraceBuf()

RequestTraceBuf::RequestTraceBuf ( )
inline

Definition at line 474 of file mhttpd.cxx.

475 {
476 int status;
478 assert(status==SS_SUCCESS || status==SS_CREATED);
479 }
#define FALSE
Definition cfortran.h:309
MUTEX_T * fMutex
Definition mhttpd.cxx:470
#define SS_SUCCESS
Definition midas.h:664
#define SS_CREATED
Definition midas.h:665
INT ss_mutex_create(MUTEX_T **mutex, BOOL recursive)
Definition system.cxx:3013
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 488 of file mhttpd.cxx.

489 {
490 fBuf.push_back(t);
491 }
std::vector< RequestTrace * > fBuf
Definition mhttpd.cxx:471

◆ AddTraceMTS()

void RequestTraceBuf::AddTraceMTS ( RequestTrace t)
inline

Definition at line 493 of file mhttpd.cxx.

494 {
496 if (http_trace) {
497 t->PrintTrace0();
498 }
499 delete t;
500 //AddTrace(t);
502 }
void PrintTrace0() const
Definition mhttpd.cxx:443
INT ss_mutex_release(MUTEX_T *mutex)
Definition system.cxx:3229
INT ss_mutex_wait_for(MUTEX_T *mutex, INT timeout)
Definition system.cxx:3109
static int http_trace
Definition mhttpd.cxx:465
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Clear()

void RequestTraceBuf::Clear ( )
inline

Definition at line 504 of file mhttpd.cxx.

505 {
506 // delete all completed requests
507 for (unsigned i=0; i<fBuf.size(); i++) {
508 if (fBuf[i] && fBuf[i]->fCompleted) {
509 delete fBuf[i];
510 fBuf[i] = NULL;
511 }
512 }
513
514 // compact all non-completed requests
515 unsigned k = 0;
516 for (unsigned i=0; i<fBuf.size(); i++) {
517 if (fBuf[i]) {
518 if (fBuf[k] != NULL) {
519 for (; k<i; k++) {
520 if (fBuf[k] == NULL) {
521 break;
522 }
523 }
524 }
525 // if we found an empty spot between "k" and "i" move "i" there
526 // if there is no empty spot, then "i" does not need to be moved
527 if (fBuf[k] == NULL) {
528 fBuf[k] = fBuf[i];
529 fBuf[i] = NULL;
530 }
531 }
532 }
533 }
INT i
Definition mdump.cxx:32
INT k
Definition odbhist.cxx:40

Member Data Documentation

◆ fBuf

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

Definition at line 471 of file mhttpd.cxx.

◆ fMutex

MUTEX_T* RequestTraceBuf::fMutex

Definition at line 470 of file mhttpd.cxx.


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