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 75 of file seqdb.hpp.

Constructor & Destructor Documentation

virtual CSeqDBIter::~CSeqDBIter ( )
inlinevirtual

Destructor.

Definition at line 78 of file seqdb.hpp.

References x_RetSeq().

CSeqDBIter::CSeqDBIter ( const CSeqDBIter other)

Construct one iterator from another.

Definition at line 844 of file seqdb.cpp.

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

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

Build an iterator (called only from CSeqDB).

Definition at line 833 of file seqdb.cpp.

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

Member Function Documentation

CSeqDBIter::DECLARE_OPERATOR_BOOL ( m_Length!  = -1)

Returns true if the iterator points to a valid sequence.

const char* CSeqDBIter::GetData ( void  )
inline

Get the sequence data for the currently held sequence.

Definition at line 96 of file seqdb.hpp.

References m_Data.

int CSeqDBIter::GetLength ( void  )
inline

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

Definition at line 102 of file seqdb.hpp.

References m_Length.

int CSeqDBIter::GetOID ( )
inline

Get the OID of the currently held sequence.

Definition at line 90 of file seqdb.hpp.

References m_OID.

CSeqDBIter & CSeqDBIter::operator++ ( void  )

Increment operator.

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

Definition at line 872 of file seqdb.cpp.

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

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

Copy one iterator to another.

Definition at line 856 of file seqdb.cpp.

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

void CSeqDBIter::x_GetSeq ( )
inlineprivate

Get data pointer and length for the current sequence.

Definition at line 1552 of file seqdb.hpp.

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

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

void CSeqDBIter::x_RetSeq ( )
inlineprivate

Release hold on current sequence.

Definition at line 1557 of file seqdb.hpp.

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

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

Friends And Related Function Documentation

friend class CSeqDB
friend

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

Definition at line 124 of file seqdb.hpp.

Member Data Documentation

const char* CSeqDBIter::m_Data
private

The sequence data for this OID.

Definition at line 136 of file seqdb.hpp.

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

const CSeqDB* CSeqDBIter::m_DB
private

The CSeqDB object which this object iterates over.

Definition at line 130 of file seqdb.hpp.

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

int CSeqDBIter::m_Length
private

The length of this OID.

Definition at line 139 of file seqdb.hpp.

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

int CSeqDBIter::m_OID
private

The OID this iterator is currently accessing.

Definition at line 133 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 Fri Jun 23 18:28:49 2017 by modify_doxy.py rev. 533848