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

Go to the SVN repository for this file.

1 /* $Id$
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 Result_.hpp
29 /// Data storage class.
30 ///
31 /// This file was generated by application DATATOOL
32 /// using the following specifications:
33 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objtools/eutils/egquery/egquery.dtd">egquery.dtd</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objtools/eutils/egquery/egquery.def">egquery.def</a>
36 ///
37 /// ATTENTION:
38 /// Don't edit or commit this file into CVS as this file will
39 /// be overridden (by DATATOOL) without warning!
40 
41 #ifndef egquery__OBJTOOLS_EUTILS_EGQUERY_RESULT_BASE_HPP
42 #define egquery__OBJTOOLS_EUTILS_EGQUERY_RESULT_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
49 
50 #ifndef BEGIN_egquery_SCOPE
51 # define BEGIN_egquery_SCOPE BEGIN_SCOPE(egquery)
52 # define END_egquery_SCOPE END_SCOPE(egquery)
53 #endif
54 BEGIN_egquery_SCOPE // namespace egquery::
55 
56 
57 // forward declarations
58 class CEGQueryResult;
59 
60 
61 // generated classes
62 
63 
64 /** @addtogroup dataspec_egquery
65  *
66  * @{
67  */
68 
69 /////////////////////////////////////////////////////////////////////////////
70 ///
71 /// CResult_Base --
72 ///
73 
74 class NCBI_EUTILS_EXPORT CResult_Base : public NCBI_NS_NCBI::CSerialObject
75 {
76  typedef NCBI_NS_NCBI::CSerialObject Tparent;
77 public:
78  // constructor
79  CResult_Base(void);
80  // destructor
81  virtual ~CResult_Base(void);
82 
83  // type info
85 
86  // types
89 
90  // member index
91  enum class E_memberIndex {
92  e__allMandatory = 0,
93  e_Term,
94  e_eGQueryResult
95  };
96  typedef Tparent::CMemberIndex<E_memberIndex, 3> TmemberIndex;
97 
98  // getters
99  // setters
100 
101  /// .+
102  /// Check if a value has been assigned to Term data member.
103  ///
104  /// Data member Term is mandatory;
105  /// its type is defined as 'typedef NCBI_NS_STD::string TTerm'
106  /// @return
107  /// - true, if a value has been assigned.
108  /// - false, otherwise.
109  bool IsSetTerm(void) const;
110 
111  /// Check if it is safe to call GetTerm method.
112  ///
113  /// @return
114  /// - true, if the data member is getatable.
115  /// - false, otherwise.
116  bool CanGetTerm(void) const;
117 
118  /// Reset Term data member.
119  void ResetTerm(void);
120 
121  /// Get the Term member data.
122  ///
123  /// @return
124  /// Reference to the member data.
125  const TTerm& GetTerm(void) const;
126 
127  /// Assign a value to Term data member.
128  ///
129  /// @param value
130  /// Value to assign
131  void SetTerm(const TTerm& value);
132  void SetTerm(TTerm&& value);
133 
134  /// Assign a value to Term data member.
135  ///
136  /// @return
137  /// Reference to the data value.
138  TTerm& SetTerm(void);
139 
140  /// Check if a value has been assigned to EGQueryResult data member.
141  ///
142  /// Data member EGQueryResult is mandatory;
143  /// its type is defined as 'typedef CEGQueryResult TEGQueryResult'
144  /// @return
145  /// - true, if a value has been assigned.
146  /// - false, otherwise.
147  bool IsSetEGQueryResult(void) const;
148 
149  /// Check if it is safe to call GetEGQueryResult method.
150  ///
151  /// @return
152  /// - true, if the data member is getatable.
153  /// - false, otherwise.
154  bool CanGetEGQueryResult(void) const;
155 
156  /// Reset EGQueryResult data member.
157  void ResetEGQueryResult(void);
158 
159  /// Get the EGQueryResult member data.
160  ///
161  /// @return
162  /// Reference to the member data.
163  const TEGQueryResult& GetEGQueryResult(void) const;
164 
165  /// Assign a value to EGQueryResult data member.
166  ///
167  /// @param value
168  /// Reference to value.
169  void SetEGQueryResult(TEGQueryResult& value);
170 
171  /// Assign a value to EGQueryResult data member.
172  ///
173  /// @return
174  /// Reference to the data value.
175  TEGQueryResult& SetEGQueryResult(void);
176 
177  /// Reset the whole object
178  virtual void Reset(void);
179 
180 
181 private:
182  // Prohibit copy constructor and assignment operator
185 
186  // data
187  Uint4 m_set_State[1];
189  NCBI_NS_NCBI::CRef< TEGQueryResult > m_EGQueryResult;
190 };
191 
192 /* @} */
193 
194 
195 
196 
197 
198 ///////////////////////////////////////////////////////////
199 ///////////////////// inline methods //////////////////////
200 ///////////////////////////////////////////////////////////
201 inline
202 bool CResult_Base::IsSetTerm(void) const
203 {
204  return ((m_set_State[0] & 0x3) != 0);
205 }
206 
207 inline
208 bool CResult_Base::CanGetTerm(void) const
209 {
210  return IsSetTerm();
211 }
212 
213 inline
215 {
216  if (!CanGetTerm()) {
217  ThrowUnassigned(0);
218  }
219  return m_Term;
220 }
221 
222 inline
224 {
225  m_Term = value;
226  m_set_State[0] |= 0x3;
227 }
228 
229 inline
231 {
232  m_Term = std::forward<CResult_Base::TTerm>(value);
233  m_set_State[0] |= 0x3;
234 }
235 
236 inline
238 {
239 #ifdef _DEBUG
240  if (!IsSetTerm()) {
241  m_Term = UnassignedString();
242  }
243 #endif
244  m_set_State[0] |= 0x1;
245  return m_Term;
246 }
247 
248 inline
250 {
251  return m_EGQueryResult.NotEmpty();
252 }
253 
254 inline
256 {
257  return true;
258 }
259 
260 inline
262 {
263  if ( !m_EGQueryResult ) {
264  const_cast<CResult_Base*>(this)->ResetEGQueryResult();
265  }
266  return (*m_EGQueryResult);
267 }
268 
269 inline
271 {
272  if ( !m_EGQueryResult ) {
274  }
275  return (*m_EGQueryResult);
276 }
277 
278 ///////////////////////////////////////////////////////////
279 ////////////////// end of inline methods //////////////////
280 ///////////////////////////////////////////////////////////
281 
282 
283 
284 
285 
286 END_egquery_SCOPE // namespace egquery::
287 
288 
289 #endif // egquery__OBJTOOLS_EUTILS_EGQUERY_RESULT_BASE_HPP
#define END_egquery_SCOPE
Definition: Result_.hpp:52
#define BEGIN_egquery_SCOPE
Definition: Result_.hpp:51
CEGQueryResult –.
CResult_Base –.
Definition: Result_.hpp:75
string
Definition: cgiapp.hpp:687
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
#define NCBI_EUTILS_EXPORT
Definition: ncbi_export.h:1460
const TEGQueryResult & GetEGQueryResult(void) const
Get the EGQueryResult member data.
Definition: Result_.hpp:261
NCBI_NS_NCBI::CSerialObject Tparent
Definition: Result_.hpp:76
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
Definition: Result_.hpp:96
NCBI_NS_STD::string TTerm
Definition: Result_.hpp:87
CResult_Base(const CResult_Base &)
NCBI_NS_NCBI::CRef< TEGQueryResult > m_EGQueryResult
Definition: Result_.hpp:189
Uint4 m_set_State[1]
Definition: Result_.hpp:187
const TTerm & GetTerm(void) const
Get the Term member data.
Definition: Result_.hpp:214
TTerm & SetTerm(void)
Assign a value to Term data member.
Definition: Result_.hpp:237
DECLARE_INTERNAL_TYPE_INFO()
bool IsSetEGQueryResult(void) const
Check if a value has been assigned to EGQueryResult data member.
Definition: Result_.hpp:249
NCBI_NS_STD::string m_Term
Definition: Result_.hpp:188
bool IsSetTerm(void) const
Definition: Result_.hpp:202
CResult_Base & operator=(const CResult_Base &)
void ResetEGQueryResult(void)
Reset EGQueryResult data member.
Definition: Result_.cpp:55
bool CanGetEGQueryResult(void) const
Check if it is safe to call GetEGQueryResult method.
Definition: Result_.hpp:255
CEGQueryResult TEGQueryResult
Definition: Result_.hpp:88
TEGQueryResult & SetEGQueryResult(void)
Assign a value to EGQueryResult data member.
Definition: Result_.hpp:270
bool CanGetTerm(void) const
Check if it is safe to call GetTerm method.
Definition: Result_.hpp:208
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Thu May 23 12:32:33 2024 by modify_doxy.py rev. 669887