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

Go to the SVN repository for this file.

1 /*
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  * Author: Alexey Dobronadezhdin
27  *
28  * File Description:
29  *
30  * ===========================================================================
31  */
32 
33 #ifndef UNPUB_REPORT_H
34 #define UNPUB_REPORT_H
35 
36 #include <string>
37 #include <set>
38 
39 #include <corelib/ncbistre.hpp>
40 
41 #include "base_report.hpp"
42 
43 namespace ncbi
44 {
45  class CEutilsClient;
46  namespace objects
47  {
48  class CDate_std;
49  class CPub;
50  class CPubmed_entry;
51  }
52 }
53 
56 
57 namespace pub_report
58 {
59 
60 class CPubData;
61 
63 {
64 public:
65  CUnpublishedReport(ncbi::CNcbiOstream& out, int max_date_check, bool nohydra);
66 
67  void CompleteReport() override;
68  void SetCurrentSeqId(const std::string& name) override;
69  void ClearData() override;
70 
71  void ReportUnpublished(const CPub& pub);
72 
73  bool IsSetDate() const;
74  const CDate_std& GetDate() const;
75 
76  void SetDate(const CDate_std& date);
77  void ResetDate();
78 
79 private:
80  CEutilsClient& GetEUtils() const;
81 
82  TEntrezId RetrievePMid(const CPubData& data) const;
83  bool FetchPub(TEntrezId pmid, const CPubData& data, CRef<CPubmed_entry>& pubmed_entry) const;
84 
85  typedef std::list<std::shared_ptr<CPubData>> TPubs;
86 
90 
92  mutable shared_ptr<CEutilsClient> m_eutils;
93 
95 
97  bool m_nohydra;
98 };
99 
100 }
101 
102 #endif // UNPUB_REPORT_H
Class for querying via E-Utils.
Definition: Pub.hpp:56
CPubmed_entry –.
CRef –.
Definition: ncbiobj.hpp:618
ncbi::CNcbiOstream & m_out
const CDate_std & GetDate() const
TEntrezId RetrievePMid(const CPubData &data) const
void SetCurrentSeqId(const std::string &name) override
CUnpublishedReport(ncbi::CNcbiOstream &out, int max_date_check, bool nohydra)
void ReportUnpublished(const CPub &pub)
bool FetchPub(TEntrezId pmid, const CPubData &data, CRef< CPubmed_entry > &pubmed_entry) const
std::list< std::shared_ptr< CPubData > > TPubs
shared_ptr< CEutilsClient > m_eutils
CEutilsClient & GetEUtils() const
void SetDate(const CDate_std &date)
std::ofstream out("events_result.xml")
main entry point for tests
char data[12]
Definition: iconv.c:80
SStrictId_Entrez::TId TEntrezId
TEntrezId type for entrez ids which require the same strictness as TGi.
Definition: ncbimisc.hpp:1041
string
Definition: cgiapp.hpp:687
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
Definition: ncbistre.hpp:149
Magic spell ;-) needed for some weird compilers... very empiric.
NCBI C++ stream class wrappers for triggering between "new" and "old" C++ stream libraries.
USING_SCOPE(objects)
USING_NCBI_SCOPE
Modified on Wed Apr 17 13:10:56 2024 by modify_doxy.py rev. 669887