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

Search Toolkit Book for CHugeAsnReader

#include <objtools/huge_asn/huge_asn_reader.hpp>

+ Inheritance diagram for CHugeAsnReader:
+ Collaboration diagram for CHugeAsnReader:

Classes

struct  TBioseqInfo
 
struct  TBioseqInfoRec
 
struct  TBioseqSetInfo
 
struct  TContext
 

Public Types

enum class  eAddTopEntry { yes , no }
 
using TFileSize = std::streamoff
 
using TBioseqSetList = std::list< TBioseqSetInfo >
 
using TBioseqList = std::list< TBioseqInfo >
 
using CRefLess = PPtrLess< CConstRef< CSeq_id > >
 
using TBioseqIndex = std::map< CConstRef< CSeq_id >, TBioseqList::const_iterator, CRefLess >
 
using TBioseqSetIndex = std::map< CConstRef< CSeq_id >, TBioseqSetList::const_iterator, CRefLess >
 
using t_more_hooks = std::function< void(CObjectIStream &)>
 
- 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 Member Functions

 CHugeAsnReader ()
 
 CHugeAsnReader (CHugeFile *file, ILineErrorListener *pMessageListener)
 
virtual ~CHugeAsnReader ()
 
void Open (CHugeFile *file, ILineErrorListener *pMessageListener) override
 
bool GetNextBlob () override
 
CRef< CSeq_entryGetNextSeqEntry () override
 
CConstRef< CSubmit_blockGetSubmitBlock () const override
 
CRef< CSerialObjectReadAny ()
 
auto & GetBioseqs () const
 
auto & GetBiosets () const
 
auto GetFormat () const
 
auto GetMaxLocalId () const
 
const TBioseqSetInfoFindTopObject (CConstRef< CSeq_id > seqid) const
 
virtual CRef< CSeq_entryLoadSeqEntry (const TBioseqSetInfo &info, eAddTopEntry add_top_entry=eAddTopEntry::yes) const
 
const TBioseqInfoFindBioseq (CConstRef< CSeq_id > seqid) const
 
CConstRef< CSeqdescGetClosestDescriptor (const TBioseqInfo &info, CSeqdesc::E_Choice choice) const
 
CConstRef< CSeqdescGetClosestDescriptor (const CSeq_id &id, CSeqdesc::E_Choice choice) const
 
CRef< CSeq_entryLoadSeqEntry (CConstRef< CSeq_id > seqid) const
 
CRef< CBioseqLoadBioseq (CConstRef< CSeq_id > seqid) const
 
bool IsMultiSequence () const override
 
bool HasHugeSetAnnot () const
 
virtual void FlattenGenbankSet ()
 
auto & GetTopEntry () const
 
auto & GetFlattenedIndex () const
 
auto & GetTopIds () const
 
unique_ptr< CObjectIStreamMakeObjStream (TFileSize pos) const
 
const CBioseq_set::TClassGetTopLevelClass () const
 
void ExtendReadHooks (t_more_hooks hooks)
 
void ResetTopEntry ()
 
- Public Member Functions inherited from IHugeAsnSource
virtual ~IHugeAsnSource ()
 
- 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
 

Static Public Member Functions

static bool IsHugeSet (CBioseq_set::TClass setClass)
 
- 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)
 

Protected Types

using TStreamPos = streampos
 

Protected Member Functions

virtual void x_SetHooks (CObjectIStream &objStream, TContext &context)
 
virtual void x_SetFeatIdHooks (CObjectIStream &objStream, TContext &context)
 
virtual void x_SetBioseqHooks (CObjectIStream &objStream, TContext &context)
 
virtual void x_SetBioseqSetHooks (CObjectIStream &objStream, TContext &context)
 
TStreamPos GetCurrentPos () const
 
- Protected Member Functions inherited from IHugeAsnSource
 IHugeAsnSource ()
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 

Protected Attributes

TBioseqList m_bioseq_list
 
TStreamPos m_next_pos = 0
 
int m_max_local_id = 0
 
TBioseqSetList m_bioseq_set_list
 
CRef< CSeq_entrym_top_entry
 
std::list< CConstRef< CSeq_id > > m_top_ids
 
bool m_HasHugeSetAnnot { false }
 

Private Member Functions

void x_ResetIndex ()
 
void x_IndexNextAsn1 ()
 
void x_ThrowDuplicateId (const TBioseqSetInfo &existingInfo, const TBioseqSetInfo &newInfo, const CSeq_id &duplicateId)
 
CRef< CSeq_descrx_GetTopLevelDescriptors () const
 
bool x_HasNestedGenbankSets () const
 

Private Attributes

ILineErrorListenermp_MessageListener = nullptr
 
TStreamPos m_current_pos = 0
 
CRef< CHugeFilem_file
 
