NCBI C++ ToolKit
|
Search Toolkit Book for CWriteDB_ColumnBuilder
Builder for BlastDb format column files. More...
#include <objtools/blast/seqdb_writer/writedb.hpp>
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... | |
![]() | |
CObject (void) | |
Constructor. More... | |
CObject (const CObject &src) | |
Copy constructor. More... | |
virtual | ~CObject (void) |
Destructor. More... | |
CObject & | operator= (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... | |
![]() | |
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_ColumnBuilder & | operator= (CWriteDB_ColumnBuilder &) |
Prevent copy assignment. More... | |
Private Attributes | |
class CWriteDB_Column * | m_Impl |
Implementation object. More... | |
Additional Inherited Members | |
![]() | |
enum | EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern } |
Control filling of newly allocated memory. More... | |
typedef CObjectCounterLocker | TLockerType |
Default locker type for CRef. More... | |
typedef atomic< Uint8 > | TCounter |
Counter type is CAtomiCounter. More... | |
typedef Uint8 | TCount |
Alias for value type of counter. More... | |
![]() | |
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 void | EnableDebugDump (bool on) |
![]() | |
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... | |
![]() | |
virtual void | DeleteThis (void) |
Virtual method "deleting" this object. More... | |
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.
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.
title | Internal name of this column. |
basename | Column filename (minus extension). |
file_id | Identifier for this column. |
Definition at line 370 of file writedb_column.cpp.
CWriteDB_ColumnBuilder::~CWriteDB_ColumnBuilder | ( | ) |
|
private |
Prevent the copy constructor.
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.
blob | The blob to add to the column. |
Definition at line 405 of file writedb_column.cpp.
References CWriteDB_Column::AddBlob(), and m_Impl.
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.
key | Key string. |
value | Value string. |
Definition at line 410 of file writedb_column.cpp.
References CWriteDB_Column::AddMetaData(), ncbi::grid::netcache::search::fields::key, m_Impl, and value.
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().
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.
files | The 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().
|
private |
Prevent copy assignment.
|
private |
Implementation object.
Definition at line 605 of file writedb.hpp.
Referenced by AddBlob(), AddMetaData(), Close(), CWriteDB_ColumnBuilder(), ListFiles(), and ~CWriteDB_ColumnBuilder().