NCBI C++ ToolKit
ID2S_Reply_Get_Split_Info_.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 ID2S_Reply_Get_Split_Info_.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_ID2S_REPLY_GET_SPLIT_INFO_BASE_HPP
42 #define OBJECTS_ID2_ID2S_REPLY_GET_SPLIT_INFO_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 class CID2_Reply_Data;
58 
59 
60 // generated classes
61 
62 
63 /** @addtogroup dataspec_NCBI_ID2Access
64  *
65  * @{
66  */
67 
68 /////////////////////////////////////////////////////////////////////////////
69 /// Reply to ID2-Request-Get-Blob-Info.
70 ///
71 /// CID2S_Reply_Get_Split_Info_Base --
72 ///
73 
75 {
77 public:
78  // constructor
80  // destructor
81  virtual ~CID2S_Reply_Get_Split_Info_Base(void);
82 
83  // type info
85 
86  // types
88  typedef int TSplit_version;
90  typedef int TBlob_state;
91 
92  // member index
93  enum class E_memberIndex {
94  e__allMandatory = 0,
95  e_blob_id,
96  e_split_version,
97  e_data,
98  e_blob_state
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  /// version of split data
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  /// blob split info
181  /// not set if error occurred
182  /// Check if a value has been assigned to Data data member.
183  ///
184  /// Data member Data is optional;
185  /// its type is defined as 'typedef CID2_Reply_Data TData'
186  /// @return
187  /// - true, if a value has been assigned.
188  /// - false, otherwise.
189  bool IsSetData(void) const;
190 
191  /// Check if it is safe to call GetData method.
192  ///
193  /// @return
194  /// - true, if the data member is getatable.
195  /// - false, otherwise.
196  bool CanGetData(void) const;
197 
198  /// Reset Data data member.
199  void ResetData(void);
200 
201  /// Get the Data member data.
202  ///
203  /// @return
204  /// Reference to the member data.
205  const TData& GetData(void) const;
206 
207  /// Assign a value to Data data member.
208  ///
209  /// @param value
210  /// Reference to value.
211  void SetData(TData& value);
212 
213  /// Assign a value to Data data member.
214  ///
215  /// @return
216  /// Reference to the data value.
217  TData& SetData(void);
218 
219  /// state bits of the blob, 0 or missing means regular live data
220  /// Check if a value has been assigned to Blob_state data member.
221  ///
222  /// Data member Blob_state is optional;
223  /// its type is defined as 'typedef int TBlob_state'
224  /// @return
225  /// - true, if a value has been assigned.
226  /// - false, otherwise.
227  bool IsSetBlob_state(void) const;
228 
229  /// Check if it is safe to call GetBlob_state method.
230  ///
231  /// @return
232  /// - true, if the data member is getatable.
233  /// - false, otherwise.
234  bool CanGetBlob_state(void) const;
235 
236  /// Reset Blob_state data member.
237  void ResetBlob_state(void);
238 
239  /// Get the Blob_state member data.
240  ///
241  /// @return
242  /// Copy of the member data.
243  TBlob_state GetBlob_state(void) const;
244 
245  /// Assign a value to Blob_state data member.
246  ///
247  /// @param value
248  /// Value to assign
249  void SetBlob_state(TBlob_state value);
250 
251  /// Assign a value to Blob_state data member.
252  ///
253  /// @return
254  /// Reference to the data value.
255  TBlob_state& SetBlob_state(void);
256 
257  /// Reset the whole object
258  virtual void Reset(void);
259 
260 
261 private:
262  // Prohibit copy constructor and assignment operator
265 
266  // data
267  Uint4 m_set_State[1];
272 };
273 
274 /* @} */
275 
276 
277 
278 
279 
280 ///////////////////////////////////////////////////////////
281 ///////////////////// inline methods //////////////////////
282 ///////////////////////////////////////////////////////////
283 inline
285 {
286  return m_Blob_id.NotEmpty();
287 }
288 
289 inline
291 {
292  return true;
293 }
294 
295 inline
297 {
298  if ( !m_Blob_id ) {
299  const_cast<CID2S_Reply_Get_Split_Info_Base*>(this)->ResetBlob_id();
300  }
301  return (*m_Blob_id);
302 }
303 
304 inline
306 {
307  if ( !m_Blob_id ) {
308  ResetBlob_id();
309  }
310  return (*m_Blob_id);
311 }
312 
313 inline
315 {
316  return ((m_set_State[0] & 0xc) != 0);
317 }
318 
319 inline
321 {
322  return IsSetSplit_version();
323 }
324 
325 inline
327 {
328  m_Split_version = 0;
329  m_set_State[0] &= ~0xc;
330 }
331 
332 inline
334 {
335  if (!CanGetSplit_version()) {
336  ThrowUnassigned(1);
337  }
338  return m_Split_version;
339 }
340 
341 inline
343 {
345  m_set_State[0] |= 0xc;
346 }
347 
348 inline
350 {
351 #ifdef _DEBUG
352  if (!IsSetSplit_version()) {
354  }
355 #endif
356  m_set_State[0] |= 0x4;
357  return m_Split_version;
358 }
359 
360 inline
362 {
363  return m_Data.NotEmpty();
364 }
365 
366 inline
368 {
369  return IsSetData();
370 }
371 
372 inline
374 {
375  if (!CanGetData()) {
376  ThrowUnassigned(2);
377  }
378  return (*m_Data);
379 }
380 
381 inline
383 {
384  return ((m_set_State[0] & 0xc0) != 0);
385 }
386 
387 inline
389 {
390  return IsSetBlob_state();
391 }
392 
393 inline
395 {
396  m_Blob_state = 0;
397  m_set_State[0] &= ~0xc0;
398 }
399 
400 inline
402 {
403  if (!CanGetBlob_state()) {
404  ThrowUnassigned(3);
405  }
406  return m_Blob_state;
407 }
408 
409 inline
411 {
413  m_set_State[0] |= 0xc0;
414 }
415 
416 inline
418 {
419 #ifdef _DEBUG
420  if (!IsSetBlob_state()) {
421  memset(&m_Blob_state,UnassignedByte(),sizeof(m_Blob_state));
422  }
423 #endif
424  m_set_State[0] |= 0x40;
425  return m_Blob_state;
426 }
427 
428 ///////////////////////////////////////////////////////////
429 ////////////////// end of inline methods //////////////////
430 ///////////////////////////////////////////////////////////
431 
432 
433 
434 
435 
436 END_objects_SCOPE // namespace ncbi::objects::
437 
439 
440 
441 #endif // OBJECTS_ID2_ID2S_REPLY_GET_SPLIT_INFO_BASE_HPP
Reply to ID2-Request-Get-Blob-Info.
CID2_Blob_Id –.
Definition: ID2_Blob_Id.hpp:66
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
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty – pointing to an object and has a non-null value.
Definition: ncbiobj.hpp:726
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.
bool IsSetBlob_state(void) const
state bits of the blob, 0 or missing means regular live data Check if a value has been assigned to Bl...
TBlob_id & SetBlob_id(void)
Assign a value to Blob_id data member.
CID2S_Reply_Get_Split_Info_Base(const CID2S_Reply_Get_Split_Info_Base &)
void ResetBlob_state(void)
Reset Blob_state data member.
TBlob_state GetBlob_state(void) const
Get the Blob_state member data.
TBlob_state & SetBlob_state(void)
Assign a value to Blob_state data member.
Tparent::CMemberIndex< E_memberIndex, 5 > 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 CanGetData(void) const
Check if it is safe to call GetData method.
bool CanGetSplit_version(void) const
Check if it is safe to call GetSplit_version method.
CID2S_Reply_Get_Split_Info_Base & operator=(const CID2S_Reply_Get_Split_Info_Base &)
void ResetSplit_version(void)
Reset Split_version data member.
bool IsSetSplit_version(void) const
version of split data Check if a value has been assigned to Split_version data member.
bool CanGetBlob_state(void) const
Check if it is safe to call GetBlob_state method.
bool IsSetData(void) const
blob split info not set if error occurred Check if a value has been assigned to Data data member.
const TBlob_id & GetBlob_id(void) const
Get the Blob_id member data.
TSplit_version & SetSplit_version(void)
Assign a value to Split_version data member.
TSplit_version GetSplit_version(void) const
Get the Split_version member data.
const TData & GetData(void) const
Get the Data member data.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sun May 19 04:43:57 2024 by modify_doxy.py rev. 669887