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

Go to the SVN repository for this file.

1 /* $Id: id2_client.hpp 89581 2020-04-08 16:20:52Z ucko $
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  */
27 
28 /// @file id2_client.hpp
29 /// User-defined methods of the data storage class.
30 ///
31 /// This file was originally generated by application DATATOOL
32 /// using the following specifications:
33 /// 'id2.asn'.
34 ///
35 /// New methods or data members can be added to it if needed.
36 /// See also: id2_client_.hpp
37 
38 
39 #ifndef OBJECTS_ID2_ID2_CLIENT_HPP
40 #define OBJECTS_ID2_ID2_CLIENT_HPP
41 
42 
43 // generated includes
45 
46 // generated classes
47 
49 
50 BEGIN_objects_SCOPE // namespace ncbi::objects::
51 
53 
54 /////////////////////////////////////////////////////////////////////////////
56 {
58 public:
59  // constructor
60  CID2Client(void);
61  // destructor
62  ~CID2Client(void);
63 
64  // ID2 allows multuple replies on each request, so we have to override
65  // default ReadReply. The Ask() methods return only the last reply,
66  // all replies are available via GetAllReplies() method.
67  typedef vector< CRef<TReply> > TReplies;
68  const TReplies& GetAllReplies(void)
69  { return m_Replies; }
70 
71  void JustAsk(const CID2_Request_Packet& packet);
72  void JustAsk(const CID2_Request& request);
73  void JustFetch(CID2_Reply& reply)
74  { ReadReply(*m_In, reply); }
75 
76 protected:
77  // ID2 requires requests to be sent in ID2-Request-Packet that may hold
78  // several requests, so we have to override default WriteRequest.
79  virtual void WriteRequest(CObjectOStream& out, const TRequest& request);
80 
81  // ID2 allows multuple replies on each request, so we have to override
82  // default ReadReply. The Ask() methods return only the last reply,
83  // all replies are available via GetAllReplies() method.
84  virtual void ReadReply(CObjectIStream& in, TReply& reply);
85 
86 private:
88 
89 private:
90  // Prohibit copy constructor and assignment operator
93 
94 };
95 
96 /////////////////// CID2Client inline methods
97 
98 // constructor
99 inline
101 {
102 }
103 
104 
105 /////////////////// end of CID2Client inline methods
106 
107 
108 END_objects_SCOPE // namespace ncbi::objects::
109 
111 
112 
113 #endif // OBJECTS_ID2_ID2_CLIENT_HPP
CID2Client_Base –.
Definition: id2_client_.hpp:75
CID2Client & operator=(const CID2Client &value)
CID2Client(const CID2Client &value)
TReplies m_Replies
Definition: id2_client.hpp:87
vector< CRef< TReply > > TReplies
Definition: id2_client.hpp:67
CID2Client_Base Tparent
Definition: id2_client.hpp:57
const TReplies & GetAllReplies(void)
Definition: id2_client.hpp:68
CID2Client(void)
Definition: id2_client.hpp:100
void JustFetch(CID2_Reply &reply)
Definition: id2_client.hpp:73
CID2_Reply –.
Definition: ID2_Reply.hpp:66
CID2_Request_Packet –.
CID2_Request –.
Definition: ID2_Request.hpp:66
CObjectIStream –.
Definition: objistr.hpp:93
CObjectOStream –.
Definition: objostr.hpp:83
std::ofstream out("events_result.xml")
main entry point for tests
virtual void ReadReply(CObjectIStream &in, CID2_Reply &reply)
Definition: rpcbase.hpp:93
virtual void WriteRequest(CObjectOStream &out, const CID2_Request &request)
Definition: rpcbase.hpp:90
#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_ID2_EXPORT
Definition: ncbi_export.h:552
Data storage class.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
std::istream & in(std::istream &in_, double &x_)
Modified on Mon Jun 17 05:05:08 2024 by modify_doxy.py rev. 669887