NCBI C++ ToolKit
|
Search Toolkit Book for CFeatTableDS
CFeatTableDS Data source for Feature Table widget. More...
#include <gui/widgets/feat_table/feat_table_ds.hpp>
Classes | |
struct | SFeatureRow |
our actual features More... | |
Public Types | |
enum | EColumns { eNum , eLabel , eType , eFrom , eTo , eLength , eStrand , eProduct , eIntervals , eNumColumns } |
a list of the available column types we can show More... | |
Public Types inherited from CObject | |
enum | EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern } |
Control filling of newly allocated memory. More... | |
typedef CObjectCounterLocker | TLockerType |
Default locker type for CRef. More... | |
typedef atomic< Uint8 > | TCounter |
Counter type is CAtomiCounter. More... | |
typedef Uint8 | TCount |
Alias for value type of counter. More... | |
Public Types inherited from CEventHandler | |
enum | EDispatch { eDispatch_SelfOnly , eDispatch_AllHandlers , eDispatch_FirstHandler , eDispatch_Default = eDispatch_AllHandlers } |
enum controlling dispatching strategies More... | |
enum | EPoolName { ePool_Default = 0 , ePool_Parent , ePool_Child , ePool_Sibling , ePool_NextAvailable } |
Identifiers for standard pools. More... | |
typedef vector< CEventHandler * > | TListeners |
typedef map< int, TListeners > | TPools |
typedef list< AutoPtr< SPostRequest > > | TPostRequests |
typedef std::map< CEventHandler *, int > | THandlerToCount |
typedef void(* | FOnPostCallback) () |
Public Member Functions | |
CFeatTableDS () | |
virtual | ~CFeatTableDS () |
void | GetTypeNames (vector< string > &names) const |
void | OnJobNotification (CEvent *evt) |
void | ClearCurrentJob () |
void | Clear () |
void | x_NotifyObserversNow () |
DECLARE_EVENT_MAP () | |
Setting data methods | |
void | Init (const CSerialObject &obj, objects::CScope &scope, const objects::SAnnotSelector *sel=0) |
void | SetSelector (const objects::SAnnotSelector &sel) |
sets the DataSource-specific filter More... | |
objects::SAnnotSelector | GetSelector () const |
CRef< objects::CScope > | GetScope () const |
const SFeatureRow & | GetFeatureRow (size_t row) const |
const objects::CSeq_feat & | GetFeature (size_t row) const |
void | Update () |
reloads data based on current settings More... | |
ITableModel implementation | |
virtual int | GetNumRows () const |
Returns the number of rows in the model. More... | |
virtual int | GetNumColumns () const |
Returns the number of columns in the model. More... | |
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, ... More... | |
virtual wxString | GetColumnType (int aColIx) const |
Tries to extract actual type from row 0 value if it exists. More... | |
Public Member Functions inherited from CObjectEx | |
CObjectEx (void) | |
virtual | ~CObjectEx (void) |
Public Member Functions inherited from CObject | |
CObject (void) | |
Constructor. More... | |
CObject (const CObject &src) | |
Copy constructor. More... | |
virtual | ~CObject (void) |
Destructor. More... | |
CObject & | operator= (const CObject &src) THROWS_NONE |
Assignment operator. More... | |
bool | CanBeDeleted (void) const THROWS_NONE |
Check if object can be deleted. More... | |
bool | IsAllocatedInPool (void) const THROWS_NONE |
Check if object is allocated in memory pool (not system heap) More... | |
bool | Referenced (void) const THROWS_NONE |
Check if object is referenced. More... | |
bool | ReferencedOnlyOnce (void) const THROWS_NONE |
Check if object is referenced only once. More... | |
void | AddReference (void) const |
Add reference to object. More... | |
void | RemoveReference (void) const |
Remove reference to object. More... | |
void | ReleaseReference (void) const |
Remove reference without deleting object. More... | |
virtual void | DoNotDeleteThisObject (void) |
Mark this object as not allocated in heap – do not delete this object. More... | |
virtual void | DoDeleteThisObject (void) |
Mark this object as allocated in heap – object can be deleted. More... | |
void * | operator new (size_t size) |
Define new operator for memory allocation. More... | |
void * | operator new[] (size_t size) |
Define new[] operator for 'array' memory allocation. More... | |
void | operator delete (void *ptr) |
Define delete operator for memory deallocation. More... | |
void | operator delete[] (void *ptr) |
Define delete[] operator for memory deallocation. More... | |
void * | operator new (size_t size, void *place) |
Define new operator. More... | |
void | operator delete (void *ptr, void *place) |
Define delete operator. More... | |
void * | operator new (size_t size, CObjectMemoryPool *place) |
Define new operator using memory pool. More... | |
void | operator delete (void *ptr, CObjectMemoryPool *place) |
Define delete operator. More... | |
virtual void | DebugDump (CDebugDumpContext ddc, unsigned int depth) const |
Define method for dumping debug information. More... | |
Public Member Functions inherited from CDebugDumpable | |
CDebugDumpable (void) | |
virtual | ~CDebugDumpable (void) |
void | DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const |
void | DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const |
void | DumpToConsole (void) const |
Public Member Functions inherited from CWeakObject | |
CWeakObject (void) | |
virtual | ~CWeakObject (void) |
CPtrToObjectProxy * | GetPtrProxy (void) const |
Get pointer to proxy object containing pointer to this object. More... | |
Public Member Functions inherited from CwxAbstractTableModel | |
CwxAbstractTableModel () | |
CwxAbstractTableModel. More... | |
virtual void | AddTMListener (IwxTableModelListener &aTMEar) |
virtual void | RemoveTMListener (IwxTableModelListener &aTMEar) |
Public Member Functions inherited from IwxDecoratedTableModel | |
virtual | ~IwxDecoratedTableModel () |
virtual wxString | GetColumnTitle (int col_idx) const |
All the same methods of IwxTableModel, plus. More... | |
virtual CIRef< IwxStringFormat > | GetColumnFormat (int) const |
virtual wxString | GetImageAliasAt (int, int) const |
virtual wxString | GetTooltipTextAt (int, int) const |
virtual wxColor | GetBackgroundColor (int) const |
Public Member Functions inherited from IwxTableModel | |
virtual | ~IwxTableModel () |
virtual wxString | GetTypeAt (int, int col) const |
virtual bool | IsEditableAt (int, int) const |
virtual void | SetValueAt (int, int, const wxVariant &) |
Public Member Functions inherited from CEventHandler | |
CEventHandler () | |
CEventHandler. More... | |
virtual | ~CEventHandler () |
virtual void | AddListener (CEventHandler *listener, int pool_name=ePool_Default) |
Add a listener. More... | |
virtual void | RemoveListener (CEventHandler *listener) |
Remove a listener. More... | |
virtual void | RemoveAllListeners (void) |
virtual bool | HasListener (CEventHandler *listener, int pool_name=ePool_Default) const |
returns "true" if the given listener belongs to the specified pool More... | |
virtual const TListeners * | GetListeners (int pool_name=ePool_Default) const |
returns a set of listeners fro the specified pool More... | |
virtual bool | OnEvent (CEvent *evt) |
Processes en event. Returns "true" if event has been processed. More... | |
virtual bool | Dispatch (CEvent *evt, EDispatch disp_how=eDispatch_Default, int pool_name=ePool_Default) |
Dispatches an event to the listeners (but does not handle it). More... | |
virtual bool | Send (CEvent *evt, EDispatch disp_how=eDispatch_Default, int pool_name=ePool_Default) |
Sends an event synchronously. More... | |
virtual bool | Send (CEvent *evt, int pool_name) |
void | Post (CRef< CEvent > evt, EDispatch disp_how=eDispatch_Default, int pool_name=ePool_Default) |
Handles an event asynchronously (process and/or dispatch). More... | |
Private Types | |
typedef map< string, string > | TTypeHash |
Private Member Functions | |
virtual void | x_OnJobNotification (CEvent *evt) |
void | x_UpdateTypeHash () |
Private Attributes | |
CConstRef< CSerialObject > | m_Object |
CRef< objects::CScope > | m_Scope |
objects::SAnnotSelector | m_Selector |
vector< SFeatureRow > | m_FeatureRows |
CAppJobDispatcher::TJobID | m_ActiveJob |
app job notification and control More... | |
TTypeHash | m_TypeHash |
Additional Inherited Members | |
Static Public Member Functions inherited from CObject | |
static NCBI_XNCBI_EXPORT void | ThrowNullPointerException (void) |
Define method to throw null pointer exception. More... | |
static NCBI_XNCBI_EXPORT void | ThrowNullPointerException (const type_info &type) |
static EAllocFillMode | GetAllocFillMode (void) |
static void | SetAllocFillMode (EAllocFillMode mode) |
static void | SetAllocFillMode (const string &value) |
Set mode from configuration parameter value. More... | |
Static Public Member Functions inherited from CDebugDumpable | |
static void | EnableDebugDump (bool on) |
Static Public Member Functions inherited from CEventHandler | |
static bool | HandlePostRequest () |
static void | ClearPostQueue () |
erases all events from the queue More... | |
static void | DestroyPostQueue () |
Static Public Attributes inherited from CObject | |
static const TCount | eCounterBitsCanBeDeleted = 1 << 0 |
Define possible object states. More... | |
static const TCount | eCounterBitsInPlainHeap = 1 << 1 |
Heap signature was found. More... | |
static const TCount | eCounterBitsPlaceMask |
Mask for 'in heap' state flags. More... | |
static const int | eCounterStep = 1 << 2 |
Skip over the "in heap" bits. More... | |
static const TCount | eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2) |
Minimal value for valid objects (reference counter is zero) Must be a single bit value. More... | |
static const TCount | eCounterStateMask |
Valid object, and object in heap. More... | |
Protected Member Functions inherited from CObject | |
virtual void | DeleteThis (void) |
Virtual method "deleting" this object. More... | |
Protected Member Functions inherited from CWeakObject | |
void | CleanWeakRefs (void) const |
Method cleaning all CWeakRefs referencing at this moment to the object After calling to this method all existing CWeakRefs referencing to the object will return NULL, so it effectively will be equal to deleting the object. More... | |
Protected Member Functions inherited from CwxAbstractTableModel | |
virtual void | x_FireDataChanged () |
virtual void | x_FireStructureChanged () |
virtual void | x_FireRowsInserted (int first_row, int last_row=-1) |
virtual void | x_FireRowsUpdated (int first_row, int last_row=-1) |
virtual void | x_FireRowsDeleted (int first_row, int last_row=-1) |
virtual void | x_FireCellUpdated (int row, int col) |
virtual void | x_FireTableChanged (const CwxTableModelNotice ¬e) |
Protected Member Functions inherited from CEventHandler | |
virtual const SEvtMap * | GetEventMap () const |
void | x_DeclareDead () |
Removes itself unavailable for async event delivery. More... | |
void | x_AddListenerToPool (CEventHandler *listener, int pool_name) |
Protected Attributes inherited from CwxAbstractTableModel | |
list< IwxTableModelListener * > | m_ListenerList |
List of TM Listeners Listeners are just stored, no deletion upon removal. More... | |
Protected Attributes inherited from CEventHandler | |
TPools | m_Pools |
Static Protected Attributes inherited from CEventHandler | |
static const SEvtMap | sm_EvtMap |
CFeatTableDS Data source for Feature Table widget.
Implements TableModel (for CTableControl) and is responsible for loading and updating data asynchronously.
Definition at line 70 of file feat_table_ds.hpp.
|
private |
Definition at line 183 of file feat_table_ds.hpp.
a list of the available column types we can show
Enumerator | |
---|---|
eNum | |
eLabel | |
eType | |
eFrom | |
eTo | |
eLength | |
eStrand | |
eProduct | |
eIntervals | |
eNumColumns | this must be the last entry! |
Definition at line 78 of file feat_table_ds.hpp.
CFeatTableDS::CFeatTableDS | ( | ) |
Definition at line 374 of file feat_table_ds.cpp.
|
virtual |
Definition at line 379 of file feat_table_ds.cpp.
References Clear().
void CFeatTableDS::Clear | ( | void | ) |
Definition at line 453 of file feat_table_ds.cpp.
References ClearCurrentJob(), m_FeatureRows, CwxAbstractTableModel::x_FireDataChanged(), x_NotifyObserversNow(), and x_UpdateTypeHash().
Referenced by ~CFeatTableDS().
void CFeatTableDS::ClearCurrentJob | ( | ) |
Definition at line 427 of file feat_table_ds.cpp.
References CAppJobDispatcher::DeleteJob(), CAppJobException::eEngine_UnknownJob, Error(), CAppJobException::eUnknownJob, CAppJobDispatcher::GetInstance(), LOG_POST, and m_ActiveJob.
CFeatTableDS::DECLARE_EVENT_MAP | ( | ) |
|
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 575 of file feat_table_ds.cpp.
References _ASSERT, CwxAbstractTableModel::GetColumnName(), GetNumColumns(), s_FeatTableColNames, and s_FeatTableNumCols.
|
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 587 of file feat_table_ds.cpp.
References _ASSERT, eFrom, eIntervals, eLabel, eLength, eNum, eProduct, eStrand, eTo, eType, GetNumColumns(), and wxT.
Definition at line 542 of file feat_table_ds.cpp.
References CFeatTableDS::SFeatureRow::feat, GetFeatureRow(), and row.
Referenced by CFeatTableWidget::GetSelection().
const CFeatTableDS::SFeatureRow & CFeatTableDS::GetFeatureRow | ( | size_t | row | ) | const |
Definition at line 534 of file feat_table_ds.cpp.
References _ASSERT, GetNumRows(), m_FeatureRows, and row.
Referenced by GetFeature().
|
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 570 of file feat_table_ds.cpp.
References s_FeatTableNumCols.
Referenced by GetColumnName(), and GetColumnType().
|
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 608 of file feat_table_ds.cpp.
References m_FeatureRows.
Referenced by GetFeatureRow(), GetValueAt(), CFeatTableView::x_RebuildObjectIndex(), and CFeatTableView::x_UpdateStatusMessage().
|
inline |
Definition at line 135 of file feat_table_ds.hpp.
References m_Scope.
Referenced by CFeatTableView::x_RebuildObjectIndex().
|
inline |
Definition at line 133 of file feat_table_ds.hpp.
References m_Selector.
void CFeatTableDS::GetTypeNames | ( | vector< string > & | names | ) | const |
Definition at line 472 of file feat_table_ds.cpp.
References ITERATE, m_TypeHash, and names.
Referenced by CFeatTableWidget::OnFilter().
Implements CwxAbstractTableModel.
Definition at line 613 of file feat_table_ds.cpp.
References _ASSERT, eFrom, eIntervals, eLabel, eLength, eNum, eProduct, eStrand, eTo, eType, GetNumRows(), kEmptyStr, label, m_FeatureRows, row, ToWxString(), and wxT.
void CFeatTableDS::Init | ( | const CSerialObject & | obj, |
objects::CScope & | scope, | ||
const objects::SAnnotSelector * | sel = 0 |
||
) |
Definition at line 384 of file feat_table_ds.cpp.
References CSeq_annot_Base::C_Data::e_Ftable, CSeqFeatData::eSubtype_variation, CSeqUtils::GetAnnotSelector(), m_Object, m_Scope, m_Selector, NULL, CRef< C, Locker >::Reset(), CConstRef< C, Locker >::Reset(), and Update().
Referenced by CwxDemoFeatureTableFrame::LoadAccession(), CwxDemoFeatureTableFrame::LoadFile(), and CFeatTableView::x_PostAttachToProject().
void CFeatTableDS::OnJobNotification | ( | CEvent * | evt | ) |
Definition at line 484 of file feat_table_ds.cpp.
void CFeatTableDS::SetSelector | ( | const objects::SAnnotSelector & | sel | ) |
sets the DataSource-specific filter
Definition at line 404 of file feat_table_ds.cpp.
References m_Selector, and Update().
void CFeatTableDS::Update | ( | void | ) |
reloads data based on current settings
Definition at line 411 of file feat_table_ds.cpp.
References ClearCurrentJob(), Error(), CAppJobDispatcher::GetInstance(), LOG_POST, m_ActiveJob, m_Object, m_Scope, m_Selector, and CAppJobDispatcher::StartJob().
Referenced by Init(), SetSelector(), and CFeatTableWidget::Update().
void CFeatTableDS::x_NotifyObserversNow | ( | ) |
Definition at line 547 of file feat_table_ds.cpp.
References CEventHandler::Send().
Referenced by Clear(), and x_OnJobNotification().
|
privatevirtual |
Definition at line 490 of file feat_table_ds.cpp.
References _ASSERT, IAppJob::eCanceled, IAppJob::eCompleted, IAppJob::eFailed, CRef< C, Locker >::IsNull(), m_ActiveJob, m_FeatureRows, result, CwxAbstractTableModel::x_FireDataChanged(), x_NotifyObserversNow(), and x_UpdateTypeHash().
|
private |
Definition at line 464 of file feat_table_ds.cpp.
References map_checker< Container >::clear(), ITERATE, m_FeatureRows, and m_TypeHash.
Referenced by Clear(), and x_OnJobNotification().
|
private |
app job notification and control
Definition at line 181 of file feat_table_ds.hpp.
Referenced by ClearCurrentJob(), Update(), and x_OnJobNotification().
|
private |
Definition at line 178 of file feat_table_ds.hpp.
Referenced by Clear(), GetFeatureRow(), GetNumRows(), GetValueAt(), x_OnJobNotification(), and x_UpdateTypeHash().
|
private |
Definition at line 172 of file feat_table_ds.hpp.
|
private |
Definition at line 173 of file feat_table_ds.hpp.
Referenced by GetScope(), Init(), and Update().
|
private |
Definition at line 176 of file feat_table_ds.hpp.
Referenced by GetSelector(), Init(), SetSelector(), and Update().
|
private |
Definition at line 184 of file feat_table_ds.hpp.
Referenced by GetTypeNames(), and x_UpdateTypeHash().