CFeatTableDS Class Reference

Search Toolkit Book for CFeatTableDS

#include <feat_table_ds.hpp>

Inheritance diagram for CFeatTableDS:

Inheritance graph
[legend]
Collaboration diagram for CFeatTableDS:

Collaboration graph
[legend]
List of all members.

Detailed Description

CFeatTableDS Data source for Feature Table widget.

Implements TableModel (for CTableControl) and is responsible for loading and updating data asynchronously.

Definition at line 59 of file feat_table_ds.hpp.

Public Types

typedef vector< SFeatureTFeatures
enum  EColumns {
  eLabel, eType, eFrom, eTo,
  eLength, eStrand, eProduct, eIntervals,
  eMaxCols
}
 a list of the available column types we can show More...

Public Member Functions

 CFeatTableDS ()
virtual ~CFeatTableDS ()
void GetTypeNames (vector< string > &names) const
void Clear ()
void OnJobNotification (CEvent *evt)
 DECLARE_EVENT_MAP ()
Setting data methods
void Init (const objects::CSeq_loc &loc, objects::CScope &scope, const objects::SAnnotSelector *sel=0)
void SetSelector (const objects::SAnnotSelector &sel)
 sets the DataSource-specific filter
void Update ()
 reloads data based on using current settings
CRef< objects::CScope > GetScope () const
const SFeatureGetFeature (size_t row) const
const objects::CSeq_feat & GetOriginalFeature (size_t row) const
ITableModel implementation
virtual int GetNumRows () const
 Returns the number of rows in the model.
virtual int GetNumColumns () const
 Returns the number of columns in the model.
virtual wxVariant GetValueAt (int row, int col) const
virtual wxString GetColumnName (int aColIx) const
 Returns a default name for the column using spreadsheet conventions: A, B, C, .
virtual wxString GetColumnType (int aColIx) const
 Tries to extract actual type from row 0 value if it exists.

Private Types

typedef map< string, string > TTypeHash

Private Member Functions

virtual void x_OnJobNotification (CEvent *evt)
void x_UpdateTypeHash ()

Private Attributes

CConstRef< objects::CSeq_loc > m_SeqLoc
CRef< objects::CScope > m_Scope
objects::SAnnotSelector m_Selector
vector< SFeaturem_Features
CAppJobDispatcher::TJobID m_ActiveJob
 app job notification and control
TTypeHash m_TypeHash

Classes

struct  SFeature
 our actual features More...


Member Typedef Documentation

typedef vector<SFeature> CFeatTableDS::TFeatures
 

Definition at line 106 of file feat_table_ds.hpp.

typedef map<string, string> CFeatTableDS::TTypeHash [private]
 

Definition at line 168 of file feat_table_ds.hpp.


Member Enumeration Documentation

enum CFeatTableDS::EColumns
 

a list of the available column types we can show

Enumerator:
eLabel 
eType 
eFrom 
eTo 
eLength 
eStrand 
eProduct 
eIntervals 
eMaxCols  this must be the last entry!

Definition at line 67 of file feat_table_ds.hpp.


Constructor & Destructor Documentation

CFeatTableDS::CFeatTableDS  ) 
 

Definition at line 272 of file feat_table_ds.cpp.

CFeatTableDS::~CFeatTableDS  )  [virtual]
 

Definition at line 277 of file feat_table_ds.cpp.

References Clear().


Member Function Documentation

void CFeatTableDS::Clear void   ) 
 

delete any active jobs

this is fine - job probably already finished

Definition at line 320 of file feat_table_ds.cpp.

References CAppJobDispatcher::DeleteJob(), CAppJobException::eEngine_UnknownJob, CAppJobException::eUnknownJob, CAppJobDispatcher::GetInstance(), LOG_POST, and m_ActiveJob.

Referenced by ~CFeatTableDS().

CFeatTableDS::DECLARE_EVENT_MAP  ) 
 

wxString CFeatTableDS::GetColumnName int  aColIx  )  const [virtual]
 

Returns a default name for the column using spreadsheet conventions: A, B, C, .

.. Z, AA, AB, etc. If column cannot be found, returns an empty name. AnyType has a type of string.

There is one static instance of string inside, so it is refilled every next call. It is enough for drawing purposes, but if someone needs more, (s)he should implement more.

Reimplemented from CwxAbstractTableModel.

Definition at line 448 of file feat_table_ds.cpp.

References _ASSERT, _T, CwxAbstractTableModel::GetColumnName(), GetNumColumns(), and size.

wxString CFeatTableDS::GetColumnType int  aColIx  )  const [virtual]
 

Tries to extract actual type from row 0 value if it exists.

Otherwise returns typeid(int) [anyway it is of no use in abcence of data]

Reimplemented from CwxAbstractTableModel.

Definition at line 471 of file feat_table_ds.cpp.

References _ASSERT, _T, eFrom, eIntervals, eLabel, eLength, eProduct, eStrand, eTo, eType, and GetNumColumns().

