NCBI C++ ToolKit
Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
CFeatTableDS Class Reference

Search Toolkit Book for CFeatTableDS

CFeatTableDS Data source for Feature Table widget. More...

#include <gui/widgets/feat_table/feat_table_ds.hpp>

+ Inheritance diagram for CFeatTableDS:
+ Collaboration diagram for CFeatTableDS:

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< Uint8TCounter
 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, TListenersTPools
 
typedef list< AutoPtr< SPostRequest > > TPostRequests
 
typedef std::map< CEventHandler *, intTHandlerToCount
 
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 SFeatureRowGetFeatureRow (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...
 
CObjectoperator= (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)
 
CPtrToObjectProxyGetPtrProxy (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< IwxStringFormatGetColumnFormat (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 TListenersGetListeners (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, stringTTypeHash
 

Private Member Functions

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

Private Attributes

CConstRef< CSerialObjectm_Object
 
CRef< objects::CScope > m_Scope
 
objects::SAnnotSelector m_Selector
 
vector< SFeatureRowm_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 &note)
 
- Protected Member Functions inherited from CEventHandler
virtual const SEvtMapGetEventMap () 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
 

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 70 of file feat_table_ds.hpp.

Member Typedef Documentation

◆ TTypeHash

Definition at line 183 of file feat_table_ds.hpp.

Member Enumeration Documentation

◆ EColumns

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.

Constructor & Destructor Documentation

◆ CFeatTableDS()

CFeatTableDS::CFeatTableDS ( )

Definition at line 374 of file feat_table_ds.cpp.

◆ ~CFeatTableDS()

CFeatTableDS::~CFeatTableDS ( )
virtual

Definition at line 379 of file feat_table_ds.cpp.

References Clear().

Member Function Documentation

◆ Clear()

void CFeatTableDS::Clear ( void  )

◆ ClearCurrentJob()

void CFeatTableDS::ClearCurrentJob ( )

◆ DECLARE_EVENT_MAP()

CFeatTableDS::DECLARE_EVENT_MAP ( )

◆ GetColumnName()

wxString CFeatTableDS::GetColumnName ( int  col_idx) 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 575 of file feat_table_ds.cpp.

References _ASSERT, CwxAbstractTableModel::GetColumnName(), GetNumColumns(), s_FeatTableColNames, and s_FeatTableNumCols.

◆ GetColumnType()

wxString CFeatTableDS::GetColumnType ( int  col_idx) 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 587 of file feat_table_ds.cpp.

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

◆ GetFeature()

const CSeq_feat & CFeatTableDS::GetFeature ( size_t  row) const

Definition at line 542 of file feat_table_ds.cpp.

References CFeatTableDS::SFeatureRow::feat, GetFeatureRow(), and row.

Referenced by CFeatTableWidget::GetSelection().

◆ GetFeatureRow()

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().

◆ GetNumColumns()

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 570 of file feat_table_ds.cpp.

References s_FeatTableNumCols.

Referenced by GetColumnName(), and GetColumnType().

◆ GetNumRows()

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 608 of file feat_table_ds.cpp.

References m_FeatureRows.

Referenced by GetFeatureRow(), GetValueAt(), CFeatTableView::x_RebuildObjectIndex(), and CFeatTableView::x_UpdateStatusMessage().

◆ GetScope()

CRef<objects::CScope> CFeatTableDS::GetScope ( void  ) const
inline

Definition at line 135 of file feat_table_ds.hpp.

References m_Scope.

Referenced by CFeatTableView::x_RebuildObjectIndex().

◆ GetSelector()

objects::SAnnotSelector CFeatTableDS::GetSelector ( ) const
inline

Definition at line 133 of file feat_table_ds.hpp.

References m_Selector.

◆ GetTypeNames()

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().

◆ GetValueAt()

wxVariant CFeatTableDS::GetValueAt ( int  row,
int  col 
) const
virtual

◆ Init()

void CFeatTableDS::Init ( const CSerialObject obj,
objects::CScope &  scope,
const objects::SAnnotSelector *  sel = 0 
)

◆ OnJobNotification()

void CFeatTableDS::OnJobNotification ( CEvent evt)

Definition at line 484 of file feat_table_ds.cpp.

◆ SetSelector()

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().

◆ Update()

void CFeatTableDS::Update ( void  )

◆ x_NotifyObserversNow()

void CFeatTableDS::x_NotifyObserversNow ( )

Definition at line 547 of file feat_table_ds.cpp.

References CEventHandler::Send().

Referenced by Clear(), and x_OnJobNotification().

◆ x_OnJobNotification()

void CFeatTableDS::x_OnJobNotification ( CEvent evt)
privatevirtual

◆ x_UpdateTypeHash()

void CFeatTableDS::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().

Member Data Documentation

◆ m_ActiveJob

CAppJobDispatcher::TJobID CFeatTableDS::m_ActiveJob
private

app job notification and control

Definition at line 181 of file feat_table_ds.hpp.

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

◆ m_FeatureRows

vector<SFeatureRow> CFeatTableDS::m_FeatureRows
private

◆ m_Object

CConstRef<CSerialObject> CFeatTableDS::m_Object
private

Definition at line 172 of file feat_table_ds.hpp.

Referenced by Init(), and Update().

◆ m_Scope

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

Definition at line 173 of file feat_table_ds.hpp.

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

◆ m_Selector

objects::SAnnotSelector CFeatTableDS::m_Selector
private

Definition at line 176 of file feat_table_ds.hpp.

Referenced by GetSelector(), Init(), SetSelector(), and Update().

◆ m_TypeHash

TTypeHash CFeatTableDS::m_TypeHash
private

Definition at line 184 of file feat_table_ds.hpp.

Referenced by GetTypeNames(), and x_UpdateTypeHash().


The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:57:34 2024 by modify_doxy.py rev. 669887