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

Search Toolkit Book for CMergeVolumes

Main volume merge algorithm class. More...

#include <algo/volume_merge/volume_merge.hpp>

+ Collaboration diagram for CMergeVolumes:

Public Types

typedef CSimpleBuffer TRawBuffer
 Raw BLOB buffer type used for raw information exchange between merge algorithm interfaces Raw buffers are allocated/deallocated using one central resource pool. More...
 
typedef CResourcePool< TRawBuffer, CFastMutexTBufResourcePool
 Memory manager for raw buffers to avoid unnecessary reallocations and memory fragmentation. More...
 
typedef CResourcePoolGuard< TBufResourcePoolTBufPoolGuard
 Buffer pool guard. More...
 

Public Member Functions

 CMergeVolumes ()
 
 ~CMergeVolumes ()
 
void SetMergeAccumulator (IMergeBlob *merger, EOwnership own=eTakeOwnership)
 Set merge accumulator component. More...
 
void SetVolumes (const vector< IMergeVolumeWalker * > &vol_vector, EOwnership own=eTakeOwnership)
 Set merge volumes. More...
 
void SetMergeStore (IMergeStore *store, EOwnership own=eTakeOwnership)
 Set merge store (destination) More...
 
TBufResourcePoolGetBufResourcePool ()
 Get BLOB buffer pool. More...
 
void Run ()
 Execute merge process (main merge loop) More...
 

Private Member Functions

void x_EvaluateMinKey (unsigned new_key, size_t volume_idx)
 check if volume key is new minimum or equals to old minimum More...
 
void x_ResetMinKey ()
 Reset min. evaluation. More...
 
void x_MergeCandidates ()
 Merge all discovered min key candidates. More...
 
void x_MergeVolume (IMergeVolumeWalker *volume)
 
void x_StoreMerger ()
 

Private Attributes

TBufResourcePool m_BufResourcePool
 
AutoPtr< IMergeBlobm_Merger
 
vector< IMergeVolumeWalker * > m_VolumeVect
 
EOwnership m_OwnVolumeVect
 
AutoPtr< IMergeStorem_Store
 
unsigned m_MergeKey
 key in the merger More...
 
unsigned m_MinKey
 min key value More...
 
vector< size_t > m_MinKeyCandidates
 min-key volumes More...
 

Detailed Description

Main volume merge algorithm class.

Definition at line 56 of file volume_merge.hpp.

Member Typedef Documentation

◆ TBufPoolGuard

Buffer pool guard.

Definition at line 70 of file volume_merge.hpp.

◆ TBufResourcePool

Memory manager for raw buffers to avoid unnecessary reallocations and memory fragmentation.

Definition at line 67 of file volume_merge.hpp.

◆ TRawBuffer

Raw BLOB buffer type used for raw information exchange between merge algorithm interfaces Raw buffers are allocated/deallocated using one central resource pool.

Definition at line 63 of file volume_merge.hpp.

Constructor & Destructor Documentation

◆ CMergeVolumes()

CMergeVolumes::CMergeVolumes ( )

Definition at line 40 of file volume_merge.cpp.

◆ ~CMergeVolumes()

CMergeVolumes::~CMergeVolumes ( )

Definition at line 49 of file volume_merge.cpp.

References eTakeOwnership, i, m_OwnVolumeVect, and m_VolumeVect.

Member Function Documentation

◆ GetBufResourcePool()

TBufResourcePool& CMergeVolumes::GetBufResourcePool ( )
inline

Get BLOB buffer pool.

Definition at line 89 of file volume_merge.hpp.

References m_BufResourcePool.

◆ Run()

void CMergeVolumes::Run ( void  )

◆ SetMergeAccumulator()

void CMergeVolumes::SetMergeAccumulator ( IMergeBlob merger,
EOwnership  own = eTakeOwnership 
)

Set merge accumulator component.

Definition at line 58 of file volume_merge.cpp.

References m_BufResourcePool, m_Merger, AutoPtr< X, Del >::reset(), and IMergeBlob::SetResourcePool().