const CFeatTableDS::SFeature & CFeatTableDS::GetFeature size_t  row  )  const
 

Definition at line 421 of file feat_table_ds.cpp.

References _ASSERT, GetNumRows(), and m_Features.

int CFeatTableDS::GetNumColumns  )  const [virtual]
 

Returns the number of columns in the model.

A CTableControl uses this method to determine how many columns it should create and display by default.

Implements CwxAbstractTableModel.

Definition at line 443 of file feat_table_ds.cpp.

References eMaxCols.

Referenced by GetColumnName(), and GetColumnType().

int CFeatTableDS::GetNumRows  )  const [virtual]
 

Returns the number of rows in the model.

A CTableControl uses this method to determine how many rows it should display. This method should be quick, as it is called frequently during rendering.

Implements CwxAbstractTableModel.

Definition at line 438 of file feat_table_ds.cpp.

References m_Features.

Referenced by GetFeature(), GetOriginalFeature(), and GetValueAt().

const CSeq_feat & CFeatTableDS::GetOriginalFeature size_t  row  )  const
 

Definition at line 428 of file feat_table_ds.cpp.

References _ASSERT, CFeatTableDS::SFeature::feat, GetNumRows(), and m_Features.

CRef< objects::CScope > CFeatTableDS::GetScope  )  const
 

Definition at line 415 of file feat_table_ds.cpp.

References m_Scope.

void CFeatTableDS::GetTypeNames vector< string > &  names  )  const
 

Definition at line 521 of file feat_table_ds.cpp.

References ITERATE, and m_TypeHash.

wxVariant CFeatTableDS::GetValueAt int  row,
int  col
const [virtual]
 

Implements CwxAbstractTableModel.

Definition at line 492 of file feat_table_ds.cpp.

References _ASSERT, eFrom, eIntervals, eLabel, eLength, eProduct, eStrand, eTo, eType, GetNumRows(), kEmptyStr, m_Features, and ToWxString().

void CFeatTableDS::Init const objects::CSeq_loc &  loc,
objects::CScope &  scope,
const objects::SAnnotSelector *  sel = 0
 

Definition at line 282 of file feat_table_ds.cpp.

References CSeqUtils::GetAnnotSelector(), m_Scope, m_Selector, m_SeqLoc, CRef< C, Locker >::Reset(), CConstRef< C, Locker >::Reset(), and Update().

Referenced by CwxDemoFeatureTableFrame::LoadAccession().

void CFeatTableDS::OnJobNotification CEvent evt  ) 
 

Definition at line 367 of file feat_table_ds.cpp.

void CFeatTableDS::SetSelector const objects::SAnnotSelector &  sel  ) 
 

sets the DataSource-specific filter

void CFeatTableDS::Update  ) 
 

reloads data based on using current settings

Definition at line 304 of file feat_table_ds.cpp.

References CAppJobDispatcher::GetInstance(), LOG_POST, m_ActiveJob, m_Scope, m_Selector, m_SeqLoc, and CAppJobDispatcher::StartJob().

Referenced by Init().

void CFeatTableDS::x_OnJobNotification CEvent evt  )  [private, virtual]
 

Definition at line 373 of file feat_table_ds.cpp.

References _ASSERT, IAppJob::eCanceled, IAppJob::eCompleted, IAppJob::eFailed, m_ActiveJob, m_Features, CwxAbstractTableModel::x_FireDataChanged(), and x_UpdateTypeHash().

void CFeatTableDS::x_UpdateTypeHash  )  [private]
 

Definition at line 354 of file feat_table_ds.cpp.

References map_checker< Container >::clear(), ITERATE, m_Features, and m_TypeHash.

Referenced by x_OnJobNotification().


Member Data Documentation

CAppJobDispatcher::TJobID CFeatTableDS::m_ActiveJob [private]
 

app job notification and control

Definition at line 166 of file feat_table_ds.hpp.

Referenced by Clear(), Update(), and x_OnJobNotification().

vector<SFeature> CFeatTableDS::m_Features [private]
 

Definition at line 163 of file feat_table_ds.hpp.

Referenced by GetFeature(), GetNumRows(), GetOriginalFeature(), GetValueAt(), x_OnJobNotification(), and x_UpdateTypeHash().

CRef<objects::CScope> CFeatTableDS::m_Scope [private]
 

Definition at line 158 of file feat_table_ds.hpp.

Referenced by GetScope(), Init(), and Update().

objects::SAnnotSelector CFeatTableDS::m_Selector [private]
 

Definition at line 161 of file feat_table_ds.hpp.

Referenced by Init(), and Update().

CConstRef<objects::CSeq_loc> CFeatTableDS::m_SeqLoc [private]
 

Definition at line 157 of file feat_table_ds.hpp.

Referenced by Init(), and Update().

TTypeHash CFeatTableDS::m_TypeHash [private]
 

Definition at line 169 of file feat_table_ds.hpp.

Referenced by GetTypeNames(), and x_UpdateTypeHash().


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