CScoreCache Class Reference

Search Toolkit Book for CScoreCache

#include <aln_scoring.hpp>

Inheritance diagram for CScoreCache:

Inheritance graph
[legend]
Collaboration diagram for CScoreCache:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 147 of file aln_scoring.hpp.

Public Types

typedef IAlnExplorer::TNumrow TNumrow
typedef IScoringMethod::TScore TScore
typedef IScoringMethod::TScoreVector TScoreVector
typedef IScoringMethod::TScoreColl TScoreColl

Public Member Functions

 CScoreCache ()
 CScoreCache.
 ~CScoreCache ()
void SetListener (IListener *listener)
void EnableBackgoundProcessing (bool en)
void SetGradNumber (int grad_n)
 Sets the number of score gradations.
void SetScoringMethod (IScoringMethod *method)
IScoringMethodGetScoringMethod ()
const IScoringMethodGetScoringMethod () const
void SetAlignment (IScoringAlignment *aln)
const IScoringAlignmentGetAlignment () const
void ResetScores ()
void CalculateScores ()
 Recalculate scores using current method; resets scores if no method is selected.
bool HasScores () const
 returns "true" if CalculateScores() did produce results
const TScoreCollGetScores (TNumrow row) const
const CRgbaColorGetColorForScore (TScore score, IScoringMethod::EColorType type) const
const CRgbaColorGetColorForNoScore (IScoringMethod::EColorType type) const
void OnAJNotification (CEvent *evt)

Protected Types

typedef vector< TScoreCollTScoreCollVector

Protected Member Functions

 DECLARE_EVENT_MAP ()
bool x_IsJobRunning ()
 returns true if CScoreCache launched the job and it has not finished yet (it may have finished, but CScoreCache has not yet been notified)
void x_DeleteJob ()
 stop the job and destriy it
void x_OnJobCompleted (CAppJobNotification &notn)
void x_OnJobFailed (CAppJobNotification &notn)
void x_OnJobCanceled (CAppJobNotification &notn)
void x_OnJobProgress (CAppJobNotification &notn)
bool x_TransferResults (CObject *result)

Protected Attributes

TScoreCollVectorm_ScoreColls
IListenerm_Listener
 score storage
CScoringParams m_Params
bool m_EnBgProcessing
int m_JobID
CRef< CScoringJobm_Job
bool m_HasScores
CRgbaColor m_NoScoreColor

Classes

class  IListener


Member Typedef Documentation

typedef IAlnExplorer::TNumrow CScoreCache::TNumrow
 

Definition at line 150 of file aln_scoring.hpp.

typedef IScoringMethod::TScore CScoreCache::TScore
 

Definition at line 151 of file aln_scoring.hpp.

typedef IScoringMethod::TScoreColl CScoreCache::TScoreColl
 

Definition at line 153 of file aln_scoring.hpp.

typedef vector<TScoreColl> CScoreCache::TScoreCollVector [protected]
 

Definition at line 212 of file aln_scoring.hpp.

typedef IScoringMethod::TScoreVector CScoreCache::TScoreVector
 

Definition at line 152 of file aln_scoring.hpp.


Constructor & Destructor Documentation

CScoreCache::CScoreCache  ) 
 

CScoreCache.

Definition at line 62 of file aln_scoring.cpp.

References m_ScoreColls.

CScoreCache::~CScoreCache  ) 
 

Definition at line 72 of file aln_scoring.cpp.

References m_ScoreColls, x_DeleteJob(), and x_IsJobRunning().


Member Function Documentation

void CScoreCache::CalculateScores  ) 
 

Recalculate scores using current method; resets scores if no method is selected.

Definition at line 164 of file aln_scoring.cpp.

References CAppJobDispatcher::GetInstance(), CRef< C, Locker >::GetPointer(), m_EnBgProcessing, m_HasScores, m_Job, m_JobID, CScoringParams::m_Method, m_Params, CRef< C, Locker >::Reset(), ResetScores(), CAppJobDispatcher::StartJob(), and x_TransferResults().

Referenced by CAlnMultiModel::UpdateOnScoringChanged(), CAlnMultiModel::x_UpdateOnCoordsChanged(), and CAlnMultiModel::x_UpdateOnDataChanged().

CScoreCache::DECLARE_EVENT_MAP  )  [protected]
 

void CScoreCache::EnableBackgoundProcessing bool  en  ) 
 

