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

Go to the SVN repository for this file.

1 /* $Id: entrez2_client.hpp 69190 2015-10-08 14:03:49Z grichenk $
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: Aaron Ucko, NCBI
27  *
28  * File Description:
29  * Entrez2 network client
30  *
31  * Remark:
32  * This code was originally generated by application DATATOOL
33  * using specifications from the data definition file
34  * 'entrez2.asn'.
35  */
36 
37 #ifndef OBJECTS_ENTREZ2_ENTREZ2_CLIENT_HPP
38 #define OBJECTS_ENTREZ2_ENTREZ2_CLIENT_HPP
39 
40 
41 // generated includes
43 
47 
48 
49 // generated classes
50 
52 
53 BEGIN_objects_SCOPE // namespace ncbi::objects::
54 
55 
57 {
59 public:
60  typedef TIntId TUid;
61 
62  // constructor
63  CEntrez2Client(void);
64  // destructor
65  ~CEntrez2Client(void);
66 
67  /// A simplified interface for getting neighbors (links)
68 
69  /// Get ids of neigbors of a specified type.
70  /// db is, e.g., "nucleotide" or "protein" (depending on the query).
71  /// link_type is, for example, "nucleotide_nucleotide".
72 
73  /// This form just yields a vector of UIDs
74  void GetNeighbors(TUid query_uid,
75  const string& db_from,
76  const string& db_to,
77  vector<TUid>& neighbor_uids);
78 
79  /// This form just yields a vector of UIDs, taking a vector of UIDs
80  void GetNeighbors(const vector<TUid>& query_uids,
81  const string& db,
82  const string& link_type,
83  vector<TUid>& neighbor_uids);
84 
85  /// This form returns the entire CEntrez2_link_set object,
86  /// which includes scores.
87  CRef<CEntrez2_link_set> GetNeighbors(TUid query_uid,
88  const string& db_from,
89  const string& db_to);
90 
91  /// This form returns the entire CEntrez2_link_set object,
92  /// which includes scores.
93  CRef<CEntrez2_link_set> GetNeighbors(const vector<TUid>& query_uids,
94  const string& db_from,
95  const string& db_to);
96 
97  /// Retrieve counts of the various types of neighbors available
98  CRef<CEntrez2_link_count_list> GetNeighborCounts(TUid query_uid,
99  const string& db);
100 
101  /// Some other simplified interfaces
102 
103  /// Query a db with a string, returning uids as integers
104  void Query(const string& query,
105  const string& db,
106  vector<TUid>& result_uids,
107  size_t start_offs = 0,
108  size_t count = 0,
109  TReply* reply = 0);
110 
111  /// Given some uids, a database, and an entrez query string,
112  /// determine which of these uids match the query string.
113  ///
114  /// Note: If a uid appears more than once in query_uids and
115  /// matches the query string, it may or may not appear more
116  /// more than once in the result.
117  void FilterIds(const vector<TUid>& query_uids,
118  const string& db,
119  const string& query_string,
120  vector<TUid>& result_uids);
121 
122  /// Retrieve the docsums for a set of UIDs
123  CRef<CEntrez2_docsum_list> GetDocsums(const vector<TUid>& uids,
124  const string& db);
125 
126  /// Retrieve the docsums for a single UID
127  CRef<CEntrez2_docsum_list> GetDocsums(TUid uid,
128  const string& db);
129 
130 #ifdef NCBI_STRICT_GI
131  void GetNeighbors(TGi query_uid, const string& db_from,
132  const string& db_to,
133  vector<TGi>& neighbor_uids);
134  void GetNeighbors(const vector<TGi>& query_uids,
135  const string& db,
136  const string& link_type,
137  vector<TGi>& neighbor_uids);
138  CRef<CEntrez2_link_set> GetNeighbors(TGi query_uid,
139  const string& db_from,
140  const string& db_to);
141  CRef<CEntrez2_link_set> GetNeighbors(const vector<TGi>& query_uids,
142  const string& db_from,
143  const string& db_to);
144  CRef<CEntrez2_link_count_list> GetNeighborCounts(TGi query_uid,
145  const string& db);
146  void Query(const string& query, const string& db,
147  vector<TGi>& result_uids,
148  size_t start_offs = 0, size_t count = 0,
149  TReply* reply = 0);
150  void FilterIds(const vector<TGi>& query_uids, const string& db,
151  const string& query_string,
152  vector<TGi>& result_uids);
153  CRef<CEntrez2_docsum_list> GetDocsums(const vector<TGi>& uids,
154  const string& db);
155  CRef<CEntrez2_docsum_list> GetDocsums(TGi uid,
156  const string& db);
157 #endif
158 
159 protected:
160  /// Get DB affinity of the request
161  virtual string GetAffinity(const CEntrez2_request& request) const;
162 
163 private:
164  // Prohibit copy constructor and assignment operator
167 };
168 
169 
170 
171 /////////////////// CEntrez2Client inline methods
172 
173 // constructor
174 inline
176 {
177  SetDefaultRequest().SetTool("CEntrez2Client");
179 }
180 
181 
182 /////////////////// end of CEntrez2Client inline methods
183 
184 
185 END_objects_SCOPE // namespace ncbi::objects::
186 
188 
189 #endif // OBJECTS_ENTREZ2_ENTREZ2_CLIENT_HPP
190 /* Original file checksum: lines: 93, chars: 2440, CRC32: 16aa1713 */
User-defined methods of the data storage class.
CEntrez2Client_Base –.
CEntrez2Client & operator=(const CEntrez2Client &value)
CEntrez2Client(const CEntrez2Client &value)
CEntrez2Client_Base Tparent
CEntrez2_reply –.
CEntrez2_request –.
CRef –.
Definition: ncbiobj.hpp:618
Data storage class.
Int8 TIntId
Definition: ncbimisc.hpp:999
virtual string GetAffinity(const CEntrez2_request &) const
Definition: rpcbase.hpp:103
#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_ENTREZ2_EXPORT
Definition: ncbi_export.h:464
void SetVersion(TVersion value)
Assign a value to Version data member.
void SetTool(const TTool &value)
Assign a value to Tool data member.
virtual TRequest & SetDefaultRequest(void)
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
static string query
Modified on Wed Apr 17 13:08:24 2024 by modify_doxy.py rev. 669887