#include <pm_friprocessor.h>


Definition at line 37 of file pm_friprocessor.h.
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_i * | m_maintJob |
| cmn_ThreadCounter & | m_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_FRIInfo > | m_friInfo |
Friends | |
| class | i_MaintFriJob_i |
| pm_FriProcessor::pm_FriProcessor | ( | i_MaintFriJob_i * | a_maintJob, | |
| cmn_ThreadCounter & | a_threadCnt | |||
| ) |
Definition at line 33 of file pm_friprocessor.cpp.
References cmn_ThreadCounter::Inc(), log_FUNC_m, and m_threadCnt.
Referenced by ~pm_FriProcessor().
00033 : 00034 m_list_c(&m_list_x), 00035 m_completed(false), 00036 m_maintJob(a_maintJob), 00037 m_threadCnt(a_threadCnt), 00038 m_aborted(false){ 00039 00040 log_FUNC_m(pm_FriProcessor); 00041 m_threadCnt.Inc(); 00042 00043 }


| pm_FriProcessor::~pm_FriProcessor | ( | ) | [private, virtual] |
Definition at line 46 of file pm_friprocessor.cpp.
References i_MaintFriJob_i::CompleteJob(), cmn_ThreadCounter::Dec(), log_FUNC_m, m_aborted, m_maintJob, i_Job_i::m_status, m_threadCnt, and pm_FriProcessor().
00046 { 00047 log_FUNC_m(~pm_FriProcessor()); 00048 m_threadCnt.Dec(); 00049 if (!m_aborted){ 00050 m_maintJob->CompleteJob(m_maintJob->m_status); 00051 } 00052 }

| void pm_FriProcessor::Insert | ( | pm_FRIInfo | a_friInfo | ) |
Definition at line 54 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().
00054 { 00055 log_FUNC_m(Insert); 00056 cmn_MutexLock l(m_list_x); 00057 if (!m_completed || m_friInfo.size() > 0){ 00058 m_friInfo.push_back(a_friInfo); 00059 m_list_c.Broadcast(); 00060 } else { 00061 throw ivd_Error(ie_FATAL_ERROR, "Insert called after completing."); 00062 } 00063 }


| void pm_FriProcessor::Completed | ( | ) |
Definition at line 106 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().
00106 { 00107 log_FUNC_m(Completed); 00108 00109 m_completed = true; 00110 cmn_MutexLock l(m_list_x); 00111 m_list_c.Broadcast(); 00112 }


| void pm_FriProcessor::Aborted | ( | ) |
Definition at line 64 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().
00064 { 00065 log_FUNC_m(Aborted); 00066 m_aborted = true; 00067 log_DBG_m(dbg_NORM, "m_list_x waiting for lock."); 00068 cmn_MutexLock l(m_list_x); 00069 m_list_c.Broadcast(); 00070 }


| void pm_FriProcessor::Run | ( | void * | a_arg | ) | [virtual] |
Reimplemented from cmn_Thread.
Definition at line 72 of file pm_friprocessor.cpp.
References dbg_NORM, i_SUCCEDED, 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().
00072 { 00073 log_FUNC_m(Run); 00074 00075 deque<pm_FRIInfo>::iterator iter; 00076 while (!m_aborted){ 00077 if (m_friInfo.empty()){ 00078 if (m_completed) { 00079 if (m_maintJob->m_status == i_UNKNOWN){ 00080 m_maintJob->m_status = i_SUCCEDED; 00081 } 00082 return; 00083 } 00084 cmn_MutexLock l(m_list_x); 00085 log_DBG_m(dbg_NORM, "waiting for next fri, queue is empty.m_list_x unlocked."); 00086 m_list_c.Wait(); 00087 log_DBG_m(dbg_NORM, "m_list_x locked."); 00088 } else { 00089 { 00090 cmn_MutexLock l(m_list_x); 00091 iter = m_friInfo.begin(); 00092 } 00093 log_DBG_m(dbg_NORM, "Will process FRI. bea:" << iter->m_beaNum << 00094 ", vol:" << iter->m_volNum ); 00095 m_maintJob->ProcessFRI(*iter); 00096 { 00097 cmn_MutexLock l(m_list_x); 00098 m_friInfo.pop_front(); 00099 log_DBG_m(dbg_NORM, "Remaining FRI's to process" << 00100 m_friInfo.size() ); 00101 } 00102 } 00103 } 00104 }

friend class i_MaintFriJob_i [friend] |
Definition at line 39 of file pm_friprocessor.h.
pm_FriProcessor::log_CLASSID_m [private] |
Macro to add class name member s_className.
Reimplemented from cmn_Thread.
Definition at line 48 of file pm_friprocessor.h.
cmn_Mutex pm_FriProcessor::m_list_x [private] |
Definition at line 50 of file pm_friprocessor.h.
Referenced by Aborted(), Completed(), Insert(), and Run().
cmn_Condition pm_FriProcessor::m_list_c [private] |
Definition at line 51 of file pm_friprocessor.h.
Referenced by Aborted(), Completed(), Insert(), and Run().
bool pm_FriProcessor::m_completed [private] |
deque<pm_FRIInfo> pm_FriProcessor::m_friInfo [private] |
Definition at line 64 of file pm_friprocessor.h.
Referenced by pm_FriProcessor(), and ~pm_FriProcessor().
Definition at line 65 of file pm_friprocessor.h.
Referenced by Aborted(), Run(), and ~pm_FriProcessor().
1.5.6