Referenced by CBDB_MergeTest::Run().

◆ SetMergeStore()

void CMergeVolumes::SetMergeStore ( IMergeStore store,
EOwnership  own = eTakeOwnership 
)

Set merge store (destination)

Definition at line 80 of file volume_merge.cpp.

References m_BufResourcePool, m_Store, AutoPtr< X, Del >::reset(), and IMergeStore::SetResourcePool().

Referenced by CBDB_MergeTest::Run().

◆ SetVolumes()

void CMergeVolumes::SetVolumes ( const vector< IMergeVolumeWalker * > &  vol_vector,
EOwnership  own = eTakeOwnership 
)

Set merge volumes.

Definition at line 67 of file volume_merge.cpp.

References eTakeOwnership, i, m_OwnVolumeVect, and m_VolumeVect.

Referenced by CBDB_MergeTest::Run().

◆ x_EvaluateMinKey()

void CMergeVolumes::x_EvaluateMinKey ( unsigned  new_key,
size_t  volume_idx 
)
private

check if volume key is new minimum or equals to old minimum

Definition at line 298 of file volume_merge.cpp.

References m_MinKey, and m_MinKeyCandidates.

Referenced by Run().

◆ x_MergeCandidates()

void CMergeVolumes::x_MergeCandidates ( )
private

Merge all discovered min key candidates.

Definition at line 288 of file volume_merge.cpp.

References ITERATE, m_MergeKey, m_MinKey, m_MinKeyCandidates, m_VolumeVect, and x_MergeVolume().

Referenced by Run().

◆ x_MergeVolume()

void CMergeVolumes::x_MergeVolume ( IMergeVolumeWalker volume)
private

◆ x_ResetMinKey()

void CMergeVolumes::x_ResetMinKey ( )
private

Reset min. evaluation.

Definition at line 311 of file volume_merge.cpp.

References kMax_UInt, m_MinKey, and m_MinKeyCandidates.

Referenced by Run().

◆ x_StoreMerger()

void CMergeVolumes::x_StoreMerger ( )
private

Member Data Documentation

◆ m_BufResourcePool

TBufResourcePool CMergeVolumes::m_BufResourcePool
private

◆ m_MergeKey

unsigned CMergeVolumes::m_MergeKey
private

key in the merger

Definition at line 110 of file volume_merge.hpp.

Referenced by Run(), x_MergeCandidates(), and x_StoreMerger().

◆ m_Merger

AutoPtr<IMergeBlob> CMergeVolumes::m_Merger
private

Definition at line 105 of file volume_merge.hpp.

Referenced by Run(), SetMergeAccumulator(), x_MergeVolume(), and x_StoreMerger().

◆ m_MinKey

unsigned CMergeVolumes::m_MinKey
private

min key value

Definition at line 111 of file volume_merge.hpp.

Referenced by x_EvaluateMinKey(), x_MergeCandidates(), and x_ResetMinKey().

◆ m_MinKeyCandidates

vector<size_t> CMergeVolumes::m_MinKeyCandidates
private

min-key volumes

Definition at line 112 of file volume_merge.hpp.

Referenced by Run(), x_EvaluateMinKey(), x_MergeCandidates(), and x_ResetMinKey().

◆ m_OwnVolumeVect

EOwnership CMergeVolumes::m_OwnVolumeVect
private

Definition at line 107 of file volume_merge.hpp.

Referenced by SetVolumes(), and ~CMergeVolumes().

◆ m_Store

AutoPtr<IMergeStore> CMergeVolumes::m_Store
private

Definition at line 108 of file volume_merge.hpp.

Referenced by Run(), SetMergeStore(), and x_StoreMerger().

◆ m_VolumeVect

vector<IMergeVolumeWalker*> CMergeVolumes::m_VolumeVect
private

Definition at line 106 of file volume_merge.hpp.

Referenced by Run(), SetVolumes(), x_MergeCandidates(), and ~CMergeVolumes().


The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:58:16 2024 by modify_doxy.py rev. 669887