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

Search Toolkit Book for CBGZFStream

#include <sra/readers/bam/bgzf.hpp>

+ Collaboration diagram for CBGZFStream:

Public Member Functions

 CBGZFStream ()
 
 CBGZFStream (CBGZFFile &file)
 
 ~CBGZFStream ()
 
void Close ()
 
void Open (CBGZFFile &file)
 
CBGZFBlock::TDataSize GetBlockDataSize () const
 
CBGZFBlock::TFileBlockPos GetBlockFilePos () const
 
CBGZFBlock::TFileBlockPos GetNextBlockFilePos () const
 
bool HaveBytesInBlock () const
 
CBGZFPos GetPos () const
 
CBGZFPos GetNextBlockPos () const
 
CBGZFPos GetSeekPos () const
 
CBGZFPos GetEndPos () const
 
void Seek (CBGZFPos pos, CBGZFPos end_pos=CBGZFPos::GetInvalid())
 
size_t GetNextAvailableBytes ()
 
bool HaveNextAvailableBytes ()
 
bool HaveNextDataBlock ()
 
size_t Read (char *buf, size_t count)
 
const char * Read (size_t count)
 

Private Member Functions

bool x_NextBlock ()
 
const char * x_Read (CBGZFPos::TFileBlockPos file_pos, size_t size, char *buffer)
 
bool x_ReadBlock (CBGZFPos::TFileBlockPos file_pos)
 

Private Attributes

CRef< CBGZFFilem_File
 
CPagedFile::TPage m_Page
 
CBGZFFile::TBlock m_Block
 
CBGZFPos::TByteOffset m_ReadPos
 
CSimpleBufferT< char > m_InReadBuffer
 
CSimpleBufferT< char > m_OutReadBuffer
 
CBGZFPos m_EndPos
 

Detailed Description

Definition at line 366 of file bgzf.hpp.

Constructor & Destructor Documentation

◆ CBGZFStream() [1/2]

CBGZFStream::CBGZFStream ( )

Definition at line 417 of file bgzf.cpp.

◆ CBGZFStream() [2/2]

CBGZFStream::CBGZFStream ( CBGZFFile file)
explicit

Definition at line 424 of file bgzf.cpp.

References file, and Open().

◆ ~CBGZFStream()

CBGZFStream::~CBGZFStream ( )

Definition at line 433 of file bgzf.cpp.

Member Function Documentation

◆ Close()

void CBGZFStream::Close ( void  )

◆ GetBlockDataSize()

CBGZFBlock::TDataSize CBGZFStream::GetBlockDataSize ( ) const
inline

Definition at line 377 of file bgzf.hpp.

References m_Block.

Referenced by GetNextAvailableBytes(), HaveBytesInBlock(), and Seek().

◆ GetBlockFilePos()

CBGZFBlock::TFileBlockPos CBGZFStream::GetBlockFilePos ( ) const
inline

Definition at line 381 of file bgzf.hpp.

References m_Block.

Referenced by GetPos().

◆ GetEndPos()

CBGZFPos CBGZFStream::GetEndPos ( ) const
inline

Definition at line 411 of file bgzf.hpp.

References m_EndPos.

◆ GetNextAvailableBytes()

size_t CBGZFStream::GetNextAvailableBytes ( )

Definition at line 653 of file bgzf.cpp.

References GetBlockDataSize(), m_ReadPos, and x_NextBlock().

Referenced by Read().

◆ GetNextBlockFilePos()

CBGZFBlock::TFileBlockPos CBGZFStream::GetNextBlockFilePos ( ) const
inline

Definition at line 385 of file bgzf.hpp.

References m_Block.

Referenced by GetNextBlockPos(), HaveNextDataBlock(), and x_NextBlock().

◆ GetNextBlockPos()

CBGZFPos CBGZFStream::GetNextBlockPos ( ) const
inline

Definition at line 398 of file bgzf.hpp.

References GetNextBlockFilePos().

Referenced by GetSeekPos().

◆ GetPos()

CBGZFPos CBGZFStream::GetPos ( void  ) const
inline

Definition at line 394 of file bgzf.hpp.

References GetBlockFilePos(), and m_ReadPos.

