reader_id1.cpp
来自「ncbi源码」· C++ 代码 · 共 1,248 行 · 第 1/3 页
CPP
1,248 行
out << id1_request; out.Flush();}void CId1Reader::x_ReadTSEBlob(CID1server_back& id1_reply, const CSeqref& /*seqref*/, CNcbiIstream& stream){ CObjectIStreamAsnBinary obj_stream(stream); x_ReadTSEBlob(id1_reply, obj_stream);}void CId1Reader::x_ReadTSEBlob(CID1server_back& id1_reply, CObjectIStream& stream){ CReader::SetSeqEntryReadHooks(stream); stream >> id1_reply;#ifdef ID1_COLLECT_STATS last_object_bytes = stream.GetStreamOffset();#endif}void CId1Reader::x_ReadSNPAnnot(CSeq_annot_SNP_Info& snp_info, const CSeqref& /*seqref*/, CByteSourceReader& reader){ CObjectIStreamAsnBinary in(reader); CSeq_annot_SNP_Info_Reader::Parse(in, snp_info);#ifdef ID1_COLLECT_STATS last_object_bytes = in.GetStreamOffset();#endif}END_SCOPE(objects)const string kId1ReaderDriverName("id1_reader");/// Class factory for ID1 reader////// @internal///class CId1ReaderCF : public CSimpleClassFactoryImpl<objects::CReader, objects::CId1Reader>{public: typedef CSimpleClassFactoryImpl<objects::CReader, objects::CId1Reader> TParent;public: CId1ReaderCF() : TParent(kId1ReaderDriverName, 0) { } ~CId1ReaderCF() { }};void NCBI_EntryPoint_Id1Reader( CPluginManager<objects::CReader>::TDriverInfoList& info_list, CPluginManager<objects::CReader>::EEntryPointRequest method){ CHostEntryPointImpl<CId1ReaderCF>::NCBI_EntryPointImpl(info_list, method);}END_NCBI_SCOPE/* * $Log: reader_id1.cpp,v $ * Revision 1000.1 2004/06/01 19:41:56 gouriano * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.81 * * Revision 1.81 2004/05/21 21:42:52 gorelenk * Added PCH ncbi_pch.hpp * * Revision 1.80 2004/03/16 17:49:18 vasilche * Use enum constant for TRACE_CHGR entries * * Revision 1.79 2004/03/16 15:47:29 vasilche * Added CBioseq_set_Handle and set of EditHandles * * Revision 1.78 2004/03/05 17:43:52 dicuccio * Added support for satellite 31: TRACE_CHGR * * Revision 1.77 2004/03/03 22:59:47 ucko * Gracefully handle CNcbiApplication::Instance returning NULL, as it * *is* possible to use other frameworks. * * Revision 1.76 2004/02/19 19:24:09 vasilche * Added conditional compilation of statistics collection code. * * Revision 1.75 2004/02/19 17:06:57 dicuccio * Use sat, sat-key in seq-ref, not sat-key, sat * * Revision 1.74 2004/02/18 14:01:25 dicuccio * Added new satellites for TRACE_ASSM, TR_ASSM_CH. Added support for overloading * the ID1 named service * * Revision 1.73 2004/02/04 17:47:41 kuznets * Fixed naming of entry points * * Revision 1.72 2004/01/28 20:53:43 vasilche * Added CSplitParser::Attach(). * * Revision 1.71 2004/01/22 20:53:30 vasilche * Fixed include path. * * Revision 1.70 2004/01/22 20:10:36 vasilche * 1. Splitted ID2 specs to two parts. * ID2 now specifies only protocol. * Specification of ID2 split data is moved to seqsplit ASN module. * For now they are still reside in one resulting library as before - libid2. * As the result split specific headers are now in objects/seqsplit. * 2. Moved ID2 and ID1 specific code out of object manager. * Protocol is processed by corresponding readers. * ID2 split parsing is processed by ncbi_xreader library - used by all readers. * 3. Updated OBJMGR_LIBS correspondingly. * * Revision 1.69 2004/01/13 21:54:49 vasilche * Requrrected new version * * Revision 1.5 2004/01/13 16:55:56 vasilche * CReader, CSeqref and some more classes moved from xobjmgr to separate lib. * Headers moved from include/objmgr to include/objtools/data_loaders/genbank. * * Revision 1.4 2003/12/30 22:14:42 vasilche * Updated genbank loader and readers plugins. * * Revision 1.67 2003/12/30 16:00:24 vasilche * Added support for new ICache (CBDB_Cache) interface. * * Revision 1.66 2003/12/19 19:47:44 vasilche * Added support for TRACE data, Seq-id ::= general { db "ti", tag id NNN }. * * Revision 1.65 2003/12/03 14:30:02 kuznets * Code clean up. * Made use of driver name constant instead of immediate in-place string. * * Revision 1.64 2003/12/02 16:18:16 kuznets * Added plugin manager support for CReader interface and implementaions * (id1 reader, pubseq reader) * * Revision 1.63 2003/11/26 17:55:59 vasilche * Implemented ID2 split in ID1 cache. * Fixed loading of splitted annotations. * * Revision 1.62 2003/11/21 16:32:52 vasilche * Cleaned code avoiding ERROR 0 packets. * * Revision 1.61 2003/11/19 15:43:03 vasilche * Temporary fix for extra ERROR 0 packed from ID1 server. * CVS: ---------------------------------------------------------------------- * * Revision 1.60 2003/11/07 16:59:01 vasilche * Fixed stats message. * * Revision 1.59 2003/11/04 21:53:32 vasilche * Check only SNP bit in extfeat field in ID1 response. * * Revision 1.58 2003/10/27 18:50:49 vasilche * Detect 'private' blobs in ID1 reader. * Avoid reconnecting after ID1 server replied with error packet. * * Revision 1.57 2003/10/27 15:05:41 vasilche * Added correct recovery of cached ID1 loader if gi->sat/satkey cache is invalid. * Added recognition of ID1 error codes: private, etc. * Some formatting of old code. * * Revision 1.56 2003/10/24 13:27:40 vasilche * Cached ID1 reader made more safe. Process errors and exceptions correctly. * Cleaned statistics printing methods. * * Revision 1.55 2003/10/22 16:36:25 vasilche * Fixed typo. * * Revision 1.54 2003/10/22 16:32:42 vasilche * MSVC forces to use stream::bad() method. * * Revision 1.53 2003/10/22 16:12:38 vasilche * Added CLoaderException::eNoConnection. * Added check for 'fail' state of ID1 connection stream. * CLoaderException::eNoConnection will be rethrown from CGBLoader. * * Revision 1.52 2003/10/21 16:32:50 vasilche * Cleaned ID1 statistics messages. * Now by setting GENBANK_ID1_STATS=1 CId1Reader collects and displays stats. * And by setting GENBANK_ID1_STATS=2 CId1Reader logs all activities. * * Revision 1.51 2003/10/21 14:27:35 vasilche * Added caching of gi -> sat,satkey,version resolution. * SNP blobs are stored in cache in preprocessed format (platform dependent). * Limit number of connections to GenBank servers. * Added collection of ID1 loader statistics. * * Revision 1.50 2003/10/14 21:06:25 vasilche * Fixed compression statistics. * Disabled caching of SNP blobs. * * Revision 1.49 2003/10/14 18:59:55 vasilche * Temporarily remove collection of compression statistics. * * Revision 1.48 2003/10/14 18:31:54 vasilche * Added caching support for SNP blobs. * Added statistics collection of ID1 connection. * * Revision 1.47 2003/10/08 14:16:13 vasilche * Added version of blobs loaded from ID1. * * Revision 1.46 2003/10/01 18:08:14 kuznets * s_SkipBytes renamed to Id1ReaderSkipBytes (made non static) * * Revision 1.45 2003/09/30 19:38:26 vasilche * Added support for cached id1 reader. * * Revision 1.44 2003/09/30 16:22:02 vasilche * Updated internal object manager classes to be able to load ID2 data. * SNP blobs are loaded as ID2 split blobs - readers convert them automatically. * Scope caches results of requests for data to data loaders. * Optimized CSeq_id_Handle for gis. * Optimized bioseq lookup in scope. * Reduced object allocations in annotation iterators. * CScope is allowed to be destroyed before other objects using this scope are * deleted (feature iterators, bioseq handles etc). * Optimized lookup for matching Seq-ids in CSeq_id_Mapper. * Added 'adaptive' option to objmgr_demo application. * * Revision 1.43 2003/08/27 14:25:22 vasilche * Simplified CCmpTSE class. * * Revision 1.42 2003/08/19 18:34:40 vasilche * Fixed warning about enum conversion. * * Revision 1.41 2003/08/14 20:05:19 vasilche * Simple SNP features are stored as table internally. * They are recreated when needed using CFeat_CI. * * Revision 1.40 2003/07/24 19:28:09 vasilche * Implemented SNP split for ID1 loader. * * Revision 1.39 2003/07/17 20:07:56 vasilche * Reduced memory usage by feature indexes. * SNP data is loaded separately through PUBSEQ_OS. * String compression for SNP data. * * Revision 1.38 2003/06/02 16:06:38 dicuccio * Rearranged src/objects/ subtree. This includes the following shifts: * - src/objects/asn2asn --> arc/app/asn2asn * - src/objects/testmedline --> src/objects/ncbimime/test * - src/objects/objmgr --> src/objmgr * - src/objects/util --> src/objmgr/util * - src/objects/alnmgr --> src/objtools/alnmgr * - src/objects/flat --> src/objtools/flat * - src/objects/validator --> src/objtools/validator * - src/objects/cddalignview --> src/objtools/cddalignview * In addition, libseq now includes six of the objects/seq... libs, and libmmdb * replaces the three libmmdb? libs. * * Revision 1.37 2003/05/13 20:14:40 vasilche * Catching exceptions and reconnection were moved from readers to genbank loader. * * Revision 1.36 2003/04/24 16:12:38 vasilche * Object manager internal structures are splitted more straightforward. * Removed excessive header dependencies. * * Revision 1.35 2003/04/15 15:30:15 vasilche * Added include <memory> when needed. * Removed buggy buffer in printing methods. * Removed unnecessary include of stream_util.hpp. * * Revision 1.34 2003/04/15 14:24:08 vasilche * Changed CReader interface to not to use fake streams. * * Revision 1.33 2003/04/07 16:56:57 vasilche * Fixed unassigned member in ID1 request. * * Revision 1.32 2003/03/31 17:02:03 lavr * Some code reformatting to [more closely] meet coding requirements * * Revision 1.31 2003/03/30 07:00:29 lavr * MIPS-specific workaround for lame-designed stream read ops * * Revision 1.30 2003/03/28 03:28:14 lavr * CId1Reader::xsgetn() added; code heavily reformatted * * Revision 1.29 2003/03/27 19:38:13 vasilche * Use safe NStr::IntToString() instead of sprintf(). * * Revision 1.28 2003/03/03 20:34:51 vasilche * Added NCBI_THREADS macro - it's opposite to NCBI_NO_THREADS. * Avoid using _REENTRANT macro - use NCBI_THREADS instead. * * Revision 1.27 2003/03/01 22:26:56 kimelman * performance fixes * * Revision 1.26 2003/02/04 18:53:36 dicuccio * Include file clean-up * * Revision 1.25 2002/12/26 20:53:25 dicuccio * Minor tweaks to relieve compiler warnings in MSVC * * Revision 1.24 2002/12/26 16:39:24 vasilche * Object manager class CSeqMap rewritten. * * Revision 1.23 2002/11/18 19:48:43 grichenk * Removed "const" from datatool-generated setters * * Revision 1.22 2002/07/25 15:01:51 grichenk * Replaced non-const GetXXX() with SetXXX() * * Revision 1.21 2002/05/09 21:40:59 kimelman * MT tuning * * Revision 1.20 2002/05/06 03:28:47 vakatov * OM/OM1 renaming * * Revision 1.19 2002/05/03 21:28:10 ucko * Introduce T(Signed)SeqPos. * * Revision 1.18 2002/04/17 19:52:02 kimelman * fix: no gi found * * Revision 1.17 2002/04/09 16:10:56 ucko * Split CStrStreamBuf out into a common location. * * Revision 1.16 2002/04/08 20:52:26 butanaev * Added PUBSEQ reader. * * Revision 1.15 2002/03/29 02:47:05 kimelman * gbloader: MT scalability fixes * * Revision 1.14 2002/03/27 20:23:50 butanaev * Added connection pool. * * Revision 1.13 2002/03/26 23:31:08 gouriano * memory leaks and garbage collector fix * * Revision 1.12 2002/03/26 18:48:58 butanaev * Fixed bug not deleting streambuf. * * Revision 1.11 2002/03/26 17:17:02 kimelman * reader stream fixes * * Revision 1.10 2002/03/26 15:39:25 kimelman * GC fixes * * Revision 1.9 2002/03/25 18:12:48 grichenk * Fixed bool convertion * * Revision 1.8 2002/03/25 17:49:13 kimelman * ID1 failure handling * * Revision 1.7 2002/03/25 15:44:47 kimelman * proper logging and exception handling * * Revision 1.6 2002/03/22 21:50:21 kimelman * bugfix: avoid history rtequest for nonexistent sequence * * Revision 1.5 2002/03/21 19:14:54 kimelman * GB related bugfixes * * Revision 1.4 2002/03/21 01:34:55 kimelman * gbloader related bugfixes * * Revision 1.3 2002/03/20 04:50:13 kimelman * GB loader added * * Revision 1.2 2002/01/16 18:56:28 grichenk * Removed CRef<> argument from choice variant setter, updated sources to * use references instead of CRef<>s * * Revision 1.1 2002/01/11 19:06:22 gouriano * restructured objmgr * * Revision 1.7 2001/12/17 21:38:24 butanaev * Code cleanup. * * Revision 1.6 2001/12/13 00:19:25 kimelman * bugfixes: * * Revision 1.5 2001/12/12 21:46:40 kimelman * Compare interface fix * * Revision 1.4 2001/12/10 20:08:02 butanaev * Code cleanup. * * Revision 1.3 2001/12/07 21:24:59 butanaev * Interface development, code beautyfication. * * Revision 1.2 2001/12/07 16:43:58 butanaev * Fixed includes. * * Revision 1.1 2001/12/07 16:10:23 butanaev * Switching to new reader interfaces. * * Revision 1.3 2001/12/06 20:37:05 butanaev * Fixed timeout problem. * * Revision 1.2 2001/12/06 18:06:22 butanaev * Ported to linux. * * Revision 1.1 2001/12/06 14:35:23 butanaev * New streamable interfaces designed, ID1 reimplemented. * */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?