NCBI C++ ToolKit
Public Member Functions | Protected Types | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
CBDB_FC_Condition Class Reference

Search Toolkit Book for CBDB_FC_Condition

Internal class used by CBDB_FileCursor to represent search condition criteries. More...

+ Collaboration diagram for CBDB_FC_Condition:

Public Member Functions

CBDB_BufferManagerGetBuffer ()
 Get field buffer reference (non-const) More...
 
const CBDB_BufferManagerGetBuffer () const
 Get field buffer reference (const) More...
 
unsigned int GetFieldsAssigned () const
 Get number of fields assigned to condition. More...
 
unsigned int IncFieldsAssigned ()
 +1 increment of number of assigned fields. More...
 
bool IsComplete () const
 Return TRUE if all search criteria fileds have been assigned. More...
 
IBDB_FieldConvertGetUnassignedField ()
 Return next unassigned field. More...
 
 ~CBDB_FC_Condition ()
 

Protected Types

enum  EIncompleteVal { eAssignMinVal , eAssignMaxVal }
 

Protected Member Functions

 CBDB_FC_Condition (const CBDB_BufferManager &key_buf, CBDB_FileCursor &cursor)
 Constructor. key_buf - key buffer of the main table. More...
 
void InitUnassignedFields (EIncompleteVal incv)
 Set incomplete (non assigned) fields to min(max) possible values. More...
 
void ResetUnassigned ()
 Set number of assigned fields to zero. More...
 

Private Member Functions

 CBDB_FC_Condition (const CBDB_FC_Condition &)
 
const CBDB_FC_Conditionoperator= (const CBDB_FC_Condition &)
 

Private Attributes

const CBDB_BufferManagerm_KeyBuf
 Reference on "parent file" key buffer. More...
 
CBDB_FileCursorm_Cursor
 Reference on parent cursor. More...
 
CBDB_BufferManager m_Buf
 Field buffer. More...
 
unsigned int m_FieldsAssigned
 Number of fields assigned (for multi-segment) prefix searches. More...
 

Friends

class CBDB_FileCursor
 
class CBDB_ConditionHandle
 

Detailed Description

Internal class used by CBDB_FileCursor to represent search condition criteries.

Definition at line 47 of file bdb_cursor.cpp.

Member Enumeration Documentation

◆ EIncompleteVal

Enumerator
eAssignMinVal 
eAssignMaxVal 

Definition at line 83 of file bdb_cursor.cpp.

Constructor & Destructor Documentation

◆ ~CBDB_FC_Condition()

CBDB_FC_Condition::~CBDB_FC_Condition ( )
inline

Definition at line 80 of file bdb_cursor.cpp.

References DeleteFields(), and m_Buf.

◆ CBDB_FC_Condition() [1/2]

CBDB_FC_Condition::CBDB_FC_Condition ( const CBDB_BufferManager key_buf,
CBDB_FileCursor cursor 
)
inlineprotected

Constructor. key_buf - key buffer of the main table.

Definition at line 90 of file bdb_cursor.cpp.

References CBDB_BufferManager::Construct(), CBDB_BufferManager::DuplicateStructureFrom(), and m_Buf.

◆ CBDB_FC_Condition() [2/2]

CBDB_FC_Condition::CBDB_FC_Condition ( const CBDB_FC_Condition )
private

Member Function Documentation

◆ GetBuffer() [1/2]

CBDB_BufferManager& CBDB_FC_Condition::GetBuffer ( void  )
inline

Get field buffer reference (non-const)

Definition at line 51 of file bdb_cursor.cpp.

References m_Buf.

Referenced by CBDB_FileCursor::Fetch(), CBDB_FileCursor::FetchFirst(), CBDB_FileCursor::TestTo(), and CBDB_FileCursor::x_FetchFirst_Prolog().

◆ GetBuffer() [2/2]

const CBDB_BufferManager& CBDB_FC_Condition::GetBuffer ( void  ) const
inline

Get field buffer reference (const)

Definition at line 53 of file bdb_cursor.cpp.

References m_Buf.

◆ GetFieldsAssigned()

unsigned int CBDB_FC_Condition::GetFieldsAssigned ( ) const
inline

