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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS___LOADERS___COLUMNAR_VCF_CACHE__HPP_
2 #define GUI_WIDGETS___LOADERS___COLUMNAR_VCF_CACHE__HPP_
3 /* $Id: columnar_vcf_cache.hpp 46769 2021-10-01 22:11:09Z evgeniev $
4  * ===========================================================================
5  *
6  * PUBLIC DOMAIN NOTICE
7  * National Center for Biotechnology Information
8  *
9  * This software/database is a "United States Government Work" under the
10  * terms of the United States Copyright Act. It was written as part of
11  * the author's official duties as a United States Government employee and
12  * thus cannot be copyrighted. This software/database is freely available
13  * to the public for use. The National Library of Medicine and the U.S.
14  * Government have not placed any restriction on its use or reproduction.
15  *
16  * Although all reasonable efforts have been taken to ensure the accuracy
17  * and reliability of the software and data, the NLM and the U.S.
18  * Government do not and cannot warrant the performance or results that
19  * may be obtained by using this software or data. The NLM and the U.S.
20  * Government disclaim all warranties, express or implied, including
21  * warranties of performance, merchantability or fitness for any particular
22  * purpose.
23  *
24  * Please cite the author in any work or product based on this material.
25  *
26  * ===========================================================================
27  *
28  * Authors: Vladislav Evgeniev
29  *
30  * File Description:
31  *
32  *
33  */
34 
35 #include <gui/gui_export.h>
36 
37 #include <functional>
38 
40 
42 
43 class CErrorContainer;
44 
46 {
47 public:
48  CColumnarVcfCache(const std::string &netcache_key);
49  CColumnarVcfCache(const std::string &url, const std::string &seq_id, const std::string &last_modified);
50  string GetSeqId() const { return m_SeqId; };
51 
52 protected:
53  /// @name CDataCrawlerCache overridables
54  /// @{
57  virtual std::string x_GetCacheKey();
58  /// @}
59 
60 private:
65 };
66 
67 
68 namespace ColumnarVcfCache {
69  using TReportError = std::function<void(const string&)>;
70 
71  /// Creates a VCF blob for a given scaffold id and VCF url
72  /// @param[in] url
73  /// The url of the VCF file.
74  /// @param[in] id
75  /// The seq-id to load.
76  /// @param[out] cache
77  /// Cache object to store the VCF blob.
78  /// @param[out] json
79  /// Output json.
80  /// @return
81  /// True if the BLOB was created successfully, false otherwise.
82  NCBI_GUIWIDGETS_LOADERS_EXPORT bool CreateBlob(const std::string &url, const std::string &id, CColumnarVcfCache &cache, size_t &blob_size, TReportError report_error, const unsigned retries_count = 1, bool enforce_size_limit = true);
83 
84  /// Reports VCF syntax errors to AppLog
85  /// @param[in] err_cont
86  /// Pointer to error container
88 
89  /// Get the list of INFO fields to read
90  /// @param[out] fields
91  /// INFO fields to parse
92  void SetInfoFields(set<string>& fields);
93 
94 }
95 
97 
98 #endif // GUI_WIDGETS___LOADERS___COLUMNAR_VCF_CACHE__HPP_
CColumnarVcfCache(const std::string &url, const std::string &seq_id, const std::string &last_modified)
string GetSeqId() const
Base class for data crawler cache objects.
virtual CNetICacheClient x_InitBlobCache()=0
Creates the BLOB NetCache instance.
virtual CNetICacheClient x_InitSyncCache()=0
Creates the sync NetCache instance.
virtual std::string x_GetCacheKey()=0
Generates the cache key.
CErrorContainer.
Client to NetCache server (implements ICache interface)
string
Definition: cgiapp.hpp:690
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_GUIWIDGETS_LOADERS_EXPORT
Definition: gui_export.h:525
Defines to provide correct exporting from DLLs in Windows.
void SetInfoFields(set< string > &fields)
Get the list of INFO fields to read.
bool CreateBlob(const std::string &url, const std::string &id, CColumnarVcfCache &cache, size_t &blob_size, TReportError report_error, const unsigned retries_count=1, bool enforce_size_limit=true)
Creates a VCF blob for a given scaffold id and VCF url.
void ReportSyntaxErrors(CErrorContainer *err_cont)
Reports VCF syntax errors to AppLog.
std::function< void(const string &)> TReportError
Modified on Fri Sep 20 14:57:37 2024 by modify_doxy.py rev. 669887