Definition at line 96 of file aln_scoring.cpp.

References m_EnBgProcessing.

Referenced by CAlnMultiModel::EnableBackgroundProcessing().

const IScoringAlignment * CScoreCache::GetAlignment  )  const
 

Definition at line 138 of file aln_scoring.cpp.

References CScoringParams::m_Alignment, and m_Params.

Referenced by CAlnMultiModel::UpdateOnScoringChanged().

const CRgbaColor & CScoreCache::GetColorForNoScore IScoringMethod::EColorType  type  )  const
 

Definition at line 330 of file aln_scoring.cpp.

References CScoringParams::m_Method, and m_Params.

const CRgbaColor & CScoreCache::GetColorForScore TScore  score,
IScoringMethod::EColorType  type
const [inline]
 

Definition at line 227 of file aln_scoring.hpp.

References CScoringParams::m_Method, and m_Params.

const CScoreCache::TScoreColl & CScoreCache::GetScores TNumrow  row  )  const
 

Definition at line 336 of file aln_scoring.cpp.

References _ASSERT, and m_ScoreColls.

const IScoringMethod * CScoreCache::GetScoringMethod  )  const
 

Definition at line 126 of file aln_scoring.cpp.

References CScoringParams::m_Method, and m_Params.

IScoringMethod * CScoreCache::GetScoringMethod  ) 
 

Definition at line 120 of file aln_scoring.cpp.

References CScoringParams::m_Method, and m_Params.

Referenced by CAlnMultiModel::GetCurrentMethod(), CAlnVecRow::x_RenderAlign(), and CAlnVecRow::x_RenderSequence().

bool CScoreCache::HasScores  )  const
 

returns "true" if CalculateScores() did produce results

Definition at line 324 of file aln_scoring.cpp.

References m_HasScores.

Referenced by CAlnVecRow::x_RenderAlign(), and CAlnVecRow::x_RenderSequence().

void CScoreCache::OnAJNotification CEvent evt  ) 
 

Definition at line 187 of file aln_scoring.cpp.

References _ASSERT, IAppJob::eCanceled, IAppJob::eCompleted, IAppJob::eFailed, ERR_POST, IAppJob::eRunning, CAppJobNotification::GetJobID(), CAppJobNotification::GetState(), m_JobID, x_OnJobCanceled(), x_OnJobCompleted(), x_OnJobFailed(), and x_OnJobProgress().

void CScoreCache::ResetScores  ) 
 

Definition at line 144 of file aln_scoring.cpp.

References CAppJobDispatcher::DeleteJob(), CAppJobDispatcher::GetInstance(), m_EnBgProcessing, m_HasScores, m_Job, m_JobID, m_ScoreColls, and CRef< C, Locker >::Reset().

Referenced by CalculateScores().

void CScoreCache::SetAlignment IScoringAlignment aln  ) 
 

Definition at line 132 of file aln_scoring.cpp.

References CScoringParams::m_Alignment, and m_Params.

Referenced by CAlnMultiModel::SetDataSource(), and CAlnMultiModel::x_UpdateOnDataChanged().

void CScoreCache::SetGradNumber int  grad_n  ) 
 

Sets the number of score gradations.

Definition at line 102 of file aln_scoring.cpp.

References _ASSERT, CScoringParams::m_GradNumber, and m_Params.

Referenced by CAlnMultiModel::CAlnMultiModel().

&CScoreCache::OnAJNotification void CScoreCache::SetListener IListener listener  ) 
 

Definition at line 90 of file aln_scoring.cpp.

Referenced by CAlnMultiModel::CAlnMultiModel(), and CAlnMultiModel::~CAlnMultiModel().

void CScoreCache::SetScoringMethod IScoringMethod method  ) 
 

Definition at line 109 of file aln_scoring.cpp.

References CScoringParams::m_Method, m_Params, x_DeleteJob(), and x_IsJobRunning().

Referenced by CAlnMultiModel::ResetCurrentMethod(), CAlnMultiModel::SetCurrentMethod(), and CAlnMultiModel::~CAlnMultiModel().

void CScoreCache::x_DeleteJob  )  [protected]
 

stop the job and destriy it

Definition at line 225 of file aln_scoring.cpp.

References _ASSERT, CAppJobDispatcher::DeleteJob(), CAppJobDispatcher::GetInstance(), m_EnBgProcessing, m_Job, m_JobID, m_Listener, CScoreCache::IListener::OnScoringFinished(), and CRef< C, Locker >::Reset().

