⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bdb_file.hpp

📁 ncbi源码
💻 HPP
📖 第 1 页 / 共 2 页
字号:
    /// Free the DBT structure created by CloneDBT_Key.    static void DestroyDBT_Clone(DBT* dbt);    /// Set C-str detection    void SetLegacyStringsCheck(bool value);    /// CBDB_File keeps data in two buffers (key buffer and data buffer).    /// TUnifiedFieldIndex is used to address fields in a non-ambigiuos manner.    /// Negative index addresses fields in the key buffer, positive - data buffer    /// Numbers are 1 based, 0 - means non-existing field    typedef int TUnifiedFieldIndex;    /// Get field index by name.    /// @param    ///   name field name to find (case insensitive)    /// @return     ///   Field index (0 if not found)    /// @sa TUnifiedFieldIndex    TUnifiedFieldIndex GetFieldIdx(const string& name) const;    /// Return field by field index    /// @param    ///    idx field index    /// @return field reference    const CBDB_Field& GetField(TUnifiedFieldIndex idx) const;    CBDB_Field& GetField(TUnifiedFieldIndex idx);protected:    /// Unpack internal record buffers    void Discard();    /// Set comparison function. Default implementation installs bdb_types based    /// function. Can be overloaded for some specific cases.    virtual void SetCmp(DB*);    /// Read DB cursor    EBDB_ErrCode ReadCursor(DBC* dbc, unsigned int bdb_flag);    /// Write DB cursor    EBDB_ErrCode WriteCursor(DBC* dbc, unsigned int bdb_flag,                              EAfterWrite write_flag);    /// Delete DB cursor    EBDB_ErrCode DeleteCursor(DBC* dbc, EIgnoreError);    /// Check if all NOT NULL fields are assigned.     /// Throw an exception if constraint check failed.    void CheckNullDataConstraint() const;    /// Function disables processing of m_DBT_data.     /// This function can be used when creating custom BDB file    /// data structures (BLOB storage, etc.) Caller takes full    /// responsibility for filling m_DBT_Data with correct values.    void DisableDataBufProcessing() { m_DataBufDisabled = true; }    /// Wrapper around get operation.        EBDB_ErrCode x_Fetch(unsigned int flags);    private:    CBDB_File(const CBDB_File&);    CBDB_File& operator= (const CBDB_File&);    /// Record reading prolog function    void x_StartRead();    /// Record reading epilog function    void x_EndRead();    EBDB_ErrCode x_Write(unsigned int flags, EAfterWrite write_flag,                          DBC * dbc = 0);    void x_CheckConstructBuffers();private:    auto_ptr<CBDB_BufferManager>   m_KeyBuf;    auto_ptr<CBDB_BufferManager>   m_DataBuf;    bool                           m_BufsAttached;    bool                           m_BufsCreated;    bool                           m_DataBufDisabled;    bool                           m_LegacyString;    friend class CBDB_FileCursor;};/// Berkeley DB file class optimized to work with /// tables having int as the primary key.///class NCBI_BDB_EXPORT CBDB_IdFile : public CBDB_File{public:    CBDB_FieldInt4  IdKey;public:    CBDB_IdFile();    virtual void SetCmp(DB* db);  };/* @} *////////////////////////////////////////////////////////////////////////////////  IMPLEMENTATION of INLINE functions//////////////////////////////////////////////////////////////////////////////// Make field index in CBDB_File format////// @internalinlineCBDB_File::TUnifiedFieldIndex BDB_GetUFieldIdx(int fidx, bool key){    _ASSERT(fidx >= 0);    ++fidx;    return key ? (-fidx) : (fidx);}///////////////////////////////////////////////////////////////////////////////  CBDB_RawFile:://inline void CBDB_RawFile::Open(const char* filename, EOpenMode open_mode){    Open(filename, 0, open_mode);}inline const string& CBDB_RawFile::FileName() const{    return m_FileName;}inline const string& CBDB_RawFile::Database() const{    return m_Database;}inline bool CBDB_RawFile::IsOpen() const{    return !m_FileName.empty();}inline bool CBDB_RawFile::IsAttached() const{    return m_DB_Attached;}/////////////////////////////////////////////////////////////////////////////////  CBDB_File:://inline void CBDB_File::Open(const char* filename, EOpenMode open_mode){    Open(filename, 0, open_mode);}inline void CBDB_File::CheckNullDataConstraint() const{    if ( m_DataBuf.get() )        m_DataBuf->CheckNullConstraint();}inlinevoid CBDB_File::SetFieldCompareLimit(unsigned int n_fields){    m_KeyBuf->SetFieldCompareLimit(n_fields);}END_NCBI_SCOPE/* * =========================================================================== * $Log: bdb_file.hpp,v $ * Revision 1000.2  2004/06/01 18:37:00  gouriano * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.30 * * Revision 1.30  2004/05/06 18:17:58  rotmistr * Cursor Update/Delete implemented * * Revision 1.29  2004/03/08 13:31:58  kuznets * CBDB_File some methods made public * * Revision 1.28  2004/02/13 15:00:12  kuznets * + typedef TUnifiedFieldIndex plus methods to work with fields in CBDB_File * * Revision 1.27  2003/12/29 13:23:01  kuznets * Added support for transaction protected cursors. * * Revision 1.26  2003/12/22 18:53:50  kuznets * Added legacy(c-string) string format check flag. * * Revision 1.25  2003/12/16 13:42:58  kuznets * Added internal method to close association between transaction object * and BDB file object when transaction goes out of scope. * * Revision 1.24  2003/12/10 19:13:27  kuznets * Added support of berkeley db transactions * * Revision 1.23  2003/10/27 14:20:31  kuznets * + Buffer manager accessor functions for CBDB_File * * Revision 1.22  2003/10/16 19:26:07  kuznets * Added field comparison limit to the fields manager * * Revision 1.21  2003/10/15 18:10:09  kuznets * Several functions(Close, Delete) received optional parameter to ignore * errors (if any). * * Revision 1.20  2003/09/26 21:08:30  kuznets * Comments reformatting for doxygen * * Revision 1.19  2003/09/17 18:16:21  kuznets * Some class functions migrated into the public scope. * * Revision 1.18  2003/09/16 20:17:29  kuznets * CBDB_File: added methods to clone (and then destroy) DBT Key. * * Revision 1.17  2003/09/11 16:34:13  kuznets * Implemented byte-order independence. * * Revision 1.16  2003/08/27 20:02:10  kuznets * Added DB_ENV support * * Revision 1.15  2003/07/23 20:21:27  kuznets * Implemented new improved scheme for setting BerkeleyDB comparison function. * When table has non-segmented key the simplest(and fastest) possible function * is assigned (automatically without reloading CBDB_File::SetCmp function). * * Revision 1.14  2003/07/23 18:07:56  kuznets * Implemented couple new functions to work with attached files * * Revision 1.13  2003/07/22 19:21:04  kuznets * Implemented support of attachable berkeley db files * * Revision 1.12  2003/07/22 15:14:33  kuznets * + RawFile::CountRecs() function * * Revision 1.11  2003/07/18 20:11:05  kuznets * Added ReadWrite or Create open mode, added several accessor methods, Sync() method. * * Revision 1.10  2003/07/09 14:29:01  kuznets * Added support of files with duplicate access keys. (DB_DUP mode) * * Revision 1.9  2003/07/02 17:53:59  kuznets * Eliminated direct dependency from <db.h> * * Revision 1.8  2003/06/27 18:57:16  dicuccio * Uninlined strerror() adaptor.  Changed to use #include<> instead of #include "" * * Revision 1.7  2003/06/10 20:07:27  kuznets * Fixed header files not to repeat information from the README file * * Revision 1.6  2003/06/03 18:50:09  kuznets * Added dll export/import specifications * * Revision 1.5  2003/05/27 16:13:21  kuznets * Destructors of key classes declared virtual to make GCC happy * * Revision 1.4  2003/05/05 20:14:41  kuznets * Added CBDB_BLobFile, CBDB_File changed to support more flexible data record * management. * * Revision 1.3  2003/05/02 14:14:18  kuznets * new method UpdateInsert * * Revision 1.2  2003/04/29 16:48:31  kuznets * Fixed minor warnings in Sun Workshop compiler * * Revision 1.1  2003/04/24 16:31:16  kuznets * Initial revision * * * =========================================================================== */#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -