Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends

pm_FriProcessor Class Reference

#include <pm_friprocessor.h>

Inheritance diagram for pm_FriProcessor:
Inheritance graph
[legend]
Collaboration diagram for pm_FriProcessor:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 pm_FriProcessor (i_MaintFriJob_i *a_maintJob, cmn_ThreadCounter &a_threadCnt)
void Insert (pm_FRIInfo a_friInfo)
void Completed ()
void Aborted ()
virtual void Run (void *a_arg)

Public Attributes

i_MaintFriJob_im_maintJob
cmn_ThreadCounterm_threadCnt
bool m_aborted

Private Member Functions

virtual ~pm_FriProcessor ()

Private Attributes

 log_CLASSID_m
 Macro to add class name member s_className.
cmn_Mutex m_list_x
cmn_Condition m_list_c
bool m_completed
deque< pm_FRIInfom_friInfo

Friends

class i_MaintFriJob_i

Detailed Description

Definition at line 51 of file pm_friprocessor.h.


Constructor & Destructor Documentation

pm_FriProcessor::pm_FriProcessor ( i_MaintFriJob_i a_maintJob,
cmn_ThreadCounter a_threadCnt 
)

Definition at line 47 of file pm_friprocessor.cpp.

References cmn_ThreadCounter::Inc(), log_FUNC_m, and m_threadCnt.

Referenced by ~pm_FriProcessor().

                                                                                            :
    m_list_c(&m_list_x),
    m_completed(false),
    m_maintJob(a_maintJob),
    m_threadCnt(a_threadCnt),
    m_aborted(false){
    
    log_FUNC_m(pm_FriProcessor);
    m_threadCnt.Inc();

}

Here is the call graph for this function:

Here is the caller graph for this function:

pm_FriProcessor::~pm_FriProcessor (  )  [private, virtual]

Member Function Documentation

void pm_FriProcessor::Aborted (  ) 

Definition at line 78 of file pm_friprocessor.cpp.

References cmn_Condition::Broadcast(), dbg_NORM, log_DBG_m, log_FUNC_m, m_aborted, m_list_c, and m_list_x.

Referenced by i_MaintFriJob_i::AbortFriProcessor().

                             {
    log_FUNC_m(Aborted);
    m_aborted = true;
    log_DBG_m(dbg_NORM, "m_list_x waiting for lock.");
    cmn_MutexLock l(m_list_x);
    m_list_c.Broadcast();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void pm_FriProcessor::Completed (  ) 

Definition at line 120 of file pm_friprocessor.cpp.

References cmn_Condition::Broadcast(), log_FUNC_m, m_completed, m_list_c, and m_list_x.

Referenced by i_MaintFriJob_i::EndOfFRIInput().

Here is the call graph for this function:

Here is the caller graph for this function:

void pm_FriProcessor::Insert ( pm_FRIInfo  a_friInfo  ) 

Definition at line 68 of file pm_friprocessor.cpp.

References cmn_Condition::Broadcast(), ie_FATAL_ERROR, ivd_Error, log_FUNC_m, m_completed, m_friInfo, m_list_c, and m_list_x.

Referenced by i_MaintFriJob_i::InsertToFriProcessor().

                                                {
    log_FUNC_m(Insert);
    cmn_MutexLock l(m_list_x);
    if (!m_completed || m_friInfo.size() > 0){
        m_friInfo.push_back(a_friInfo);
        m_list_c.Broadcast();
    } else {
        throw ivd_Error(ie_FATAL_ERROR, "Insert called after completing.");
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void pm_FriProcessor::Run ( void *  a_arg  )  [virtual]

Reimplemented from cmn_Thread.

Definition at line 86 of file pm_friprocessor.cpp.

References dbg_NORM, i_UNKNOWN, log_DBG_m, log_FUNC_m, m_aborted, m_completed, m_friInfo, m_list_c, m_list_x, m_maintJob, i_Job_i::m_status, i_MaintFriJob_i::ProcessFRI(), and cmn_Condition::Wait().

                                    {
    log_FUNC_m(Run);

    deque<pm_FRIInfo>::iterator iter;
    while (!m_aborted){
        if (m_friInfo.empty()){
            if (m_completed) {
                if (m_maintJob->m_status == i_UNKNOWN){
                    m_maintJob->m_status = i_SUCCEDED; 
                }
                return;
            }
            cmn_MutexLock l(m_list_x);
            log_DBG_m(dbg_NORM, "waiting for next fri, queue is empty.m_list_x unlocked.");
            m_list_c.Wait();
            log_DBG_m(dbg_NORM, "m_list_x locked.");
        } else {
            {
                cmn_MutexLock l(m_list_x);
                iter = m_friInfo.begin();
            }
            log_DBG_m(dbg_NORM, "Will process FRI. bea:" << iter->m_beaNum <<
                                                ", vol:" << iter->m_volNum );
            m_maintJob->ProcessFRI(*iter);
            {
                cmn_MutexLock l(m_list_x);
                m_friInfo.pop_front();
                log_DBG_m(dbg_NORM, "Remaining FRI's to process" << 
                                    m_friInfo.size() );
            }
        }
    }
}

Here is the call graph for this function:


Friends And Related Function Documentation

friend class i_MaintFriJob_i [friend]

Definition at line 53 of file pm_friprocessor.h.


Member Data Documentation

Macro to add class name member s_className.

Reimplemented from cmn_Thread.

Definition at line 62 of file pm_friprocessor.h.

Definition at line 79 of file pm_friprocessor.h.

Referenced by Aborted(), Run(), and ~pm_FriProcessor().

Definition at line 67 of file pm_friprocessor.h.

Referenced by Completed(), Insert(), and Run().

Definition at line 69 of file pm_friprocessor.h.

Referenced by Insert(), and Run().

Definition at line 65 of file pm_friprocessor.h.

Referenced by Aborted(), Completed(), Insert(), and Run().

Definition at line 64 of file pm_friprocessor.h.

Referenced by Aborted(), Completed(), Insert(), and Run().

Definition at line 77 of file pm_friprocessor.h.

Referenced by Run(), and ~pm_FriProcessor().

Definition at line 78 of file pm_friprocessor.h.

Referenced by pm_FriProcessor(), and ~pm_FriProcessor().


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