Public Member Functions | Public Attributes

hsm_FreeJobIdxStack Class Reference
[Classes for managing object list]

#include <hsm_joblistmgr.h>

Collaboration diagram for hsm_FreeJobIdxStack:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 hsm_FreeJobIdxStack ()
void Push (UInt32_t a_idx)
UInt32_t Pop ()

Public Attributes

 log_CLASSID_m
cmn_Condition m_someElementOnStack
cmn_Mutex m_jobElemVecMgr_x

Detailed Description

Definition at line 86 of file hsm_joblistmgr.h.


Constructor & Destructor Documentation

hsm_FreeJobIdxStack::hsm_FreeJobIdxStack (  )  [inline]

Definition at line 88 of file hsm_joblistmgr.h.


Member Function Documentation

UInt32_t hsm_FreeJobIdxStack::Pop (  ) 

Definition at line 248 of file hsm_joblistmgr.cpp.

References dbg_DETAIL, log_DBG_m, log_FUNC_m, log_NOTE_m, m_jobElemVecMgr_x, m_someElementOnStack, size, and cmn_Condition::Wait().

Referenced by hsm_JobListMgr::GetJobIdx().

                                  {
    log_FUNC_m(Pop);

    cmn_MutexLock l(m_jobElemVecMgr_x);
    while (size() == 0) {
        log_FUNC_m(Pop);
        ostringstream sstr;
        sstr << "HSM is overloaded and cannot starts new jobs. Wait for running jobs to complete and restart failed jobs.";
//        log_WriteEvent(evt_INFO, sstr.str());        
        log_DBG_m(dbg_DETAIL, sstr.str());
        log_NOTE_m(sstr.str());
        m_someElementOnStack.Wait();
    };
    UInt32_t idx = top();
    pop();
    return idx; 
}

Here is the call graph for this function:

Here is the caller graph for this function:

void hsm_FreeJobIdxStack::Push ( UInt32_t  a_idx  ) 

Definition at line 235 of file hsm_joblistmgr.cpp.

References cmn_Condition::Broadcast(), log_FUNC_m, m_jobElemVecMgr_x, m_someElementOnStack, and size.

Referenced by hsm_JobListMgr::ReleaseJobIdx(), and hsm_JobListMgr::ReleaseJobIdxWithTest().

                                             {
    log_FUNC_m(Push);

    cmn_MutexLock l(m_jobElemVecMgr_x);
    push(a_idx);
    if (size() == 1) {  // 
//        log_FUNC_m(Push);
//        log_DBG_m(dbg_DETAIL, "Release on job index to stack. idx = " << a_idx);
        m_someElementOnStack.Broadcast();
    };
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 92 of file hsm_joblistmgr.h.

Definition at line 97 of file hsm_joblistmgr.h.

Referenced by Pop(), and Push().

Definition at line 96 of file hsm_joblistmgr.h.

Referenced by Pop(), and Push().


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