Get number of fields assigned to condition.

Definition at line 56 of file bdb_cursor.cpp.

References m_FieldsAssigned.

Referenced by CBDB_FileCursor::Fetch(), CBDB_FileCursor::FetchFirst(), and IsComplete().

◆ GetUnassignedField()

IBDB_FieldConvert& CBDB_FC_Condition::GetUnassignedField ( )
inline

Return next unassigned field.

Definition at line 74 of file bdb_cursor.cpp.

References _ASSERT, CBDB_BufferManager::FieldCount(), CBDB_FileCursor::GetFieldConvert(), m_Buf, m_Cursor, and m_FieldsAssigned.

Referenced by CBDB_ConditionHandle::operator<<().

◆ IncFieldsAssigned()

unsigned int CBDB_FC_Condition::IncFieldsAssigned ( )
inline

+1 increment of number of assigned fields.

Return new fields count

Definition at line 60 of file bdb_cursor.cpp.

References _ASSERT, CBDB_BufferManager::FieldCount(), m_Buf, m_Cursor, m_FieldsAssigned, and CBDB_FileCursor::ResetFirstFetched().

Referenced by CBDB_ConditionHandle::operator<<().

◆ InitUnassignedFields()

void CBDB_FC_Condition::InitUnassignedFields ( EIncompleteVal  incv)
inlineprotected

Set incomplete (non assigned) fields to min(max) possible values.

Definition at line 101 of file bdb_cursor.cpp.

References eAssignMinVal, CBDB_BufferManager::FieldCount(), m_Buf, m_FieldsAssigned, CBDB_BufferManager::SetMaxVal(), and CBDB_BufferManager::SetMinVal().

Referenced by CBDB_FileCursor::x_FetchFirst_Prolog().

◆ IsComplete()

bool CBDB_FC_Condition::IsComplete ( void  ) const
inline

Return TRUE if all search criteria fileds have been assigned.

Definition at line 68 of file bdb_cursor.cpp.

References CBDB_BufferManager::FieldCount(), GetFieldsAssigned(), and m_KeyBuf.

Referenced by CBDB_FileCursor::FetchFirst(), and CBDB_FileCursor::x_FetchFirst_Prolog().

◆ operator=()

const CBDB_FC_Condition& CBDB_FC_Condition::operator= ( const CBDB_FC_Condition )
private

◆ ResetUnassigned()

void CBDB_FC_Condition::ResetUnassigned ( )
inlineprotected

Set number of assigned fields to zero.

Definition at line 111 of file bdb_cursor.cpp.

References m_FieldsAssigned.

Referenced by CBDB_FileCursor::Fetch(), CBDB_FileCursor::ReOpen(), and CBDB_FileCursor::SetCondition().

Friends And Related Function Documentation

◆ CBDB_ConditionHandle

friend class CBDB_ConditionHandle
friend

Definition at line 133 of file bdb_cursor.cpp.

◆ CBDB_FileCursor

friend class CBDB_FileCursor
friend

Definition at line 132 of file bdb_cursor.cpp.

Member Data Documentation

◆ m_Buf

CBDB_BufferManager CBDB_FC_Condition::m_Buf
private

◆ m_Cursor

CBDB_FileCursor& CBDB_FC_Condition::m_Cursor
private

Reference on parent cursor.

Definition at line 125 of file bdb_cursor.cpp.

Referenced by GetUnassignedField(), and IncFieldsAssigned().

◆ m_FieldsAssigned

unsigned int CBDB_FC_Condition::m_FieldsAssigned
private

Number of fields assigned (for multi-segment) prefix searches.

Definition at line 130 of file bdb_cursor.cpp.

Referenced by GetFieldsAssigned(), GetUnassignedField(), IncFieldsAssigned(), InitUnassignedFields(), and ResetUnassigned().

◆ m_KeyBuf

const CBDB_BufferManager& CBDB_FC_Condition::m_KeyBuf
private

Reference on "parent file" key buffer.

Definition at line 123 of file bdb_cursor.cpp.

Referenced by IsComplete().


The documentation for this class was generated from the following file:
Modified on Wed Sep 04 14:59:08 2024 by modify_doxy.py rev. 669887