Referenced by GetSeekPos(), HaveNextAvailableBytes(), and Seek().

◆ GetSeekPos()

CBGZFPos CBGZFStream::GetSeekPos ( ) const
inline

Definition at line 402 of file bgzf.hpp.

References GetNextBlockPos(), GetPos(), and HaveBytesInBlock().

Referenced by CBamHeader::Read().

◆ HaveBytesInBlock()

bool CBGZFStream::HaveBytesInBlock ( ) const
inline

Definition at line 389 of file bgzf.hpp.

References GetBlockDataSize(), and m_ReadPos.

Referenced by GetSeekPos(), HaveNextAvailableBytes(), HaveNextDataBlock(), and Seek().

◆ HaveNextAvailableBytes()

bool CBGZFStream::HaveNextAvailableBytes ( )
inline

Definition at line 421 of file bgzf.hpp.

References GetPos(), HaveBytesInBlock(), HaveNextDataBlock(), and m_EndPos.

Referenced by CBamRawAlignIterator::x_NextAnnot().

◆ HaveNextDataBlock()

bool CBGZFStream::HaveNextDataBlock ( )

Definition at line 663 of file bgzf.cpp.

References _ASSERT, GetNextBlockFilePos(), HaveBytesInBlock(), m_EndPos, and x_NextBlock().

Referenced by HaveNextAvailableBytes().

◆ Open()

void CBGZFStream::Open ( CBGZFFile file)

Definition at line 446 of file bgzf.cpp.

References Close(), file, CBGZFPos::GetInvalid(), m_EndPos, m_File, and CRef< C, Locker >::Reset().

Referenced by CBGZFStream().

◆ Read() [1/2]

size_t CBGZFStream::Read ( char *  buf,
size_t  count 
)

Definition at line 678 of file bgzf.cpp.

References _ASSERT, buf, GetNextAvailableBytes(), m_Block, m_ReadPos, and min().

◆ Read() [2/2]

const char * CBGZFStream::Read ( size_t  count)

◆ Seek()

void CBGZFStream::Seek ( CBGZFPos  pos,
CBGZFPos  end_pos = CBGZFPos::GetInvalid() 
)

◆ x_NextBlock()

bool CBGZFStream::x_NextBlock ( )
private

◆ x_Read()

const char* CBGZFStream::x_Read ( CBGZFPos::TFileBlockPos  file_pos,
size_t  size,
char *  buffer 
)
private

◆ x_ReadBlock()

bool CBGZFStream::x_ReadBlock ( CBGZFPos::TFileBlockPos  file_pos)
private

Member Data Documentation

◆ m_Block

CBGZFFile::TBlock CBGZFStream::m_Block
private

◆ m_EndPos

CBGZFPos CBGZFStream::m_EndPos
private

Definition at line 454 of file bgzf.hpp.

Referenced by GetEndPos(), HaveNextAvailableBytes(), HaveNextDataBlock(), Open(), and Seek().

◆ m_File

CRef<CBGZFFile> CBGZFStream::m_File
private

Definition at line 448 of file bgzf.hpp.

Referenced by Close(), Open(), Seek(), and x_NextBlock().

◆ m_InReadBuffer

CSimpleBufferT<char> CBGZFStream::m_InReadBuffer
private

Definition at line 452 of file bgzf.hpp.

Referenced by Seek(), and x_NextBlock().

◆ m_OutReadBuffer

CSimpleBufferT<char> CBGZFStream::m_OutReadBuffer
private

Definition at line 453 of file bgzf.hpp.

Referenced by Read().

◆ m_Page

CPagedFile::TPage CBGZFStream::m_Page
private

Definition at line 449 of file bgzf.hpp.

Referenced by Close(), Seek(), and x_NextBlock().

◆ m_ReadPos

CBGZFPos::TByteOffset CBGZFStream::m_ReadPos
private

Definition at line 451 of file bgzf.hpp.

Referenced by GetNextAvailableBytes(), GetPos(), HaveBytesInBlock(), Read(), Seek(), and x_NextBlock().


The documentation for this class was generated from the following files:
Modified on Mon Mar 04 05:14:01 2024 by modify_doxy.py rev. 669887