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

Search Toolkit Book for CWriteDB_ColumnBuilder

Builder for BlastDb format column files. More...

#include <objtools/blast/seqdb_writer/writedb.hpp>

+ Inheritance diagram for CWriteDB_ColumnBuilder:
+ Collaboration diagram for CWriteDB_ColumnBuilder:

Public Member Functions

 CWriteDB_ColumnBuilder (const string &title, const string &basename, char file_id='a')
 Construct a BlastDb format column. More...
void AddMetaData (const string &key, const string &value)
 Add meta data to the column. More...
 ~CWriteDB_ColumnBuilder ()
 Destructor. More...
void AddBlob (const CBlastDbBlob &blob)
 Add a blob to the column. More...
void Close ()
 Complete and close the column files. More...
void ListFiles (vector< string > &files) const
 List Filenames. More...
- 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

Private Member Functions

 CWriteDB_ColumnBuilder (const CWriteDB_ColumnBuilder &)
 Prevent the copy constructor. More...
CWriteDB_ColumnBuilderoperator= (CWriteDB_ColumnBuilder &)
 Prevent copy assignment. More...

Private Attributes

class CWriteDB_Columnm_Impl
 Implementation object. More...

Additional Inherited Members

- 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...
- 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)
- 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...
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...

Detailed Description

Builder for BlastDb format column files.

This class supports construction of BlastDb format column files outside of BlastDb volumes. To build column files as part of a volume, use CWriteDB's column related methods. This class is an interface to the column file construction functionality, but is intended for data not associated with specific BlastDb volumes. Columns built with CWriteDB::CreateColumn participate in WriteDB's other volume-oriented policies such as volume breaking to enforce file size limits, and compatibility with component file naming conventions for CWriteDB and CSeqDB.

Definition at line 540 of file writedb.hpp.

Constructor & Destructor Documentation

◆ CWriteDB_ColumnBuilder() [1/2]

CWriteDB_ColumnBuilder::CWriteDB_ColumnBuilder ( const string title,
const string basename,
char  file_id = 'a' 

Construct a BlastDb format column.

The `title' string names this column, and can be used to uniquely identify it in cases where the file name must be chosen arbitrarily. This version chooses file extensions using a basic pattern (<name>.x?[ab]) designed to not conflict with columns created by WriteDB as part of a volume. The file_id character must be alphanumeric.

titleInternal name of this column.
basenameColumn filename (minus extension).
file_idIdentifier for this column.

Definition at line 370 of file writedb_column.cpp.

References _ASSERT, basename, isalnum(), and m_Impl.

◆ ~CWriteDB_ColumnBuilder()

CWriteDB_ColumnBuilder::~CWriteDB_ColumnBuilder ( )


Definition at line 395 of file writedb_column.cpp.

References m_Impl.

◆ CWriteDB_ColumnBuilder() [2/2]

CWriteDB_ColumnBuilder::CWriteDB_ColumnBuilder ( const CWriteDB_ColumnBuilder )

Prevent the copy constructor.

Member Function Documentation

◆ AddBlob()

void CWriteDB_ColumnBuilder::AddBlob ( const CBlastDbBlob blob)

Add a blob to the column.

The data described by `blob' is added to the column. If the blob is empty, no data is stored but the OID is incremented.

blobThe blob to add to the column.

Definition at line 405 of file writedb_column.cpp.

References CWriteDB_Column::AddBlob(), and m_Impl.

◆ AddMetaData()

void CWriteDB_ColumnBuilder::AddMetaData ( const string key,
const string value 

Add meta data to the column.

In addition to normal blob data, database columns can store a `dictionary' of user-defined metadata in key/value form. This method adds one such key/value pair to the column. Specifying a key a second time causes replacement of the previous value. Using this mechanism to store large amounts of data may have a negative impact on performance.

keyKey string.
valueValue string.

Definition at line 410 of file writedb_column.cpp.

References CWriteDB_Column::AddMetaData(), ncbi::grid::netcache::search::fields::key, m_Impl, and value.

◆ Close()

void CWriteDB_ColumnBuilder::Close ( void  )

Complete and close the column files.

Definition at line 415 of file writedb_column.cpp.

References CWriteDB_Column::Close(), m_Impl, and CWriteDB_Column::RenameSingle().

◆ ListFiles()

void CWriteDB_ColumnBuilder::ListFiles ( vector< string > &  files) const

List Filenames.

Returns a list of the files constructed by this class; the returned list may not be complete until Close() has been called.

filesThe list of files created for this column.

Definition at line 400 of file writedb_column.cpp.

References CWriteDB_Column::ListFiles(), and m_Impl.

Referenced by s_WrapUpColumn().

◆ operator=()

CWriteDB_ColumnBuilder& CWriteDB_ColumnBuilder::operator= ( CWriteDB_ColumnBuilder )

Prevent copy assignment.

Member Data Documentation

◆ m_Impl

class CWriteDB_Column* CWriteDB_ColumnBuilder::m_Impl

Implementation object.

Definition at line 605 of file writedb.hpp.

Referenced by AddBlob(), AddMetaData(), Close(), CWriteDB_ColumnBuilder(), ListFiles(), and ~CWriteDB_ColumnBuilder().

The documentation for this class was generated from the following files:
Modified on Fri Dec 08 08:23:18 2023 by rev. 669887