NCBI C++ ToolKit
Remap_request_.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 Remap_request_.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/objects/remap/remap.asn">remap.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/remap/remap.def">remap.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 OBJECTS_REMAP_REMAP_REQUEST_BASE_HPP
42 #define OBJECTS_REMAP_REMAP_REQUEST_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
49 
51 
52 #ifndef BEGIN_objects_SCOPE
53 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
54 # define END_objects_SCOPE END_SCOPE(objects)
55 #endif
56 BEGIN_objects_SCOPE // namespace ncbi::objects::
57 
58 
59 // forward declarations
60 class CRMRequest;
61 
62 
63 // generated classes
64 
65 
66 /** @addtogroup dataspec_NCBI_Remap
67  *
68  * @{
69  */
70 
71 /////////////////////////////////////////////////////////////////////////////
72 ///***************************************
73 /// Remap Request types
74 ///***************************************
75 ///****************************************
76 /// The basic request wrapper leaves space for a version which
77 /// allow the server to support older clients
78 /// The tool parameter allows us to log the client types for
79 /// debugging and tuning
80 ///****************************************
81 /// a standard request
82 ///
83 /// CRemap_request_Base --
84 ///
85 
87 {
89 public:
90  // constructor
91  CRemap_request_Base(void);
92  // destructor
93  virtual ~CRemap_request_Base(void);
94 
95  // type info
97 
98  // types
100  typedef int TVersion;
101  typedef string TTool;
102 
103  // member index
104  enum class E_memberIndex {
105  e__allMandatory = 0,
106  e_request,
107  e_version,
108  e_tool
109  };
111 
112  // getters
113  // setters
114 
115  /// the actual request
116  /// Check if a value has been assigned to Request data member.
117  ///
118  /// Data member Request is mandatory;
119  /// its type is defined as 'typedef CRMRequest TRequest'
120  /// @return
121  /// - true, if a value has been assigned.
122  /// - false, otherwise.
123  bool IsSetRequest(void) const;
124 
125  /// Check if it is safe to call GetRequest method.
126  ///
127  /// @return
128  /// - true, if the data member is getatable.
129  /// - false, otherwise.
130  bool CanGetRequest(void) const;
131 
132  /// Reset Request data member.
133  void ResetRequest(void);
134 
135  /// Get the Request member data.
136  ///
137  /// @return
138  /// Reference to the member data.
139  const TRequest& GetRequest(void) const;
140 
141  /// Assign a value to Request data member.
142  ///
143  /// @param value
144  /// Reference to value.
145  void SetRequest(TRequest& value);
146 
147  /// Assign a value to Request data member.
148  ///
149  /// @return
150  /// Reference to the data value.
151  TRequest& SetRequest(void);
152 
153  /// ASN1 spec version
154  /// Check if a value has been assigned to Version data member.
155  ///
156  /// Data member Version is mandatory;
157  /// its type is defined as 'typedef int TVersion'
158  /// @return
159  /// - true, if a value has been assigned.
160  /// - false, otherwise.
161  bool IsSetVersion(void) const;
162 
163  /// Check if it is safe to call GetVersion method.
164  ///
165  /// @return
166  /// - true, if the data member is getatable.
167  /// - false, otherwise.
168  bool CanGetVersion(void) const;
169 
170  /// Reset Version data member.
171  void ResetVersion(void);
172 
173  /// Get the Version member data.
174  ///
175  /// @return
176  /// Copy of the member data.
177  TVersion GetVersion(void) const;
178 
179  /// Assign a value to Version data member.
180  ///
181  /// @param value
182  /// Value to assign
183  void SetVersion(TVersion value);
184 
185  /// Assign a value to Version data member.
186  ///
187  /// @return
188  /// Reference to the data value.
189  TVersion& SetVersion(void);
190 
191  /// tool making request
192  /// Check if a value has been assigned to Tool data member.
193  ///
194  /// Data member Tool is optional;
195  /// its type is defined as 'typedef string TTool'
196  /// @return
197  /// - true, if a value has been assigned.
198  /// - false, otherwise.
199  bool IsSetTool(void) const;
200 
201  /// Check if it is safe to call GetTool method.
202  ///
203  /// @return
204  /// - true, if the data member is getatable.
205  /// - false, otherwise.
206  bool CanGetTool(void) const;
207 
208  /// Reset Tool data member.
209  void ResetTool(void);
210 
211  /// Get the Tool member data.
212  ///
213  /// @return
214  /// Reference to the member data.
215  const TTool& GetTool(void) const;
216 
217  /// Assign a value to Tool data member.
218  ///
219  /// @param value
220  /// Value to assign
221  void SetTool(const TTool& value);
222  void SetTool(TTool&& value);
223 
224  /// Assign a value to Tool data member.
225  ///
226  /// @return
227  /// Reference to the data value.
228  TTool& SetTool(void);
229 
230  /// Reset the whole object
231  virtual void Reset(void);
232 
233 
234 private:
235  // Prohibit copy constructor and assignment operator
238 
239  // data
240  Uint4 m_set_State[1];
243  string m_Tool;
244 };
245 
246 /* @} */
247 
248 
249 
250 
251 
252 ///////////////////////////////////////////////////////////
253 ///////////////////// inline methods //////////////////////
254 ///////////////////////////////////////////////////////////
255 inline
257 {
258  return m_Request.NotEmpty();
259 }
260 
261 inline
263 {
264  return true;
265 }
266 
267 inline
269 {
270  if ( !m_Request ) {
271  const_cast<CRemap_request_Base*>(this)->ResetRequest();
272  }
273  return (*m_Request);
274 }
275 
276 inline
278 {
279  if ( !m_Request ) {
280  ResetRequest();
281  }
282  return (*m_Request);
283 }
284 
285 inline
287 {
288  return ((m_set_State[0] & 0xc) != 0);
289 }
290 
291 inline
293 {
294  return IsSetVersion();
295 }
296 
297 inline
299 {
300  m_Version = 0;
301  m_set_State[0] &= ~0xc;
302 }
303 
304 inline
306 {
307  if (!CanGetVersion()) {
308  ThrowUnassigned(1);
309  }
310  return m_Version;
311 }
312 
313 inline
315 {
316  m_Version = value;
317  m_set_State[0] |= 0xc;
318 }
319 
320 inline
322 {
323 #ifdef _DEBUG
324  if (!IsSetVersion()) {
325  memset(&m_Version,UnassignedByte(),sizeof(m_Version));
326  }
327 #endif
328  m_set_State[0] |= 0x4;
329  return m_Version;
330 }
331 
332 inline
334 {
335  return ((m_set_State[0] & 0x30) != 0);
336 }
337 
338 inline
340 {
341  return IsSetTool();
342 }
343 
344 inline
346 {
347  if (!CanGetTool()) {
348  ThrowUnassigned(2);
349  }
350  return m_Tool;
351 }
352 
353 inline
355 {
356  m_Tool = value;
357  m_set_State[0] |= 0x30;
358 }
359 
360 inline
362 {
363  m_Tool = std::forward<CRemap_request_Base::TTool>(value);
364  m_set_State[0] |= 0x30;
365 }
366 
367 inline
369 {
370 #ifdef _DEBUG
371  if (!IsSetTool()) {
373  }
374 #endif
375  m_set_State[0] |= 0x10;
376  return m_Tool;
377 }
378 
379 ///////////////////////////////////////////////////////////
380 ////////////////// end of inline methods //////////////////
381 ///////////////////////////////////////////////////////////
382 
383 
384 
385 
386 
387 END_objects_SCOPE // namespace ncbi::objects::
388 
390 
391 
392 #endif // OBJECTS_REMAP_REMAP_REQUEST_BASE_HPP
CRMRequest –.
Definition: RMRequest.hpp:66
CRef –.
Definition: ncbiobj.hpp:618
*************************************** Remap Request types *************************************** *...
Base class for all serializable objects.
Definition: serialbase.hpp:150
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
static string UnassignedString(void)
Definition: serialbase.hpp:175
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h: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_REMAP_EXPORT
Definition: ncbi_export.h:728
bool IsSetVersion(void) const
ASN1 spec version Check if a value has been assigned to Version data member.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
const TTool & GetTool(void) const
Get the Tool member data.
CSerialObject Tparent
bool IsSetRequest(void) const
the actual request Check if a value has been assigned to Request data member.
void ResetRequest(void)
Reset Request data member.
TRequest & SetRequest(void)
Assign a value to Request data member.
CRemap_request_Base(const CRemap_request_Base &)
CRef< TRequest > m_Request
void ResetVersion(void)
Reset Version data member.
TVersion & SetVersion(void)
Assign a value to Version data member.
bool CanGetRequest(void) const
Check if it is safe to call GetRequest method.
bool CanGetVersion(void) const
Check if it is safe to call GetVersion method.
CRemap_request_Base & operator=(const CRemap_request_Base &)
TTool & SetTool(void)
Assign a value to Tool data member.
bool IsSetTool(void) const
tool making request Check if a value has been assigned to Tool data member.
TVersion GetVersion(void) const
Get the Version member data.
bool CanGetTool(void) const
Check if it is safe to call GetTool method.
const TRequest & GetRequest(void) const
Get the Request member data.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:58:20 2024 by modify_doxy.py rev. 669887