Referenced by SetScoringMethod(), and ~CScoreCache().

bool CScoreCache::x_IsJobRunning  )  [protected]
 

returns true if CScoreCache launched the job and it has not finished yet (it may have finished, but CScoreCache has not yet been notified)

Definition at line 219 of file aln_scoring.cpp.

References CRef< C, Locker >::GetPointer(), and m_Job.

Referenced by SetScoringMethod(), and ~CScoreCache().

void CScoreCache::x_OnJobCanceled CAppJobNotification notn  )  [protected]
 

Definition at line 299 of file aln_scoring.cpp.

References m_Job, m_JobID, m_Listener, CScoreCache::IListener::OnScoringFinished(), and CRef< C, Locker >::Reset().

Referenced by OnAJNotification().

void CScoreCache::x_OnJobCompleted CAppJobNotification notn  )  [protected]
 

Definition at line 244 of file aln_scoring.cpp.

References CRef< C, Locker >::GetPointer(), CAppJobNotification::GetResult(), m_Job, m_JobID, m_Listener, CScoreCache::IListener::OnScoringFinished(), CRef< C, Locker >::Reset(), and x_TransferResults().

Referenced by OnAJNotification().

void CScoreCache::x_OnJobFailed CAppJobNotification notn  )  [protected]
 

Definition at line 280 of file aln_scoring.cpp.

References CAppJobNotification::GetError(), m_Job, m_JobID, m_Listener, CScoreCache::IListener::OnScoringFinished(), and CRef< C, Locker >::Reset().

Referenced by OnAJNotification().

void CScoreCache::x_OnJobProgress CAppJobNotification notn  )  [protected]
 

Definition at line 311 of file aln_scoring.cpp.

References CAppJobNotification::GetProgress(), and m_Listener.

Referenced by OnAJNotification().

bool CScoreCache::x_TransferResults CObject result  )  [protected]
 

Definition at line 259 of file aln_scoring.cpp.

References _ASSERT, ERR_POST, m_HasScores, CScoringJobResult::m_ScoreColls, and m_ScoreColls.

Referenced by CalculateScores(), and x_OnJobCompleted().


Member Data Documentation

bool CScoreCache::m_EnBgProcessing [protected]
 

Definition at line 218 of file aln_scoring.hpp.

Referenced by CalculateScores(), EnableBackgoundProcessing(), ResetScores(), and x_DeleteJob().

bool CScoreCache::m_HasScores [protected]
 

Definition at line 222 of file aln_scoring.hpp.

Referenced by CalculateScores(), HasScores(), ResetScores(), and x_TransferResults().

CRef<CScoringJob> CScoreCache::m_Job [protected]
 

Definition at line 220 of file aln_scoring.hpp.

Referenced by CalculateScores(), ResetScores(), x_DeleteJob(), x_IsJobRunning(), x_OnJobCanceled(), x_OnJobCompleted(), and x_OnJobFailed().

int CScoreCache::m_JobID [protected]
 

Definition at line 219 of file aln_scoring.hpp.

Referenced by CalculateScores(), OnAJNotification(), ResetScores(), x_DeleteJob(), x_OnJobCanceled(), x_OnJobCompleted(), and x_OnJobFailed().

IListener* CScoreCache::m_Listener [protected]
 

score storage

Definition at line 215 of file aln_scoring.hpp.

Referenced by x_DeleteJob(), x_OnJobCanceled(), x_OnJobCompleted(), x_OnJobFailed(), and x_OnJobProgress().

CRgbaColor CScoreCache::m_NoScoreColor [protected]
 

Definition at line 223 of file aln_scoring.hpp.

CScoringParams CScoreCache::m_Params [protected]
 

Definition at line 217 of file aln_scoring.hpp.

Referenced by CalculateScores(), GetAlignment(), GetColorForNoScore(), GetColorForScore(), GetScoringMethod(), SetAlignment(), SetGradNumber(), and SetScoringMethod().

TScoreCollVector* CScoreCache::m_ScoreColls [protected]
 

Definition at line 213 of file aln_scoring.hpp.

Referenced by CScoreCache(), GetScores(), ResetScores(), x_TransferResults(), and ~CScoreCache().


The documentation for this class was generated from the following files:
Generated on Mon Dec 7 13:58:52 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Dec 07 16:23:55 2009 by modify_doxy.py rev. 173732