NCBI C++ ToolKit
resolve_base.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef PSGS_RESOLVEBASE__HPP
2 #define PSGS_RESOLVEBASE__HPP
3 
4 /* $Id: resolve_base.hpp 97575 2022-08-01 12:56:45Z satskyse $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Sergey Satskiy
30  *
31  * File Description: base class for processors which need to resolve seq_id
32  *
33  */
34 
36 #include <corelib/ncbidiag.hpp>
37 
38 #include "cass_fetch.hpp"
39 #include "psgs_request.hpp"
40 #include "psgs_reply.hpp"
41 #include "cass_processor_base.hpp"
42 #include "async_resolve_base.hpp"
44 
49 
51 
52 
53 // Deriving from CPSGS_CassProcessorBase is not required because
54 // CPSGS_AsyncResolveBase and CPSGS_AsyncBioseqInfoBase derive from it
55 // (virtually) as well
58 {
59 public:
61  CPSGS_ResolveBase(shared_ptr<CPSGS_Request> request,
62  shared_ptr<CPSGS_Reply> reply,
63  TSeqIdResolutionFinishedCB finished_cb,
64  TSeqIdResolutionErrorCB error_cb,
65  TSeqIdResolutionStartProcessingCB resolution_start_processing_cb);
66  virtual ~CPSGS_ResolveBase();
67 
68 private:
70  bool x_ComposeOSLT(CSeq_id & parsed_seq_id,
71  int16_t & effective_seq_id_type,
72  list<string> & secondary_id_list,
73  string & primary_id);
74 
75 private:
77  const string & primary_id,
78  int16_t effective_version,
79  int16_t effective_seq_id_type,
80  SBioseqResolution & bioseq_resolution);
82  const string & secondary_id,
83  int16_t effective_seq_id_type,
84  SBioseqResolution & bioseq_resolution);
86  SBioseqResolution & bioseq_resolution);
88  CSeq_id & parsed_seq_id,
89  int16_t effective_seq_id_type,
90  const list<string> & secondary_id_list,
91  const string & primary_id,
92  SBioseqResolution & bioseq_resolution);
93 
94 private:
95  void x_ResolveSeqId(void);
96  void x_OnResolutionGoodData(void);
98  CRequestStatus::ECode status,
99  int code,
100  EDiagSev severity,
101  const string & message,
104  CRequestStatus::ECode status,
105  int code,
106  EDiagSev severity,
107  const string & message,
110  SBioseqResolution && bioseq_resolution);
111  void x_RegisterSuccessTiming(const SBioseqResolution & bioseq_resolution);
112 
113 protected:
114  void ResolveInputSeqId(void);
115  void ResolveInputSeqId(const string & seq_id, int16_t seq_id_type);
116 
117 public:
119 
120 private:
124 
126 };
127 
128 #endif // PSGS_RESOLVEBASE__HPP
129 
function< void(SBioseqResolution &&async_bioseq_resolution)> TSeqIdResolutionFinishedCB
function< void(void)> TSeqIdResolutionStartProcessingCB
function< void(CRequestStatus::ECode status, int code, EDiagSev severity, const string &message, EPSGS_LoggingFlag logging_flag)> TSeqIdResolutionErrorCB
void x_ResolveViaComposeOSLTInCache(CSeq_id &parsed_seq_id, int16_t effective_seq_id_type, const list< string > &secondary_id_list, const string &primary_id, SBioseqResolution &bioseq_resolution)
void x_ResolveSeqId(void)
void x_OnAsyncBioseqInfoResolveError(CRequestStatus::ECode status, int code, EDiagSev severity, const string &message, EPSGS_LoggingFlag loging_flag=ePSGS_NeedLogging)
void x_OnResolutionGoodData(void)
virtual ~CPSGS_ResolveBase()
EPSGS_CacheLookupResult x_ResolveSecondaryOSLTInCache(const string &secondary_id, int16_t effective_seq_id_type, SBioseqResolution &bioseq_resolution)
void x_OnSeqIdResolveError(CRequestStatus::ECode status, int code, EDiagSev severity, const string &message, EPSGS_LoggingFlag loging_flag=ePSGS_NeedLogging)
SBioseqResolution ResolveTestInputSeqId(void)
void ResolveInputSeqId(void)
TSeqIdResolutionErrorCB m_FinalErrorCB
EPSGS_CacheLookupResult x_ResolvePrimaryOSLTInCache(const string &primary_id, int16_t effective_version, int16_t effective_seq_id_type, SBioseqResolution &bioseq_resolution)
EPSGS_CacheLookupResult x_ResolveAsIsInCache(SBioseqResolution &bioseq_resolution)
TSeqIdResolutionFinishedCB m_FinalFinishedCB
bool x_ComposeOSLT(CSeq_id &parsed_seq_id, int16_t &effective_seq_id_type, list< string > &secondary_id_list, string &primary_id)
void x_OnSeqIdResolveFinished(SBioseqResolution &&bioseq_resolution)
TSeqIdResolutionStartProcessingCB m_FinalStartProcessingCB
void x_RegisterSuccessTiming(const SBioseqResolution &bioseq_resolution)
SPSGS_RequestBase::EPSGS_CacheAndDbUse x_GetRequestUseCache(void)
Int2 int16_t
EDiagSev
Severity level for the posted diagnostics.
Definition: ncbidiag.hpp:650
Defines NCBI C++ diagnostic APIs, classes, and macros.
EPSGS_CacheLookupResult
@ ePSGS_NeedLogging
Defines CRequestStatus class for NCBI C++ diagnostic API.
USING_SCOPE(objects)
USING_IDBLOB_SCOPE
USING_NCBI_SCOPE
Definition: inftrees.h:24
Modified on Fri Sep 20 14:57:25 2024 by modify_doxy.py rev. 669887