NCBI C++ ToolKit
ID2_Request_ReGet_Blob_.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 ID2_Request_ReGet_Blob_.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/id2/id2.asn">id2.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/id2/id2.def">id2.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_ID2_ID2_REQUEST_REGET_BLOB_BASE_HPP
42 #define OBJECTS_ID2_ID2_REQUEST_REGET_BLOB_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
47 
48 #ifndef BEGIN_objects_SCOPE
49 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
50 # define END_objects_SCOPE END_SCOPE(objects)
51 #endif
52 BEGIN_objects_SCOPE // namespace ncbi::objects::
53 
54 
55 // forward declarations
56 class CID2_Blob_Id;
57 
58 
59 // generated classes
60 
61 
62 /** @addtogroup dataspec_NCBI_ID2Access
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 /// This is similar to FTP reget command.
69 /// It may be unsupported by server.
70 /// It's defined only for plain blobs (returned in ID2-Reply-Get-Blob)
71 /// as all split data comes in small chunks, so reget doesn't make sense.
72 ///
73 /// CID2_Request_ReGet_Blob_Base --
74 ///
75 
77 {
79 public:
80  // constructor
82  // destructor
83  virtual ~CID2_Request_ReGet_Blob_Base(void);
84 
85  // type info
87 
88  // types
90  typedef int TSplit_version;
91  typedef int TOffset;
92 
93  // member index
94  enum class E_memberIndex {
95  e__allMandatory = 0,
96  e_blob_id,
97  e_split_version,
98  e_offset
99  };
101 
102  // getters
103  // setters
104 
105  /// Check if a value has been assigned to Blob_id data member.
106  ///
107  /// Data member Blob_id is mandatory;
108  /// its type is defined as 'typedef CID2_Blob_Id TBlob_id'
109  /// @return
110  /// - true, if a value has been assigned.
111  /// - false, otherwise.
112  bool IsSetBlob_id(void) const;
113 
114  /// Check if it is safe to call GetBlob_id method.
115  ///
116  /// @return
117  /// - true, if the data member is getatable.
118  /// - false, otherwise.
119  bool CanGetBlob_id(void) const;
120 
121  /// Reset Blob_id data member.
122  void ResetBlob_id(void);
123 
124  /// Get the Blob_id member data.
125  ///
126  /// @return
127  /// Reference to the member data.
128  const TBlob_id& GetBlob_id(void) const;
129 
130  /// Assign a value to Blob_id data member.
131  ///
132  /// @param value
133  /// Reference to value.
134  void SetBlob_id(TBlob_id& value);
135 
136  /// Assign a value to Blob_id data member.
137  ///
138  /// @return
139  /// Reference to the data value.
140  TBlob_id& SetBlob_id(void);
141 
142  /// blob split version to resend
143  /// Check if a value has been assigned to Split_version data member.
144  ///
145  /// Data member Split_version is mandatory;
146  /// its type is defined as 'typedef int TSplit_version'
147  /// @return
148  /// - true, if a value has been assigned.
149  /// - false, otherwise.
150  bool IsSetSplit_version(void) const;
151 
152  /// Check if it is safe to call GetSplit_version method.
153  ///
154  /// @return
155  /// - true, if the data member is getatable.
156  /// - false, otherwise.
157  bool CanGetSplit_version(void) const;
158 
159  /// Reset Split_version data member.
160  void ResetSplit_version(void);
161 
162  /// Get the Split_version member data.
163  ///
164  /// @return
165  /// Copy of the member data.
166  TSplit_version GetSplit_version(void) const;
167 
168  /// Assign a value to Split_version data member.
169  ///
170  /// @param value
171  /// Value to assign
172  void SetSplit_version(TSplit_version value);
173 
174  /// Assign a value to Split_version data member.
175  ///
176  /// @return
177  /// Reference to the data value.
178  TSplit_version& SetSplit_version(void);
179 
180  /// start offset of data to get
181  /// Check if a value has been assigned to Offset data member.
182  ///
183  /// Data member Offset is mandatory;
184  /// its type is defined as 'typedef int TOffset'
185  /// @return
186  /// - true, if a value has been assigned.
187  /// - false, otherwise.
188  bool IsSetOffset(void) const;
189 
190  /// Check if it is safe to call GetOffset method.
191  ///
192  /// @return
193  /// - true, if the data member is getatable.
194  /// - false, otherwise.
195  bool CanGetOffset(void) const;
196 
197  /// Reset Offset data member.
198  void ResetOffset(void);
199 
200  /// Get the Offset member data.
201  ///
202  /// @return
203  /// Copy of the member data.
204  TOffset GetOffset(void) const;
205 
206  /// Assign a value to Offset data member.
207  ///
208  /// @param value
209  /// Value to assign
210  void SetOffset(TOffset value);
211 
212  /// Assign a value to Offset data member.
213  ///
214  /// @return
215  /// Reference to the data value.
216  TOffset& SetOffset(void);
217 
218  /// Reset the whole object
219  virtual void Reset(void);
220 
221 
222 private:
223  // Prohibit copy constructor and assignment operator
226 
227  // data
228  Uint4 m_set_State[1];
231  int m_Offset;
232 };
233 
234 /* @} */
235 
236 
237 
238 
239 
240 ///////////////////////////////////////////////////////////
241 ///////////////////// inline methods //////////////////////
242 ///////////////////////////////////////////////////////////
243 inline
245 {
246  return m_Blob_id.NotEmpty();
247 }
248 
249 inline
251 {
252  return true;
253 }
254 
255 inline
257 {
258  if ( !m_Blob_id ) {
259  const_cast<CID2_Request_ReGet_Blob_Base*>(this)->ResetBlob_id();
260  }
261  return (*m_Blob_id);
262 }
263 
264 inline
266 {
267  if ( !m_Blob_id ) {
268  ResetBlob_id();
269  }
270  return (*m_Blob_id);
271 }
272 
273 inline
275 {
276  return ((m_set_State[0] & 0xc) != 0);
277 }
278 
279 inline
281 {
282  return IsSetSplit_version();
283 }
284 
285 inline
287 {
288  m_Split_version = 0;
289  m_set_State[0] &= ~0xc;
290 }
291 
292 inline
294 {
295  if (!CanGetSplit_version()) {
296  ThrowUnassigned(1);
297  }
298  return m_Split_version;
299 }
300 
301 inline
303 {
305  m_set_State[0] |= 0xc;
306 }
307 
308 inline
310 {
311 #ifdef _DEBUG
312  if (!IsSetSplit_version()) {
314  }
315 #endif
316  m_set_State[0] |= 0x4;
317  return m_Split_version;
318 }
319 
320 inline
322 {
323  return ((m_set_State[0] & 0x30) != 0);
324 }
325 
326 inline
328 {
329  return IsSetOffset();
330 }
331 
332 inline
334 {
335  m_Offset = 0;
336  m_set_State[0] &= ~0x30;
337 }
338 
339 inline
341 {
342  if (!CanGetOffset()) {
343  ThrowUnassigned(2);
344  }
345  return m_Offset;
346 }
347 
348 inline
350 {
351  m_Offset = value;
352  m_set_State[0] |= 0x30;
353 }
354 
355 inline
357 {
358 #ifdef _DEBUG
359  if (!IsSetOffset()) {
360  memset(&m_Offset,UnassignedByte(),sizeof(m_Offset));
361  }
362 #endif
363  m_set_State[0] |= 0x10;
364  return m_Offset;
365 }
366 
367 ///////////////////////////////////////////////////////////
368 ////////////////// end of inline methods //////////////////
369 ///////////////////////////////////////////////////////////
370 
371 
372 
373 
374 
375 END_objects_SCOPE // namespace ncbi::objects::
376 
378 
379 
380 #endif // OBJECTS_ID2_ID2_REQUEST_REGET_BLOB_BASE_HPP
CID2_Blob_Id –.
Definition: ID2_Blob_Id.hpp:66
This is similar to FTP reget command.
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
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_ID2_EXPORT
Definition: ncbi_export.h:552
void ResetBlob_id(void)
Reset Blob_id data member.
CID2_Request_ReGet_Blob_Base(const CID2_Request_ReGet_Blob_Base &)
TSplit_version & SetSplit_version(void)
Assign a value to Split_version data member.
TOffset GetOffset(void) const
Get the Offset member data.
void ResetSplit_version(void)
Reset Split_version data member.
TSplit_version GetSplit_version(void) const
Get the Split_version member data.
void ResetOffset(void)
Reset Offset data member.
const TBlob_id & GetBlob_id(void) const
Get the Blob_id member data.
bool IsSetOffset(void) const
start offset of data to get Check if a value has been assigned to Offset data member.
TOffset & SetOffset(void)
Assign a value to Offset data member.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
bool IsSetBlob_id(void) const
Check if a value has been assigned to Blob_id data member.
bool CanGetBlob_id(void) const
Check if it is safe to call GetBlob_id method.
bool CanGetOffset(void) const
Check if it is safe to call GetOffset method.
CID2_Request_ReGet_Blob_Base & operator=(const CID2_Request_ReGet_Blob_Base &)
TBlob_id & SetBlob_id(void)
Assign a value to Blob_id data member.
bool CanGetSplit_version(void) const
Check if it is safe to call GetSplit_version method.
bool IsSetSplit_version(void) const
blob split version to resend Check if a value has been assigned to Split_version data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed May 15 15:10:35 2024 by modify_doxy.py rev. 669887