NCBI C++ ToolKit
ID2_Blob_Id_.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_Blob_Id_.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_BLOB_ID_BASE_HPP
42 #define OBJECTS_ID2_ID2_BLOB_ID_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 // generated classes
56 
57 
58 /** @addtogroup dataspec_NCBI_ID2Access
59  *
60  * @{
61  */
62 
63 /////////////////////////////////////////////////////////////////////////////
64 ///*********************************************************************
65 /// utility types
66 ///*********************************************************************
67 ///
68 /// CID2_Blob_Id_Base --
69 ///
70 
72 {
74 public:
75  // constructor
76  CID2_Blob_Id_Base(void);
77  // destructor
78  virtual ~CID2_Blob_Id_Base(void);
79 
80  // type info
82 
83  enum ESub_sat {
84  eSub_sat_main = 0,
85  eSub_sat_snp = 1,
86  eSub_sat_snp_graph = 4,
87  eSub_sat_cdd = 8,
88  eSub_sat_mgc = 16,
89  eSub_sat_hprd = 32,
90  eSub_sat_sts = 64,
91  eSub_sat_trna = 128,
92  eSub_sat_exon = 512
93  };
94 
95  /// Access to ESub_sat's attributes (values, names) as defined in spec
96  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(ESub_sat)(void);
97 
98  // types
99  typedef int TSat;
100  typedef int TSub_sat;
101  typedef int TSat_key;
102  typedef int TVersion;
103 
104  // member index
105  enum class E_memberIndex {
106  e__allMandatory = 0,
107  e_sat,
108  e_sub_sat,
109  e_sat_key,
110  e_version
111  };
113 
114  // getters
115  // setters
116 
117  /// Check if a value has been assigned to Sat data member.
118  ///
119  /// Data member Sat is mandatory;
120  /// its type is defined as 'typedef int TSat'
121  /// @return
122  /// - true, if a value has been assigned.
123  /// - false, otherwise.
124  bool IsSetSat(void) const;
125 
126  /// Check if it is safe to call GetSat method.
127  ///
128  /// @return
129  /// - true, if the data member is getatable.
130  /// - false, otherwise.
131  bool CanGetSat(void) const;
132 
133  /// Reset Sat data member.
134  void ResetSat(void);
135 
136  /// Get the Sat member data.
137  ///
138  /// @return
139  /// Copy of the member data.
140  TSat GetSat(void) const;
141 
142  /// Assign a value to Sat data member.
143  ///
144  /// @param value
145  /// Value to assign
146  void SetSat(TSat value);
147 
148  /// Assign a value to Sat data member.
149  ///
150  /// @return
151  /// Reference to the data value.
152  TSat& SetSat(void);
153 
154  /// Check if a value has been assigned to Sub_sat data member.
155  ///
156  /// Data member Sub_sat is optional with default eSub_sat_main;
157  /// its type is defined as 'typedef int TSub_sat'
158  /// @return
159  /// - true, if a value has been assigned.
160  /// - false, otherwise.
161  bool IsSetSub_sat(void) const;
162 
163  /// Check if it is safe to call GetSub_sat method.
164  ///
165  /// @return
166  /// - true, if the data member is getatable.
167  /// - false, otherwise.
168  bool CanGetSub_sat(void) const;
169 
170  /// Reset Sub_sat data member.
171  void ResetSub_sat(void);
172 
173  /// Assign default value to Sub_sat data member.
174  void SetDefaultSub_sat(void);
175 
176  /// Get the Sub_sat member data.
177  ///
178  /// @return
179  /// Copy of the member data.
180  TSub_sat GetSub_sat(void) const;
181 
182  /// Assign a value to Sub_sat data member.
183  ///
184  /// @param value
185  /// Value to assign
186  void SetSub_sat(TSub_sat value);
187 
188  /// Assign a value to Sub_sat data member.
189  ///
190  /// @return
191  /// Reference to the data value.
192  TSub_sat& SetSub_sat(void);
193 
194  /// Check if a value has been assigned to Sat_key data member.
195  ///
196  /// Data member Sat_key is mandatory;
197  /// its type is defined as 'typedef int TSat_key'
198  /// @return
199  /// - true, if a value has been assigned.
200  /// - false, otherwise.
201  bool IsSetSat_key(void) const;
202 
203  /// Check if it is safe to call GetSat_key method.
204  ///
205  /// @return
206  /// - true, if the data member is getatable.
207  /// - false, otherwise.
208  bool CanGetSat_key(void) const;
209 
210  /// Reset Sat_key data member.
211  void ResetSat_key(void);
212 
213  /// Get the Sat_key member data.
214  ///
215  /// @return
216  /// Copy of the member data.
217  TSat_key GetSat_key(void) const;
218 
219  /// Assign a value to Sat_key data member.
220  ///
221  /// @param value
222  /// Value to assign
223  void SetSat_key(TSat_key value);
224 
225  /// Assign a value to Sat_key data member.
226  ///
227  /// @return
228  /// Reference to the data value.
229  TSat_key& SetSat_key(void);
230 
231  /// version of blob, optional in some requests
232  /// Check if a value has been assigned to Version data member.
233  ///
234  /// Data member Version is optional;
235  /// its type is defined as 'typedef int TVersion'
236  /// @return
237  /// - true, if a value has been assigned.
238  /// - false, otherwise.
239  bool IsSetVersion(void) const;
240 
241  /// Check if it is safe to call GetVersion method.
242  ///
243  /// @return
244  /// - true, if the data member is getatable.
245  /// - false, otherwise.
246  bool CanGetVersion(void) const;
247 
248  /// Reset Version data member.
249  void ResetVersion(void);
250 
251  /// Get the Version member data.
252  ///
253  /// @return
254  /// Copy of the member data.
255  TVersion GetVersion(void) const;
256 
257  /// Assign a value to Version data member.
258  ///
259  /// @param value
260  /// Value to assign
261  void SetVersion(TVersion value);
262 
263  /// Assign a value to Version data member.
264  ///
265  /// @return
266  /// Reference to the data value.
267  TVersion& SetVersion(void);
268 
269  /// Reset the whole object
270  virtual void Reset(void);
271 
272 
273 private:
274  // Prohibit copy constructor and assignment operator
277 
278  // data
279  Uint4 m_set_State[1];
280  int m_Sat;
284 };
285 
286 /* @} */
287 
288 
289 
290 
291 
292 ///////////////////////////////////////////////////////////
293 ///////////////////// inline methods //////////////////////
294 ///////////////////////////////////////////////////////////
295 inline
297 {
298  return ((m_set_State[0] & 0x3) != 0);
299 }
300 
301 inline
303 {
304  return IsSetSat();
305 }
306 
307 inline
309 {
310  m_Sat = 0;
311  m_set_State[0] &= ~0x3;
312 }
313 
314 inline
316 {
317  if (!CanGetSat()) {
318  ThrowUnassigned(0);
319  }
320  return m_Sat;
321 }
322 
323 inline
325 {
326  m_Sat = value;
327  m_set_State[0] |= 0x3;
328 }
329 
330 inline
332 {
333 #ifdef _DEBUG
334  if (!IsSetSat()) {
335  memset(&m_Sat,UnassignedByte(),sizeof(m_Sat));
336  }
337 #endif
338  m_set_State[0] |= 0x1;
339  return m_Sat;
340 }
341 
342 inline
344 {
345  return ((m_set_State[0] & 0xc) != 0);
346 }
347 
348 inline
350 {
351  return true;
352 }
353 
354 inline
356 {
358  m_set_State[0] &= ~0xc;
359 }
360 
361 inline
363 {
364  ResetSub_sat();
365 }
366 
367 inline
369 {
370  return m_Sub_sat;
371 }
372 
373 inline
375 {
376  m_Sub_sat = value;
377  m_set_State[0] |= 0xc;
378 }
379 
380 inline
382 {
383 #ifdef _DEBUG
384  if (!IsSetSub_sat()) {
385  memset(&m_Sub_sat,UnassignedByte(),sizeof(m_Sub_sat));
386  }
387 #endif
388  m_set_State[0] |= 0x4;
389  return m_Sub_sat;
390 }
391 
392 inline
394 {
395  return ((m_set_State[0] & 0x30) != 0);
396 }
397 
398 inline
400 {
401  return IsSetSat_key();
402 }
403 
404 inline
406 {
407  m_Sat_key = 0;
408  m_set_State[0] &= ~0x30;
409 }
410 
411 inline
413 {
414  if (!CanGetSat_key()) {
415  ThrowUnassigned(2);
416  }
417  return m_Sat_key;
418 }
419 
420 inline
422 {
423  m_Sat_key = value;
424  m_set_State[0] |= 0x30;
425 }
426 
427 inline
429 {
430 #ifdef _DEBUG
431  if (!IsSetSat_key()) {
432  memset(&m_Sat_key,UnassignedByte(),sizeof(m_Sat_key));
433  }
434 #endif
435  m_set_State[0] |= 0x10;
436  return m_Sat_key;
437 }
438 
439 inline
441 {
442  return ((m_set_State[0] & 0xc0) != 0);
443 }
444 
445 inline
447 {
448  return IsSetVersion();
449 }
450 
451 inline
453 {
454  m_Version = 0;
455  m_set_State[0] &= ~0xc0;
456 }
457 
458 inline
460 {
461  if (!CanGetVersion()) {
462  ThrowUnassigned(3);
463  }
464  return m_Version;
465 }
466 
467 inline
469 {
470  m_Version = value;
471  m_set_State[0] |= 0xc0;
472 }
473 
474 inline
476 {
477 #ifdef _DEBUG
478  if (!IsSetVersion()) {
479  memset(&m_Version,UnassignedByte(),sizeof(m_Version));
480  }
481 #endif
482  m_set_State[0] |= 0x40;
483  return m_Version;
484 }
485 
486 ///////////////////////////////////////////////////////////
487 ////////////////// end of inline methods //////////////////
488 ///////////////////////////////////////////////////////////
489 
490 
491 
492 
493 
494 END_objects_SCOPE // namespace ncbi::objects::
495 
497 
498 
499 #endif // OBJECTS_ID2_ID2_BLOB_ID_BASE_HPP
********************************************************************* utility types *****************...
Base class for all serializable objects.
Definition: serialbase.hpp:150
char value[7]
Definition: config.c:431
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
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 SetDefaultSub_sat(void)
Assign default value to Sub_sat data member.
TVersion GetVersion(void) const
Get the Version member data.
TSat_key GetSat_key(void) const
Get the Sat_key member data.
TSat & SetSat(void)
Assign a value to Sat data member.
bool IsSetSat(void) const
Check if a value has been assigned to Sat data member.
CID2_Blob_Id_Base & operator=(const CID2_Blob_Id_Base &)
void ResetSat_key(void)
Reset Sat_key data member.
bool CanGetSat_key(void) const
Check if it is safe to call GetSat_key method.
bool CanGetSat(void) const
Check if it is safe to call GetSat method.
bool IsSetVersion(void) const
version of blob, optional in some requests Check if a value has been assigned to Version data member.
TSub_sat & SetSub_sat(void)
Assign a value to Sub_sat data member.
bool CanGetVersion(void) const
Check if it is safe to call GetVersion method.
CID2_Blob_Id_Base(const CID2_Blob_Id_Base &)
void ResetVersion(void)
Reset Version data member.
bool IsSetSat_key(void) const
Check if a value has been assigned to Sat_key data member.
void ResetSub_sat(void)
Reset Sub_sat data member.
TSat_key & SetSat_key(void)
Assign a value to Sat_key data member.
TSub_sat GetSub_sat(void) const
Get the Sub_sat member data.
bool IsSetSub_sat(void) const
Check if a value has been assigned to Sub_sat data member.
TVersion & SetVersion(void)
Assign a value to Version data member.
void ResetSat(void)
Reset Sat data member.
TSat GetSat(void) const
Get the Sat member data.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
CSerialObject Tparent
bool CanGetSub_sat(void) const
Check if it is safe to call GetSub_sat method.
Modified on Mon Mar 04 05:12:33 2024 by modify_doxy.py rev. 669887