NCBI C++ ToolKit
|
Search Toolkit Book for CObjectList
CObjectList Data structure representing a list of CObjects with associated Scopes and other optional attributes (strings and numbers) More...
#include <gui/objutils/object_list.hpp>
Classes | |
struct | _CColumn |
Public Types | |
enum | EColumnType { eInvalid = -1 , eObject , eScope , eString , eInteger , eDouble } |
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 CObjectList_Base | |
enum class | E_memberIndex { e__allMandatory = 0 , e_Object } |
typedef CPubmedObject | C_E |
typedef NCBI_NS_STD::list< NCBI_NS_NCBI::CRef< CPubmedObject > > | TObject |
typedef Tparent::CMemberIndex< E_memberIndex, 2 > | TmemberIndex |
typedef NCBI_NS_STD::list< NCBI_NS_NCBI::CRef< C_Data > > | Tdata |
Public Member Functions | |
CObjectList () | |
CObjectList (const CObjectList &ob_list) | |
virtual | ~CObjectList () |
void | Init (TConstScopedObjects &objects) |
initializers More... | |
void | Append (const CObjectList &list) |
adds rows from the given list, the lists must have identical sets of columns More... | |
int | AddRow (CObject *obj, objects::CScope *scope) |
int | AddColumn (EColumnType type, const string &name, int col=-1) |
void | DeleteColumn (int col) |
int | GetNumColumns () const |
access to columns (attribute, indexes) More... | |
EColumnType | GetColumnType (int col) const |
const string & | GetColumnName (int col) const |
int | GetColStartIx () const |
void | SetColStartIx (int ix) |
void | ClearColStartIx () |
int | GetNumRows () const |
CObject * | GetObject (int row) |
access to values (row, column) More... | |
const CObject * | GetObject (int row) const |
void | SetObject (int row, CObject &obj) |
objects::CScope * | GetScope (int row) |
const objects::CScope * | GetScope (int row) const |
void | SetScope (int row, objects::CScope &sc) |
const string & | GetString (int col, int row) const |
void | SetString (int col, int row, const string &val) |
int | GetInteger (int col, int row) const |
void | SetInteger (int col, int row, int val) |
double | GetDouble (int col, int row) const |
void | SetDouble (int col, int row, double val) |
int | GetNumObjectLabels () const |
access to a set of extra columns More... | |
string | GetObjectLabelName (int col) const |
CLabel::ELabelType | GetObjectLabelType (int col) const |
void | SetObjectLabel (int col, const string &name, CLabel::ELabelType type) |
void | AddObjectLabel (const string &name, CLabel::ELabelType type) |
void | RemoveObjectLabel (int col) |
void | ClearRows () |
void | ClearColumns () |
removes all data rows (i.e. objects) More... | |
void | ClearObjectLabels () |
void | Clear () |
CObjectList (void) | |
~CObjectList (void) | |
CObjectList (void) | |
~CObjectList (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 CObjectList_Base | |
CObjectList_Base (void) | |
virtual | ~CObjectList_Base (void) |
DECLARE_INTERNAL_TYPE_INFO () | |
bool | IsSetObject (void) const |
Check if a value has been assigned to Object data member. More... | |
bool | CanGetObject (void) const |
Check if it is safe to call GetObject method. More... | |
void | ResetObject (void) |
Reset Object data member. More... | |
const TObject & | GetObject (void) const |
Get the Object member data. More... | |
TObject & | SetObject (void) |
Assign a value to Object data member. More... | |
virtual void | Reset (void) |
Reset the whole object. More... | |
CObjectList_Base (void) | |
virtual | ~CObjectList_Base (void) |
DECLARE_INTERNAL_TYPE_INFO () | |
bool | IsSet (void) const |
Check if a value has been assigned to data member. More... | |
bool | CanGet (void) const |
Check if it is safe to call Get method. More... | |
void | Reset (void) |
Reset data member. More... | |
const Tdata & | Get (void) const |
Get the member data. More... | |
Tdata & | Set (void) |
Assign a value to data member. More... | |
operator const Tdata & (void) const | |
Conversion operator to 'const Tdata' type. More... | |
operator Tdata & (void) | |
Conversion operator to 'Tdata' type. More... | |
Protected Types | |
typedef vector< _CColumn > | TColumns |
Scopes column, may contain NULLs. More... | |
Protected Member Functions | |
void | x_Init () |
removes all rows and non-standard columns More... | |
void | x_Clear () |
void | x_AssertValidLabel (int col) const |
CObjectList. More... | |
void | x_AssertValidColumn (int col) const |
void | x_AssertValidRow (int row) const |
void | x_AssertValid (int col, int row) const |
Protected Member Functions inherited from CObject | |
virtual void | DeleteThis (void) |
Virtual method "deleting" this object. More... | |
Protected Attributes | |
vector< CRef< CObject > > | m_Objects |
all columns must be of the same size More... | |
vector< CRef< objects::CScope > > | m_Scopes |
Objects column. More... | |
TColumns | m_Columns |
vector< string > | m_ExtraColName |
all columns More... | |
vector< CLabel::ELabelType > | m_ExtraColType |
int | m_StartIx |
Private Types | |
typedef CObjectList_Base | Tparent |
typedef CObjectList_Base | Tparent |
Private Member Functions | |
CObjectList (const CObjectList &value) | |
CObjectList & | operator= (const CObjectList &value) |
CObjectList (const CObjectList &value) | |
CObjectList & | operator= (const CObjectList &value) |
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 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... | |
CObjectList Data structure representing a list of CObjects with associated Scopes and other optional attributes (strings and numbers)
CObjectList –.
Definition at line 61 of file object_list.hpp.
|
protected |
Scopes column, may contain NULLs.
Definition at line 185 of file object_list.hpp.
Enumerator | |
---|---|
eInvalid | |
eObject | |
eScope | |
eString | |
eInteger | |
eDouble |
Definition at line 65 of file object_list.hpp.
|
inline |
Definition at line 84 of file ObjectList.hpp.
CObjectList::CObjectList | ( | const CObjectList & | ob_list | ) |
Definition at line 184 of file object_list.cpp.
References _ASSERT, CObjectList::_CColumn::DoubleVector(), eDouble, eInteger, eString, eUnknown, CObjectList::_CColumn::IntVector(), ITERATE, m_Columns, NCBI_THROW, and CObjectList::_CColumn::StringVector().
|
virtual |
Definition at line 219 of file object_list.cpp.
int CObjectList::AddColumn | ( | EColumnType | type, |
const string & | name, | ||
int | col = -1 |
||
) |
Definition at line 330 of file object_list.cpp.
References _ASSERT, column, eDouble, eInteger, eString, eUnknown, GetNumRows(), m_Columns, NCBI_THROW, ncbi::grid::netcache::search::fields::size, and x_AssertValidColumn().
Referenced by COpenViewManager::DoAsyncConversion(), s_CreateObjList(), CSNPSearchJob::x_SetupColumns(), CComponentSearchJob::x_SetupColumns(), CCpgSearchJob::x_SetupColumns(), CFeatureSearchJob::x_SetupColumns(), COrfSearchJob::x_SetupColumns(), and CSequenceSearchJob::x_SetupColumns().
|
inline |
Definition at line 157 of file object_list.hpp.
References SetObjectLabel().
Referenced by x_Init(), CSNPSearchJob::x_SetupColumns(), CCpgSearchJob::x_SetupColumns(), COrfSearchJob::x_SetupColumns(), CSequenceSearchJob::x_SetupColumns(), and CObjectListWidgetSel::x_SetUpObjectList().
Definition at line 377 of file object_list.cpp.
References _ASSERT, column, eDouble, eInteger, eString, eUnknown, int, m_Columns, m_Objects, m_Scopes, NCBI_THROW, and NON_CONST_ITERATE.
Referenced by COpenViewManager::DoAsyncConversion(), CMAViewManager::DoTransition(), CObjectListWidgetSel::SetObjects(), CComponentSearchJob::x_AddToResults(), CCpgSearchJob::x_AddToResults(), CSequenceSearchJob::x_AddToResults(), COrfSearchJob::x_AddToResults(), CObjectListWidgetSel::x_CopyUniqueObjects(), CNetBLAST_DMSearchJob::x_DoSearch(), CSNPSearchJob::x_DoSearch(), CEntrezSearchJob::x_DoSearch(), CVcfSearchJob::x_DoSearch(), and CObjectListWidgetSel::x_FilterObjectList().
void CObjectList::Append | ( | const CObjectList & | list | ) |
adds rows from the given list, the lists must have identical sets of columns
Definition at line 301 of file object_list.cpp.
References _ASSERT, AppendContainer(), CObjectList::_CColumn::DoubleVector(), eDouble, eInteger, eString, i, CObjectList::_CColumn::IntVector(), m_Columns, m_Objects, m_Scopes, CObjectList::_CColumn::m_Type, and CObjectList::_CColumn::StringVector().
Referenced by CComponentSearchJob::x_AddToResults(), CCpgSearchJob::x_AddToResults(), CSequenceSearchJob::x_AddToResults(), COrfSearchJob::x_AddToResults(), CObjectListWidgetSel::x_GetObjectList(), and CSearchJobBase::x_TransferResults().
void CObjectList::Clear | ( | void | ) |
Definition at line 261 of file object_list.cpp.
References x_Clear().
Referenced by CSearchJobBase::x_PrepareSearch().
|
inline |
Definition at line 130 of file object_list.hpp.
References m_StartIx.
Referenced by x_Clear(), and CObjectListWidgetSel::x_SetUpObjectList().
|
inline |
removes all data rows (i.e. objects)
Definition at line 164 of file object_list.hpp.
References m_Columns.
Referenced by x_Clear().
|
inline |
Definition at line 165 of file object_list.hpp.
References m_ExtraColName, and m_ExtraColType.
Referenced by x_Clear(), CSNPSearchJob::x_SetupColumns(), CCpgSearchJob::x_SetupColumns(), COrfSearchJob::x_SetupColumns(), CSequenceSearchJob::x_SetupColumns(), and CObjectListWidgetSel::x_SetUpObjectList().
void CObjectList::ClearRows | ( | ) |
Definition at line 266 of file object_list.cpp.
References _ASSERT, column, eDouble, eInteger, eString, eUnknown, m_Columns, m_Objects, m_Scopes, NCBI_THROW, and NON_CONST_ITERATE.
Referenced by CComponentSearchJob::x_AddToResults(), CCpgSearchJob::x_AddToResults(), CSequenceSearchJob::x_AddToResults(), COrfSearchJob::x_AddToResults(), x_Clear(), CObjectListWidgetSel::x_FilterDuplicates(), CObjectListWidgetSel::x_FilterObjectList(), and CSearchJobBase::x_TransferResults().
void CObjectList::DeleteColumn | ( | int | col | ) |
Definition at line 369 of file object_list.cpp.
References _ASSERT.
|
inline |
Definition at line 128 of file object_list.hpp.
References m_StartIx.
Referenced by CObjectListTableModel::x_AdjustColToData(), and CObjectListTableModel::x_ColIsLabel().
Definition at line 435 of file object_list.cpp.
References m_Columns, and x_AssertValidColumn().
Referenced by CObjectListTableModel::GetColumnName().
CObjectList::EColumnType CObjectList::GetColumnType | ( | int | col | ) | const |
Definition at line 415 of file object_list.cpp.
References _ASSERT, column, eDouble, eInteger, eInvalid, eString, m_Columns, and x_AssertValidColumn().
Referenced by CObjectListTableModel::GetColumnFormat(), CObjectListTableModel::GetColumnType(), CObjectListTableModel::GetValueAt(), CObjectListWidgetSel::x_CopyUniqueObjects(), and CObjectListWidgetSel::x_FilterObjectList().
Definition at line 529 of file object_list.cpp.
References m_Columns, row, and x_AssertValid().
Referenced by CObjectListTableModel::GetValueAt(), CObjectListWidgetSel::x_CopyUniqueObjects(), and CObjectListWidgetSel::x_FilterObjectList().
Definition at line 513 of file object_list.cpp.
References m_Columns, row, and x_AssertValid().
Referenced by COrfSearchTableModel::GetBackgroundColor(), CObjectListTableModel::GetValueAt(), s_GetMinMaxRows(), CObjectListWidgetSel::x_CopyUniqueObjects(), and CObjectListWidgetSel::x_FilterObjectList().
int CObjectList::GetNumColumns | ( | ) | const |
access to columns (attribute, indexes)
Definition at line 409 of file object_list.cpp.
References m_Columns.
Referenced by CObjectListTableModel::GetNumColumns(), s_GetMinMaxRows(), CObjectListTableModel::x_AdjustColToData(), x_AssertValidColumn(), CObjectListTableModel::x_ColIsLabel(), CObjectListWidgetSel::x_CopyUniqueObjects(), and CObjectListWidgetSel::x_FilterObjectList().
|
inline |
access to a set of extra columns
Definition at line 153 of file object_list.hpp.
References m_ExtraColName.
Referenced by CObjectListTableModel::GetNumExtraColumns(), RemoveObjectLabel(), SetObjectLabel(), and x_AssertValidLabel().
int CObjectList::GetNumRows | ( | ) | const |
Definition at line 443 of file object_list.cpp.
References m_Objects.
Referenced by AddColumn(), CObjectListTableModel::GetNumRows(), CDataMiningPanel::OnSearchFinished(), s_GetMinMaxRows(), CComponentSearchJob::x_AddToResults(), CCpgSearchJob::x_AddToResults(), CSequenceSearchJob::x_AddToResults(), COrfSearchJob::x_AddToResults(), x_AssertValidRow(), CObjectListWidgetSel::x_CopyUniqueObjects(), CObjectListWidgetSel::x_FilterObjectList(), and CObjectListWidgetSel::x_PopulateGroups().
access to values (row, column)
Definition at line 449 of file object_list.cpp.
References m_Objects, row, and x_AssertValidRow().
Referenced by CObjectListTableModel::GetExtraValueAt(), CNetBlastJobTableModel::GetExtraValueAt(), CDocsumTableModel::GetExtraValueAt(), CSNPTableModel::GetExtraValueAt(), CObjectListSelTM::GetExtraValueAt(), CObjectListTableModel::GetImageAlias(), CObjectListTableModel::GetObject(), CObjectListWidgetSel::x_CopyUniqueObjects(), CObjectListWidgetSel::x_FilterObjectList(), and CObjectListWidgetSel::x_PopulateGroups().
Definition at line 465 of file object_list.cpp.
References m_Objects, row, and x_AssertValidRow().
Definition at line 544 of file object_list.cpp.
References m_ExtraColName, and x_AssertValidLabel().
Referenced by CObjectListTableModel::GetExtraColumnName().
CLabel::ELabelType CObjectList::GetObjectLabelType | ( | int | col | ) | const |
Definition at line 551 of file object_list.cpp.
References m_ExtraColType, and x_AssertValidLabel().
Referenced by CObjectListTableModel::GetExtraValueAt().
Definition at line 473 of file object_list.cpp.
References m_Scopes, row, and x_AssertValidRow().
Referenced by CObjectListTableModel::GetExtraValueAt(), CObjectListSelTM::GetExtraValueAt(), CObjectListTableModel::GetImageAlias(), CObjectListTableModel::GetScope(), CObjectListWidgetSel::x_CopyUniqueObjects(), CObjectListWidgetSel::x_FilterObjectList(), and CObjectListWidgetSel::x_PopulateGroups().
Definition at line 481 of file object_list.cpp.
References m_Scopes, row, and x_AssertValidRow().
Definition at line 497 of file object_list.cpp.
References m_Columns, row, and x_AssertValid().
Referenced by CObjectListTableModel::GetValueAt(), CObjectListWidgetSel::x_CopyUniqueObjects(), and CObjectListWidgetSel::x_FilterObjectList().
void CObjectList::Init | ( | TConstScopedObjects & | objects | ) |
initializers
Definition at line 246 of file object_list.cpp.
References CConstRef< C, Locker >::GetPointer(), CRef< C, Locker >::GetPointer(), i, m_Objects, m_Scopes, SConstScopedObject::object, SConstScopedObject::scope, and x_Init().
Referenced by s_CreateObjList(), and CObjectListTableModel::SetObjects().
void CObjectList::RemoveObjectLabel | ( | int | col | ) |
Definition at line 569 of file object_list.cpp.
References GetNumObjectLabels(), m_ExtraColName, and m_ExtraColType.
|
inline |
Definition at line 129 of file object_list.hpp.
References m_StartIx.
Referenced by CObjectListWidgetSel::x_SetUpObjectList().
Definition at line 537 of file object_list.cpp.
References m_Columns, row, val, and x_AssertValid().
Referenced by CObjectListWidgetSel::x_CopyUniqueObjects(), and CObjectListWidgetSel::x_FilterObjectList().
Definition at line 521 of file object_list.cpp.
References m_Columns, row, val, and x_AssertValid().
Referenced by s_CreateObjList(), CCpgSearchJob::x_AddToResults(), CSequenceSearchJob::x_AddToResults(), COrfSearchJob::x_AddToResults(), CObjectListWidgetSel::x_CopyUniqueObjects(), CSNPSearchJob::x_DoSearch(), and CObjectListWidgetSel::x_FilterObjectList().
Definition at line 457 of file object_list.cpp.
References m_Objects, row, and x_AssertValidRow().
void CObjectList::SetObjectLabel | ( | int | col, |
const string & | name, | ||
CLabel::ELabelType | type | ||
) |
Definition at line 559 of file object_list.cpp.
References GetNumObjectLabels(), m_ExtraColName, and m_ExtraColType.
Referenced by AddObjectLabel().
void CObjectList::SetScope | ( | int | row, |
objects::CScope & | sc | ||
) |
Definition at line 489 of file object_list.cpp.
References m_Scopes, row, and x_AssertValidRow().
Definition at line 505 of file object_list.cpp.
References m_Columns, row, val, and x_AssertValid().
Referenced by COpenViewManager::DoAsyncConversion(), CComponentSearchJob::x_AddToResults(), CCpgSearchJob::x_AddToResults(), CSequenceSearchJob::x_AddToResults(), COrfSearchJob::x_AddToResults(), CObjectListWidgetSel::x_CopyUniqueObjects(), CSNPSearchJob::x_DoSearch(), and CObjectListWidgetSel::x_FilterObjectList().
Definition at line 171 of file object_list.cpp.
References row, x_AssertValidColumn(), and x_AssertValidRow().
Referenced by GetDouble(), GetInteger(), GetString(), SetDouble(), SetInteger(), and SetString().
|
inlineprotected |
Definition at line 155 of file object_list.cpp.
References _ASSERT, eUnknown, GetNumColumns(), and NCBI_THROW.
Referenced by AddColumn(), GetColumnName(), GetColumnType(), and x_AssertValid().
|
inlineprotected |
Definition at line 147 of file object_list.cpp.
References _ASSERT, eUnknown, GetNumObjectLabels(), and NCBI_THROW.
Referenced by GetObjectLabelName(), and GetObjectLabelType().
|
inlineprotected |
Definition at line 163 of file object_list.cpp.
References _ASSERT, eUnknown, GetNumRows(), and NCBI_THROW.
Referenced by GetObject(), GetScope(), SetObject(), SetScope(), and x_AssertValid().
|
protected |
Definition at line 224 of file object_list.cpp.
References ClearColStartIx(), ClearColumns(), ClearObjectLabels(), and ClearRows().
|
protected |
removes all rows and non-standard columns
initializers
Definition at line 235 of file object_list.cpp.
References AddObjectLabel(), CLabel::eContent, CLabel::eDescription, CLabel::eType, CLabel::eUserSubtype, CLabel::eUserType, and x_Clear().
Referenced by Init().
|
protected |
Definition at line 186 of file object_list.hpp.
Referenced by AddColumn(), AddRow(), Append(), ClearColumns(), ClearRows(), CObjectList(), GetColumnName(), GetColumnType(), GetDouble(), GetInteger(), GetNumColumns(), GetString(), SetDouble(), SetInteger(), and SetString().
|
protected |
all columns
Definition at line 189 of file object_list.hpp.
Referenced by ClearObjectLabels(), GetNumObjectLabels(), GetObjectLabelName(), RemoveObjectLabel(), and SetObjectLabel().
|
protected |
Definition at line 190 of file object_list.hpp.
Referenced by ClearObjectLabels(), GetObjectLabelType(), RemoveObjectLabel(), and SetObjectLabel().
all columns must be of the same size
Definition at line 182 of file object_list.hpp.
Referenced by AddRow(), Append(), ClearRows(), GetNumRows(), GetObject(), Init(), and SetObject().
|
protected |
Objects column.
Definition at line 183 of file object_list.hpp.
Referenced by AddRow(), Append(), ClearRows(), GetScope(), Init(), and SetScope().
|
protected |
Definition at line 191 of file object_list.hpp.
Referenced by ClearColStartIx(), GetColStartIx(), and SetColStartIx().