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

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>

+ Inheritance diagram for CObjectList:
+ Collaboration diagram for CObjectList:

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< Uint8TCounter
 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 stringGetColumnName (int col) const
 
int GetColStartIx () const
 
void SetColStartIx (int ix)
 
void ClearColStartIx ()
 
int GetNumRows () const
 
CObjectGetObject (int row)
 access to values (row, column) More...
 
const CObjectGetObject (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 stringGetString (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...
 
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 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 TObjectGetObject (void) const
 Get the Object member data. More...
 
TObjectSetObject (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 TdataGet (void) const
 Get the member data. More...
 
TdataSet (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< _CColumnTColumns
 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< stringm_ExtraColName
 all columns More...
 
vector< CLabel::ELabelTypem_ExtraColType
 
int m_StartIx
 

Private Types

typedef CObjectList_Base Tparent
 
typedef CObjectList_Base Tparent
 

Private Member Functions

 CObjectList (const CObjectList &value)
 
CObjectListoperator= (const CObjectList &value)
 
 CObjectList (const CObjectList &value)
 
CObjectListoperator= (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...
 

Detailed Description

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.

Member Typedef Documentation

◆ TColumns

typedef vector<_CColumn> CObjectList::TColumns
protected

Scopes column, may contain NULLs.

Definition at line 185 of file object_list.hpp.

Member Enumeration Documentation

◆ EColumnType

Enumerator
eInvalid 
eObject 
eScope 
eString 
eInteger 
eDouble 

Definition at line 65 of file object_list.hpp.

Constructor & Destructor Documentation

◆ CObjectList() [1/2]

CObjectList::CObjectList ( void  )
inline

Definition at line 84 of file ObjectList.hpp.

◆ CObjectList() [2/2]

CObjectList::CObjectList ( const CObjectList ob_list)

◆ ~CObjectList()

BEGIN_linkout_SCOPE CObjectList::~CObjectList ( void  )
virtual

Definition at line 219 of file object_list.cpp.

Member Function Documentation

◆ AddColumn()

int CObjectList::AddColumn ( EColumnType  type,
const string name,
int  col = -1 
)

◆ AddObjectLabel()

void CObjectList::AddObjectLabel ( const string name,
CLabel::ELabelType  type 
)
inline

◆ AddRow()

int CObjectList::AddRow ( CObject obj,
objects::CScope *  scope 
)

◆ Append()

void CObjectList::Append ( const CObjectList list)

◆ Clear()

void CObjectList::Clear ( void  )

Definition at line 261 of file object_list.cpp.

References x_Clear().

Referenced by CSearchJobBase::x_PrepareSearch().

◆ ClearColStartIx()

void CObjectList::ClearColStartIx ( )
inline

Definition at line 130 of file object_list.hpp.

References m_StartIx.

Referenced by x_Clear(), and CObjectListWidgetSel::x_SetUpObjectList().

◆ ClearColumns()

void CObjectList::ClearColumns ( )
inline

removes all data rows (i.e. objects)

Definition at line 164 of file object_list.hpp.

References m_Columns.

Referenced by x_Clear().

◆ ClearObjectLabels()

void CObjectList::ClearObjectLabels ( )
inline

◆ ClearRows()

void CObjectList::ClearRows ( )

◆ DeleteColumn()

void CObjectList::DeleteColumn ( int  col)

Definition at line 369 of file object_list.cpp.

References _ASSERT.

◆ GetColStartIx()

int CObjectList::GetColStartIx ( ) const
inline

◆ GetColumnName()

const string & CObjectList::GetColumnName ( int  col) const

Definition at line 435 of file object_list.cpp.

References m_Columns, and x_AssertValidColumn().

Referenced by CObjectListTableModel::GetColumnName().

◆ GetColumnType()

CObjectList::EColumnType CObjectList::GetColumnType ( int  col) const

◆ GetDouble()

double CObjectList::GetDouble ( int  col,
int  row 
) const

◆ GetInteger()

int CObjectList::GetInteger ( int  col,
int  row 
) const

◆ GetNumColumns()

int CObjectList::GetNumColumns ( ) const

◆ GetNumObjectLabels()

int CObjectList::GetNumObjectLabels ( ) const
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().

◆ GetNumRows()

int CObjectList::GetNumRows ( ) const

◆ GetObject() [1/2]

CObject * CObjectList::GetObject ( int  row)

◆ GetObject() [2/2]

const CObject * CObjectList::GetObject ( int  row) const

Definition at line 465 of file object_list.cpp.

References m_Objects, row, and x_AssertValidRow().

◆ GetObjectLabelName()

string CObjectList::GetObjectLabelName ( int  col) const

Definition at line 544 of file object_list.cpp.

References m_ExtraColName, and x_AssertValidLabel().

Referenced by CObjectListTableModel::GetExtraColumnName().

◆ GetObjectLabelType()

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

◆ GetScope() [1/2]

CScope * CObjectList::GetScope ( int  row)

◆ GetScope() [2/2]

const CScope * CObjectList::GetScope ( int  row) const

Definition at line 481 of file object_list.cpp.

References m_Scopes, row, and x_AssertValidRow().

◆ GetString()

const string & CObjectList::GetString ( int  col,
int  row 
) const

◆ Init()

void CObjectList::Init ( TConstScopedObjects objects)

◆ RemoveObjectLabel()

void CObjectList::RemoveObjectLabel ( int  col)

Definition at line 569 of file object_list.cpp.

References GetNumObjectLabels(), m_ExtraColName, and m_ExtraColType.

◆ SetColStartIx()

void CObjectList::SetColStartIx ( int  ix)
inline

Definition at line 129 of file object_list.hpp.

References m_StartIx.

Referenced by CObjectListWidgetSel::x_SetUpObjectList().

◆ SetDouble()

void CObjectList::SetDouble ( int  col,
int  row,
double  val 
)

◆ SetInteger()

void CObjectList::SetInteger ( int  col,
int  row,
int  val 
)

◆ SetObject()

void CObjectList::SetObject ( int  row,
CObject obj 
)

Definition at line 457 of file object_list.cpp.

References m_Objects, row, and x_AssertValidRow().

◆ SetObjectLabel()

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

◆ SetScope()

void CObjectList::SetScope ( int  row,
objects::CScope &  sc 
)

Definition at line 489 of file object_list.cpp.

References m_Scopes, row, and x_AssertValidRow().

◆ SetString()

void CObjectList::SetString ( int  col,
int  row,
const string val 
)

◆ x_AssertValid()

void CObjectList::x_AssertValid ( int  col,
int  row 
) const
inlineprotected

◆ x_AssertValidColumn()

void CObjectList::x_AssertValidColumn ( int  col) const
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().

◆ x_AssertValidLabel()

void CObjectList::x_AssertValidLabel ( int  col) const
inlineprotected

CObjectList.

Definition at line 147 of file object_list.cpp.

References _ASSERT, eUnknown, GetNumObjectLabels(), and NCBI_THROW.

Referenced by GetObjectLabelName(), and GetObjectLabelType().

◆ x_AssertValidRow()

void CObjectList::x_AssertValidRow ( int  row) const
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().

◆ x_Clear()

void CObjectList::x_Clear ( )
protected

Definition at line 224 of file object_list.cpp.

References ClearColStartIx(), ClearColumns(), ClearObjectLabels(), and ClearRows().

Referenced by Clear(), and x_Init().

◆ x_Init()

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

Member Data Documentation

◆ m_Columns

TColumns CObjectList::m_Columns
protected

◆ m_ExtraColName

vector<string> CObjectList::m_ExtraColName
protected

◆ m_ExtraColType

vector<CLabel::ELabelType> CObjectList::m_ExtraColType
protected

◆ m_Objects

vector< CRef<CObject> > CObjectList::m_Objects
protected

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

◆ m_Scopes

vector< CRef<objects::CScope> > CObjectList::m_Scopes
protected

Objects column.

Definition at line 183 of file object_list.hpp.

Referenced by AddRow(), Append(), ClearRows(), GetScope(), Init(), and SetScope().

◆ m_StartIx

int CObjectList::m_StartIx
protected

Definition at line 191 of file object_list.hpp.

Referenced by ClearColStartIx(), GetColStartIx(), and SetColStartIx().


The documentation for this class was generated from the following files:
Modified on Sun Apr 21 03:41:44 2024 by modify_doxy.py rev. 669887