std::list< t_more_hooksm_more_hooks
 
CConstRef< CSubmit_blockm_submit_block
 
TBioseqIndex m_bioseq_index
 
TBioseqSetIndex m_FlattenedIndex
 
TBioseqSetList m_FlattenedSets
 
TBioseqSetList::const_iterator m_Current
 
const CBioseq_set::TClassm_pTopLevelClass { nullptr }
 

Additional Inherited Members

- 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

Definition at line 61 of file huge_asn_reader.hpp.

Member Typedef Documentation

◆ CRefLess

Definition at line 104 of file huge_asn_reader.hpp.

◆ t_more_hooks

using CHugeAsnReader::t_more_hooks = std::function<void(CObjectIStream&)>

Definition at line 141 of file huge_asn_reader.hpp.

◆ TBioseqIndex

using CHugeAsnReader::TBioseqIndex = std::map<CConstRef<CSeq_id>, TBioseqList::const_iterator, CRefLess>

Definition at line 106 of file huge_asn_reader.hpp.

◆ TBioseqList

Definition at line 81 of file huge_asn_reader.hpp.

◆ TBioseqSetIndex

using CHugeAsnReader::TBioseqSetIndex = std::map<CConstRef<CSeq_id>, TBioseqSetList::const_iterator, CRefLess>

Definition at line 107 of file huge_asn_reader.hpp.

◆ TBioseqSetList

Definition at line 80 of file huge_asn_reader.hpp.

◆ TFileSize

using CHugeAsnReader::TFileSize = std::streamoff

Definition at line 66 of file huge_asn_reader.hpp.

◆ TStreamPos

using CHugeAsnReader::TStreamPos = streampos
protected

Definition at line 167 of file huge_asn_reader.hpp.

Member Enumeration Documentation

◆ eAddTopEntry

Enumerator
yes 
no 

Definition at line 117 of file huge_asn_reader.hpp.

Constructor & Destructor Documentation

◆ CHugeAsnReader() [1/2]

CHugeAsnReader::CHugeAsnReader ( )

Definition at line 58 of file huge_asn_reader.cpp.

◆ CHugeAsnReader() [2/2]

CHugeAsnReader::CHugeAsnReader ( CHugeFile file,
ILineErrorListener pMessageListener 
)

Definition at line 62 of file huge_asn_reader.cpp.

References file, and Open().

◆ ~CHugeAsnReader()

CHugeAsnReader::~CHugeAsnReader ( )
virtual

Definition at line 54 of file huge_asn_reader.cpp.

Member Function Documentation

◆ ExtendReadHooks()

void CHugeAsnReader::ExtendReadHooks ( t_more_hooks  hooks)

Definition at line 331 of file huge_asn_reader.cpp.

References m_more_hooks.

◆ FindBioseq()

const CHugeAsnReader::TBioseqInfo * CHugeAsnReader::FindBioseq ( CConstRef< CSeq_id seqid) const

◆ FindTopObject()

const CHugeAsnReader::TBioseqSetInfo * CHugeAsnReader::FindTopObject ( CConstRef< CSeq_id seqid) const

Definition at line 107 of file huge_asn_reader.cpp.

References m_FlattenedIndex.

Referenced by CHugeAsnDataLoader::GetBlobId(), and LoadSeqEntry().

◆ FlattenGenbankSet()

void CHugeAsnReader::FlattenGenbankSet ( )
virtual

◆ GetBioseqs()

auto& CHugeAsnReader::GetBioseqs ( void  ) const
inline

Definition at line 109 of file huge_asn_reader.hpp.

Referenced by g_GetHugeSetIdString().

◆ GetBiosets()

auto& CHugeAsnReader::GetBiosets ( ) const
inline

◆ GetClosestDescriptor() [1/2]

CConstRef< CSeqdesc > CHugeAsnReader::GetClosestDescriptor ( const CSeq_id id,
CSeqdesc::E_Choice  choice 
) const

Definition at line 175 of file huge_asn_reader.cpp.

References FindBioseq(), and GetClosestDescriptor().

◆ GetClosestDescriptor() [2/2]

CConstRef< CSeqdesc > CHugeAsnReader::GetClosestDescriptor ( const TBioseqInfo info,
CSeqdesc::E_Choice  choice 
) const

Definition at line 149 of file huge_asn_reader.cpp.

References info, m_bioseq_set_list, result, and s_GetDescriptor().

Referenced by GetClosestDescriptor(), and s_IsWGS().

◆ GetCurrentPos()

CHugeAsnReader::TStreamPos CHugeAsnReader::GetCurrentPos ( ) const
protected

Definition at line 467 of file huge_asn_reader.cpp.

References m_current_pos.

◆ GetFlattenedIndex()

auto& CHugeAsnReader::GetFlattenedIndex ( ) const
inline

