41 #if ((!defined(NCBI_COMPILER_WORKSHOP) || (NCBI_COMPILER_VERSION > 550)) && \
42 (!defined(NCBI_COMPILER_MIPSPRO)) )
49 m_MaskName (maskname),
50 m_MaxFileSize (max_file_size),
255 const int kFormatVersion = 1;
293 if (!
mask.size())
return;
`Blob' Class for SeqDB (and WriteDB).
@ eString
Pad using NUL terminated string of '#' bytes.
int GetWriteOffset() const
Get the current write pointer offset.
void WritePadBytes(int align, EPadding fmt)
Align the offset by writing pad bytes.
void Clear()
Clear all owned data and reference an empty string.
void WriteInt4(Int4 x)
Write a 4 byte integer to the blob.
CTempString Str() const
Get blob contents as a CTempString.
void WriteInt4_LE(Int4 x)
int WriteString(CTempString str, EStringFormat fmt)
Write string data to the blob.
CWriteDB_IndexFile class.
bool m_Created
True if the file has already been opened.
const string & GetFilename() const
Get the current filename for this file.
void Create()
Create and open the file.
void Close()
Close the file, flushing any remaining data to disk.
unsigned int Write(const CTempString &data)
Write contents of a string to the file.
virtual void RenameSingle()
Rename this file, disincluding the volume index.
CWriteDB_GiMaskData class.
void WriteMask(const TPairVector &mask)
Write a new data blob.
vector< pair< TSeqPos, TSeqPos > > TPairVector
TOffset GetOffset() const
Get current index/offset pair.
Uint8 m_DataLength
Length of data written so far.
int GetIndex() const
Get current index.
CWriteDB_GiMaskData(const string &maskname, const string &extn, int index, Uint8 max_file_size, bool le=false)
Constructor for an gimask data file.
bool m_UseLE
Use little endian?
bool CanFit(int num_masks) const
Tests whether there is room for another batch.
CWriteDB_GiMaskIndex class.
string m_Desc
Description of this gimask.
void AddGIs(const TGiOffset &gi_offset, int num_vols)
Add sequence GI to the offset file.
CWriteDB_GiMaskIndex(const string &maskname, const string &extn, const string &desc, Uint8 max_file_size, bool le=false)
Constructor for gimask index file.
static const CBlastDbBlob::EStringFormat kStringFmt
String format used by gimask files.
Int4 m_NumIndex
Number of GIs indexed.
string m_Date
Creation timestamp for this gimask.
Int4 m_NumGIs
Number of GIs.
void x_BuildHeaderFields(int num_vols)
Build fixed length header fields.
CWriteDB_GiMaskOffset class.
CWriteDB_GiMaskOffset(const string &maskname, const string &extn, Uint8 max_file_size, bool le=false)
Constructor for gimask offset file.
static const int kGISize
Size of a GI.
void AddGIs(const TGiOffset &gi_offset)
Add sequence GI to the offset file.
vector< pair< TGi, TOffset > > TGiOffset
static const int kOffsetSize
Size of offset entry.
bool m_UseLE
Use little endian?
static const int kPageSize
Page size.
void ListFiles(vector< string > &files) const
List Filenames.
CRef< CWriteDB_GiMaskIndex > m_IFile_LE
void AddGiMask(const vector< TGi > &GIs, const TPairVector &masks)
Add a mask data for a sequence represented by a set of GIs.
TGiOffset m_GiOffset
Sorted list of (GI, offset) pairs.
CRef< CWriteDB_GiMaskData > m_DFile
Data file.
CRef< CWriteDB_GiMaskData > m_DFile_LE
void Close()
Flush data to disk and close all associated files.
CRef< CWriteDB_GiMaskOffset > m_OFile
Offset file.
CRef< CWriteDB_GiMaskOffset > m_OFile_LE
vector< pair< TSeqPos, TSeqPos > > TPairVector
CRef< CWriteDB_GiMaskIndex > m_IFile
Index file.
CWriteDB_GiMask(const string &maskname, const string &desc, Uint8 max_file_size)
Construct WriteDB style database gimask.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
void Reset(void)
Reset reference object.
int32_t Int4
4-byte (32-bit) signed integer
uint64_t Uint8
8-byte (64-bit) unsigned integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
string AsString(const CTimeFormat &format=kEmptyStr, TSeconds out_tz=eCurrentTimeZone) const
Transform time to string.
@ eCurrent
Use current time. See also CCurrentTime.
range(_Ty, _Ty) -> range< _Ty >
constexpr auto sort(_Init &&init)
const struct ncbi::grid::netcache::search::fields::SIZE size
bool le(T x_, T y_, T round_)
Defines BLAST database construction classes.
USING_SCOPE(std)
Import C++ std namespace.
Code for gi-based database mask file construction.