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

Search Toolkit Book for CSeqDBIter

CSeqDBIter. More...

#include <objtools/blast/seqdb_reader/seqdb.hpp>

+ Collaboration diagram for CSeqDBIter:

Public Member Functions

virtual ~CSeqDBIter ()
 Destructor. More...
 
CSeqDBIteroperator++ ()
 Increment operator. More...
 
int GetOID ()
 Get the OID of the currently held sequence. More...
 
const char * GetData ()
 Get the sequence data for the currently held sequence. More...
 
int GetLength ()
 Get the length (in base pairs) of the currently held sequence. More...
 
 DECLARE_OPERATOR_BOOL (m_Length !=-1)
 Returns true if the iterator points to a valid sequence. More...
 
 CSeqDBIter (const CSeqDBIter &)
 Construct one iterator from another. More...
 
CSeqDBIteroperator= (const CSeqDBIter &)
 Copy one iterator to another. More...
 

Private Member Functions

void x_GetSeq ()
 Get data pointer and length for the current sequence. More...
 
void x_RetSeq ()
 Release hold on current sequence. More...
 
 CSeqDBIter (const CSeqDB *, int oid)
 Build an iterator (called only from CSeqDB). More...
 

Private Attributes

const CSeqDBm_DB
 The CSeqDB object which this object iterates over. More...
 
int m_OID
 The OID this iterator is currently accessing. More...
 
const char * m_Data
 The sequence data for this OID. More...
 
int m_Length
 The length of this OID. More...
 

Friends

class CSeqDB
 CSeqDB is a friend so it alone can create objects of this type. More...
 

Detailed Description

CSeqDBIter.

Small class to iterate over a seqdb database.

This serves something of the same role for a CSeqDB object that a vector iterator might serve in the standard template library.

Definition at line 77 of file seqdb.hpp.

Constructor & Destructor Documentation

◆ ~CSeqDBIter()

virtual CSeqDBIter::~CSeqDBIter ( )
inlinevirtual

Destructor.

Definition at line 80 of file seqdb.hpp.

References x_RetSeq().

◆ CSeqDBIter() [1/2]

CSeqDBIter::CSeqDBIter ( const CSeqDBIter other)

Construct one iterator from another.

Definition at line 943 of file seqdb.cpp.

References CSeqDB::CheckOrFindOID(), m_DB, m_OID, and x_GetSeq().

◆ CSeqDBIter() [2/2]

CSeqDBIter::CSeqDBIter ( const CSeqDB db,
int  oid 
)
private

Build an iterator (called only from CSeqDB).

Definition at line 932 of file seqdb.cpp.

References CSeqDB::CheckOrFindOID(), m_DB, m_OID, and x_GetSeq().

Member Function Documentation

◆ DECLARE_OPERATOR_BOOL()

CSeqDBIter::DECLARE_OPERATOR_BOOL ( m_Length = -1)

Returns true if the iterator points to a valid sequence.

◆ GetData()

const char* CSeqDBIter::GetData ( void  )
inline

Get the sequence data for the currently held sequence.

Definition at line 98 of file seqdb.hpp.

References m_Data.

◆ GetLength()

int CSeqDBIter::GetLength ( void  )
inline

Get the length (in base pairs) of the currently held sequence.

Definition at line 104 of file seqdb.hpp.

References m_Length.

◆ GetOID()

int CSeqDBIter::GetOID ( )
inline

Get the OID of the currently held sequence.

Definition at line 92 of file seqdb.hpp.

References m_OID.

◆ operator++()

CSeqDBIter & CSeqDBIter::operator++ ( void  )

Increment operator.

Returns the currently held sequence and gets pointers to the next sequence.

Definition at line 971 of file seqdb.cpp.

References CSeqDB::CheckOrFindOID(), m_DB, m_Length, m_OID, x_GetSeq(), and x_RetSeq().

◆ operator=()

CSeqDBIter & CSeqDBIter::operator= ( const CSeqDBIter other)

Copy one iterator to another.

Definition at line 955 of file seqdb.cpp.

References CSeqDB::CheckOrFindOID(), m_Data, m_DB, m_Length, m_OID, x_GetSeq(), and x_RetSeq().

◆ x_GetSeq()

void CSeqDBIter::x_GetSeq ( )
inlineprivate

Get data pointer and length for the current sequence.

Definition at line 1649 of file seqdb.hpp.

References CSeqDB::GetSequence(), m_Data, m_DB, m_Length, and m_OID.

Referenced by CSeqDBIter(), operator++(), and operator=().

◆ x_RetSeq()

void CSeqDBIter::x_RetSeq ( )
inlineprivate

Release hold on current sequence.

Definition at line 1654 of file seqdb.hpp.

References m_Data, m_DB, and CSeqDB::RetSequence().

Referenced by operator++(), operator=(), and ~CSeqDBIter().

Friends And Related Function Documentation

◆ CSeqDB

friend class CSeqDB
friend

CSeqDB is a friend so it alone can create objects of this type.

Definition at line 126 of file seqdb.hpp.

Member Data Documentation

◆ m_Data

const char* CSeqDBIter::m_Data
private

The sequence data for this OID.

Definition at line 138 of file seqdb.hpp.

Referenced by GetData(), operator=(), x_GetSeq(), and x_RetSeq().

◆ m_DB

const CSeqDB* CSeqDBIter::m_DB
private

The CSeqDB object which this object iterates over.

Definition at line 132 of file seqdb.hpp.

Referenced by CSeqDBIter(), operator++(), operator=(), x_GetSeq(), and x_RetSeq().

◆ m_Length

int CSeqDBIter::m_Length
private

The length of this OID.

Definition at line 141 of file seqdb.hpp.

Referenced by GetLength(), operator++(), operator=(), and x_GetSeq().

◆ m_OID

int CSeqDBIter::m_OID
private

The OID this iterator is currently accessing.

Definition at line 135 of file seqdb.hpp.

Referenced by CSeqDBIter(), GetOID(), operator++(), operator=(), and x_GetSeq().


The documentation for this class was generated from the following files:
Modified on Mon Jun 24 05:27:08 2024 by modify_doxy.py rev. 669887