1 /* $Id: huge_asn_loader.hpp 636820 2021-08-31 18:41:37Z ivanov $ 2 * =========================================================================== 3 * 4 * PUBLIC DOMAIN NOTICE 5 * National Center for Biotechnology Information 6 * 7 * This software/database is a "United States Government Work" under the 8 * terms of the United States Copyright Act. It was written as part of 9 * the author's official duties as a United States Government employee and 10 * thus cannot be copyrighted. This software/database is freely available 11 * to the public for use. The National Library of Medicine and the U.S. 12 * Government have not placed any restriction on its use or reproduction. 13 * 14 * Although all reasonable efforts have been taken to ensure the accuracy 15 * and reliability of the software and data, the NLM and the U.S. 16 * Government do not and cannot warrant the performance or results that 17 * may be obtained by using this software or data. The NLM and the U.S. 18 * Government disclaim all warranties, express or implied, including 19 * warranties of performance, merchantability or fitness for any particular 20 * purpose. 21 * 22 * Please cite the author in any work or product based on this material. 23 * 24 * =========================================================================== 25 * 26 * Authors: Sergiy Gotvyanskyy 27 * 28 * File Description: 29 * 30 * 31 */ 32 33 #ifndef _HUGE_ASN_DATALOADER_HPP_INCLUDED_ 34 #define _HUGE_ASN_DATALOADER_HPP_INCLUDED_ 35 36 #include <corelib/ncbistd.hpp> 37 #include <objmgr/data_loader.hpp> 38 39 BEGIN_NCBI_SCOPE 40 41 class CHugeAsnReader; 42 43 BEGIN_SCOPE(objects) 44 45 class CHugeAsnDataLoader: public CDataLoader 46 { 47 public: 48 typedef SRegisterLoaderInfo<CHugeAsnDataLoader> TRegisterLoaderInfo; 49 CHugeAsnDataLoader(const string& name, const string& filename); 50 51 static TRegisterLoaderInfo RegisterInObjectManager( 52 CObjectManager& om, 53 const string& loader_name, 54 const string& filename, 55 CObjectManager::EIsDefault is_default = CObjectManager::eNonDefault, 56 CObjectManager::TPriority priority = CObjectManager::kPriority_Default); 57 58 TTSE_LockSet GetRecords(const CSeq_id_Handle& idh, EChoice choice) override; 59 TBlobId GetBlobId(const CSeq_id_Handle& idh) override; 60 TTSE_Lock GetBlobById(const TBlobId& blob_id) override; 61 CanGetBlobById(void) const62 bool CanGetBlobById(void) const override 63 { 64 return true; 65 } 66 67 private: 68 std::unique_ptr<CHugeAsnReader> m_reader; 69 string m_filename; 70 }; 71 72 END_SCOPE(objects) 73 END_NCBI_SCOPE 74 75 #endif // _HUGE_ASN_DATALOADER_HPP_INCLUDED_ 76