Definition at line 135 of file huge_asn_reader.hpp.

◆ GetFormat()

auto CHugeAsnReader::GetFormat ( void  ) const
inline

Definition at line 111 of file huge_asn_reader.hpp.

◆ GetMaxLocalId()

auto CHugeAsnReader::GetMaxLocalId ( ) const
inline

Definition at line 112 of file huge_asn_reader.hpp.

◆ GetNextBlob()

bool CHugeAsnReader::GetNextBlob ( )
overridevirtual

◆ GetNextSeqEntry()

CRef< CSeq_entry > CHugeAsnReader::GetNextSeqEntry ( )
overridevirtual

Implements IHugeAsnSource.

Definition at line 644 of file huge_asn_reader.cpp.

References LoadSeqEntry(), m_Current, m_FlattenedSets, no, x_HasNestedGenbankSets(), and yes.

Referenced by CHugeFileProcess::Read().

◆ GetSubmitBlock()

CConstRef< CSubmit_block > CHugeAsnReader::GetSubmitBlock ( void  ) const
overridevirtual

Implements IHugeAsnSource.

Definition at line 639 of file huge_asn_reader.cpp.

References m_submit_block.

Referenced by FlattenGenbankSet(), and CHugeFileProcess::Read().

◆ GetTopEntry()

auto& CHugeAsnReader::GetTopEntry ( ) const
inline

Definition at line 134 of file huge_asn_reader.hpp.

Referenced by CHugeFileProcess::Read().

◆ GetTopIds()

auto& CHugeAsnReader::GetTopIds ( ) const
inline

Definition at line 136 of file huge_asn_reader.hpp.

Referenced by CHugeFileProcess::Read().

◆ GetTopLevelClass()

const CBioseq_set::TClass * CHugeAsnReader::GetTopLevelClass ( ) const

Definition at line 497 of file huge_asn_reader.cpp.

References m_pTopLevelClass.

Referenced by s_x_ReportMissingPubs().

◆ HasHugeSetAnnot()

bool CHugeAsnReader::HasHugeSetAnnot ( ) const
inline

Definition at line 129 of file huge_asn_reader.hpp.

◆ IsHugeSet()

bool CHugeAsnReader::IsHugeSet ( CBioseq_set::TClass  setClass)
static

◆ IsMultiSequence()

bool CHugeAsnReader::IsMultiSequence ( ) const
overridevirtual

Implements IHugeAsnSource.

Definition at line 101 of file huge_asn_reader.cpp.

References m_FlattenedSets.

◆ LoadBioseq()

CRef< CBioseq > CHugeAsnReader::LoadBioseq ( CConstRef< CSeq_id seqid) const

◆ LoadSeqEntry() [1/2]

CRef< CSeq_entry > CHugeAsnReader::LoadSeqEntry ( CConstRef< CSeq_id seqid) const

Definition at line 186 of file huge_asn_reader.cpp.

References FindTopObject(), info, and LoadSeqEntry().

◆ LoadSeqEntry() [2/2]

CRef< CSeq_entry > CHugeAsnReader::LoadSeqEntry ( const TBioseqSetInfo info,
eAddTopEntry  add_top_entry = eAddTopEntry::yes 
) const
virtual

◆ MakeObjStream()

unique_ptr< CObjectIStream > CHugeAsnReader::MakeObjStream ( TFileSize  pos) const

Definition at line 230 of file huge_asn_reader.cpp.

References m_file, and CHugeFile::MakeObjStream().

◆ Open()

void CHugeAsnReader::Open ( CHugeFile file,
ILineErrorListener pMessageListener 
)
overridevirtual

◆ ReadAny()

CRef< CSerialObject > CHugeAsnReader::ReadAny ( )

◆ ResetTopEntry()

void CHugeAsnReader::ResetTopEntry ( )

Definition at line 419 of file huge_asn_reader.cpp.

References m_top_entry, and CRef< C, Locker >::Reset().

◆ x_GetTopLevelDescriptors()

CRef< CSeq_descr > CHugeAsnReader::x_GetTopLevelDescriptors ( ) const
private

◆ x_HasNestedGenbankSets()

bool CHugeAsnReader::x_HasNestedGenbankSets ( ) const
private

◆ x_IndexNextAsn1()

void CHugeAsnReader::x_IndexNextAsn1 ( )
private

◆ x_ResetIndex()

void CHugeAsnReader::x_ResetIndex ( )
private

◆ x_SetBioseqHooks()

void CHugeAsnReader::x_SetBioseqHooks ( CObjectIStream objStream,
CHugeAsnReader::TContext context 
)
protectedvirtual

Definition at line 336 of file huge_asn_reader.cpp.

References context, in(), m_bioseq_list, m_next_pos, and SetLocalSkipHook().

Referenced by x_SetHooks().

◆ x_SetBioseqSetHooks()

void CHugeAsnReader::x_SetBioseqSetHooks ( CObjectIStream objStream,
CHugeAsnReader::TContext context 
)
protectedvirtual

◆ x_SetFeatIdHooks()

void CHugeAsnReader::x_SetFeatIdHooks ( CObjectIStream objStream,
CHugeAsnReader::TContext context 
)
protectedvirtual

◆ x_SetHooks()

void CHugeAsnReader::x_SetHooks ( CObjectIStream objStream,
CHugeAsnReader::TContext context 
)
protectedvirtual

◆ x_ThrowDuplicateId()

void CHugeAsnReader::x_ThrowDuplicateId ( const TBioseqSetInfo existingInfo,
const TBioseqSetInfo newInfo,
const CSeq_id duplicateId 
)
private

Member Data Documentation

◆ m_bioseq_index

TBioseqIndex CHugeAsnReader::m_bioseq_index
private

Definition at line 199 of file huge_asn_reader.hpp.

Referenced by FindBioseq(), FlattenGenbankSet(), LoadBioseq(), and x_ResetIndex().

◆ m_bioseq_list

TBioseqList CHugeAsnReader::m_bioseq_list
protected

Definition at line 188 of file huge_asn_reader.hpp.

Referenced by FlattenGenbankSet(), x_ResetIndex(), and x_SetBioseqHooks().

◆ m_bioseq_set_list

TBioseqSetList CHugeAsnReader::m_bioseq_set_list
protected

◆ m_Current

TBioseqSetList::const_iterator CHugeAsnReader::m_Current
private

Definition at line 202 of file huge_asn_reader.hpp.

Referenced by FlattenGenbankSet(), GetNextSeqEntry(), and x_ResetIndex().

◆ m_current_pos

TStreamPos CHugeAsnReader::m_current_pos = 0
private

Definition at line 182 of file huge_asn_reader.hpp.

Referenced by GetCurrentPos(), ReadAny(), and x_IndexNextAsn1().

◆ m_file

CRef<CHugeFile> CHugeAsnReader::m_file
private

◆ m_FlattenedIndex

TBioseqSetIndex CHugeAsnReader::m_FlattenedIndex
private

Definition at line 200 of file huge_asn_reader.hpp.

Referenced by FindTopObject(), FlattenGenbankSet(), and x_ResetIndex().

◆ m_FlattenedSets

TBioseqSetList CHugeAsnReader::m_FlattenedSets
private

◆ m_HasHugeSetAnnot

bool CHugeAsnReader::m_HasHugeSetAnnot { false }
protected

Definition at line 194 of file huge_asn_reader.hpp.

Referenced by x_IndexNextAsn1(), and x_SetBioseqSetHooks().

◆ m_max_local_id

int CHugeAsnReader::m_max_local_id = 0
protected

Definition at line 190 of file huge_asn_reader.hpp.

Referenced by x_ResetIndex(), and x_SetFeatIdHooks().

◆ m_more_hooks

std::list<t_more_hooks> CHugeAsnReader::m_more_hooks
private

Definition at line 184 of file huge_asn_reader.hpp.

Referenced by ExtendReadHooks(), and x_SetHooks().

◆ m_next_pos

TStreamPos CHugeAsnReader::m_next_pos = 0
protected

◆ m_pTopLevelClass

const CBioseq_set::TClass* CHugeAsnReader::m_pTopLevelClass { nullptr }
private

Definition at line 203 of file huge_asn_reader.hpp.

Referenced by FlattenGenbankSet(), and GetTopLevelClass().

◆ m_submit_block

CConstRef<CSubmit_block> CHugeAsnReader::m_submit_block
private

Definition at line 196 of file huge_asn_reader.hpp.

Referenced by GetSubmitBlock(), x_ResetIndex(), and x_SetHooks().

◆ m_top_entry

CRef<CSeq_entry> CHugeAsnReader::m_top_entry
protected

Definition at line 192 of file huge_asn_reader.hpp.

Referenced by FlattenGenbankSet(), LoadSeqEntry(), ResetTopEntry(), and x_ResetIndex().

◆ m_top_ids

std::list<CConstRef<CSeq_id> > CHugeAsnReader::m_top_ids
protected

Definition at line 193 of file huge_asn_reader.hpp.

Referenced by FlattenGenbankSet(), and x_ResetIndex().

◆ mp_MessageListener

ILineErrorListener* CHugeAsnReader::mp_MessageListener = nullptr
private

Definition at line 181 of file huge_asn_reader.hpp.

Referenced by Open().


The documentation for this class was generated from the following files:
Modified on Sat Jul 13 13:36:27 2024 by modify_doxy.py rev. 669887