NCBI C++ ToolKit
EMBL_block_.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 EMBL_block_.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/seqblock/seqblock.asn">seqblock.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqblock/seqblock.def">seqblock.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_SEQBLOCK_EMBL_BLOCK_BASE_HPP
42 #define OBJECTS_SEQBLOCK_EMBL_BLOCK_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
49 #include <string>
50 
52 
53 #ifndef BEGIN_objects_SCOPE
54 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
55 # define END_objects_SCOPE END_SCOPE(objects)
56 #endif
57 BEGIN_objects_SCOPE // namespace ncbi::objects::
58 
59 
60 // forward declarations
61 class CDate;
62 class CEMBL_xref;
63 
64 
65 // generated classes
66 
67 
68 /** @addtogroup dataspec_EMBL_General
69  *
70  * @{
71  */
72 
73 /////////////////////////////////////////////////////////////////////////////
74 ///
75 /// CEMBL_block_Base --
76 ///
77 
79 {
81 public:
82  // constructor
83  CEMBL_block_Base(void);
84  // destructor
85  virtual ~CEMBL_block_Base(void);
86 
87  // type info
89 
90  enum EClass {
91  eClass_not_set = 0,
92  eClass_standard = 1,
93  eClass_unannotated = 2,
94  eClass_other = 255
95  };
96 
97  /// Access to EClass's attributes (values, names) as defined in spec
98  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EClass)(void);
99 
100  enum EDiv {
101  eDiv_fun = 0,
102  eDiv_inv = 1,
103  eDiv_mam = 2,
104  eDiv_org = 3,
105  eDiv_phg = 4,
106  eDiv_pln = 5,
107  eDiv_pri = 6,
108  eDiv_pro = 7,
109  eDiv_rod = 8,
110  eDiv_syn = 9,
111  eDiv_una = 10,
112  eDiv_vrl = 11,
113  eDiv_vrt = 12,
114  eDiv_pat = 13,
115  eDiv_est = 14,
116  eDiv_sts = 15,
117  eDiv_other = 255
118  };
119 
120  /// Access to EDiv's attributes (values, names) as defined in spec
121  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EDiv)(void);
122 
123  // types
124  typedef EClass TClass;
125  typedef EDiv TDiv;
128  typedef list< string > TExtra_acc;
129  typedef list< string > TKeywords;
130  typedef list< CRef< CEMBL_xref > > TXref;
131 
132  // member index
133  enum class E_memberIndex {
134  e__allMandatory = 0,
135  e_class,
136  e_div,
137  e_creation_date,
138  e_update_date,
139  e_extra_acc,
140  e_keywords,
141  e_xref
142  };
144 
145  // getters
146  // setters
147 
148  /// Check if a value has been assigned to Class data member.
149  ///
150  /// Data member Class is optional with default eClass_standard;
151  /// its type is defined as 'typedef EClass TClass'
152  /// @return
153  /// - true, if a value has been assigned.
154  /// - false, otherwise.
155  bool IsSetClass(void) const;
156 
157  /// Check if it is safe to call GetClass method.
158  ///
159  /// @return
160  /// - true, if the data member is getatable.
161  /// - false, otherwise.
162  bool CanGetClass(void) const;
163 
164  /// Reset Class data member.
165  void ResetClass(void);
166 
167  /// Assign default value to Class data member.
168  void SetDefaultClass(void);
169 
170  /// Get the Class member data.
171  ///
172  /// @return
173  /// Copy of the member data.
174  TClass GetClass(void) const;
175 
176  /// Assign a value to Class data member.
177  ///
178  /// @param value
179  /// Value to assign
180  void SetClass(TClass value);
181 
182  /// Assign a value to Class data member.
183  ///
184  /// @return
185  /// Reference to the data value.
186  TClass& SetClass(void);
187 
188  /// Check if a value has been assigned to Div data member.
189  ///
190  /// Data member Div is optional;
191  /// its type is defined as 'typedef EDiv TDiv'
192  /// @return
193  /// - true, if a value has been assigned.
194  /// - false, otherwise.
195  bool IsSetDiv(void) const;
196 
197  /// Check if it is safe to call GetDiv method.
198  ///
199  /// @return
200  /// - true, if the data member is getatable.
201  /// - false, otherwise.
202  bool CanGetDiv(void) const;
203 
204  /// Reset Div data member.
205  void ResetDiv(void);
206 
207  /// Get the Div member data.
208  ///
209  /// @return
210  /// Copy of the member data.
211  TDiv GetDiv(void) const;
212 
213  /// Assign a value to Div data member.
214  ///
215  /// @param value
216  /// Value to assign
217  void SetDiv(TDiv value);
218 
219  /// Assign a value to Div data member.
220  ///
221  /// @return
222  /// Reference to the data value.
223  TDiv& SetDiv(void);
224 
225  /// Check if a value has been assigned to Creation_date data member.
226  ///
227  /// Data member Creation_date is mandatory;
228  /// its type is defined as 'typedef CDate TCreation_date'
229  /// @return
230  /// - true, if a value has been assigned.
231  /// - false, otherwise.
232  bool IsSetCreation_date(void) const;
233 
234  /// Check if it is safe to call GetCreation_date method.
235  ///
236  /// @return
237  /// - true, if the data member is getatable.
238  /// - false, otherwise.
239  bool CanGetCreation_date(void) const;
240 
241  /// Reset Creation_date data member.
242  void ResetCreation_date(void);
243 
244  /// Get the Creation_date member data.
245  ///
246  /// @return
247  /// Reference to the member data.
248  const TCreation_date& GetCreation_date(void) const;
249 
250  /// Assign a value to Creation_date data member.
251  ///
252  /// @param value
253  /// Reference to value.
254  void SetCreation_date(TCreation_date& value);
255 
256  /// Assign a value to Creation_date data member.
257  ///
258  /// @return
259  /// Reference to the data value.
260  TCreation_date& SetCreation_date(void);
261 
262  /// Check if a value has been assigned to Update_date data member.
263  ///
264  /// Data member Update_date is mandatory;
265  /// its type is defined as 'typedef CDate TUpdate_date'
266  /// @return
267  /// - true, if a value has been assigned.
268  /// - false, otherwise.
269  bool IsSetUpdate_date(void) const;
270 
271  /// Check if it is safe to call GetUpdate_date method.
272  ///
273  /// @return
274  /// - true, if the data member is getatable.
275  /// - false, otherwise.
276  bool CanGetUpdate_date(void) const;
277 
278  /// Reset Update_date data member.
279  void ResetUpdate_date(void);
280 
281  /// Get the Update_date member data.
282  ///
283  /// @return
284  /// Reference to the member data.
285  const TUpdate_date& GetUpdate_date(void) const;
286 
287  /// Assign a value to Update_date data member.
288  ///
289  /// @param value
290  /// Reference to value.
291  void SetUpdate_date(TUpdate_date& value);
292 
293  /// Assign a value to Update_date data member.
294  ///
295  /// @return
296  /// Reference to the data value.
297  TUpdate_date& SetUpdate_date(void);
298 
299  /// Check if a value has been assigned to Extra_acc data member.
300  ///
301  /// Data member Extra_acc is optional;
302  /// its type is defined as 'typedef list< string > TExtra_acc'
303  /// @return
304  /// - true, if a value has been assigned.
305  /// - false, otherwise.
306  bool IsSetExtra_acc(void) const;
307 
308  /// Check if it is safe to call GetExtra_acc method.
309  ///
310  /// @return
311  /// - true, if the data member is getatable.
312  /// - false, otherwise.
313  bool CanGetExtra_acc(void) const;
314 
315  /// Reset Extra_acc data member.
316  void ResetExtra_acc(void);
317 
318  /// Get the Extra_acc member data.
319  ///
320  /// @return
321  /// Reference to the member data.
322  const TExtra_acc& GetExtra_acc(void) const;
323 
324  /// Assign a value to Extra_acc data member.
325  ///
326  /// @return
327  /// Reference to the data value.
328  TExtra_acc& SetExtra_acc(void);
329 
330  /// Check if a value has been assigned to Keywords data member.
331  ///
332  /// Data member Keywords is optional;
333  /// its type is defined as 'typedef list< string > TKeywords'
334  /// @return
335  /// - true, if a value has been assigned.
336  /// - false, otherwise.
337  bool IsSetKeywords(void) const;
338 
339  /// Check if it is safe to call GetKeywords method.
340  ///
341  /// @return
342  /// - true, if the data member is getatable.
343  /// - false, otherwise.
344  bool CanGetKeywords(void) const;
345 
346  /// Reset Keywords data member.
347  void ResetKeywords(void);
348 
349  /// Get the Keywords member data.
350  ///
351  /// @return
352  /// Reference to the member data.
353  const TKeywords& GetKeywords(void) const;
354 
355  /// Assign a value to Keywords data member.
356  ///
357  /// @return
358  /// Reference to the data value.
359  TKeywords& SetKeywords(void);
360 
361  /// Check if a value has been assigned to Xref data member.
362  ///
363  /// Data member Xref is optional;
364  /// its type is defined as 'typedef list< CRef< CEMBL_xref > > TXref'
365  /// @return
366  /// - true, if a value has been assigned.
367  /// - false, otherwise.
368  bool IsSetXref(void) const;
369 
370  /// Check if it is safe to call GetXref method.
371  ///
372  /// @return
373  /// - true, if the data member is getatable.
374  /// - false, otherwise.
375  bool CanGetXref(void) const;
376 
377  /// Reset Xref data member.
378  void ResetXref(void);
379 
380  /// Get the Xref member data.
381  ///
382  /// @return
383  /// Reference to the member data.
384  const TXref& GetXref(void) const;
385 
386  /// Assign a value to Xref data member.
387  ///
388  /// @return
389  /// Reference to the data value.
390  TXref& SetXref(void);
391 
392  /// Reset the whole object
393  virtual void Reset(void);
394 
395 
396 private:
397  // Prohibit copy constructor and assignment operator
400 
401  // data
402  Uint4 m_set_State[1];
407  list< string > m_Extra_acc;
408  list< string > m_Keywords;
409  list< CRef< CEMBL_xref > > m_Xref;
410 };
411 
412 /* @} */
413 
414 
415 
416 
417 
418 ///////////////////////////////////////////////////////////
419 ///////////////////// inline methods //////////////////////
420 ///////////////////////////////////////////////////////////
421 inline
423 {
424  return ((m_set_State[0] & 0x3) != 0);
425 }
426 
427 inline
429 {
430  return true;
431 }
432 
433 inline
435 {
437  m_set_State[0] &= ~0x3;
438 }
439 
440 inline
442 {
443  ResetClass();
444 }
445 
446 inline
448 {
449  return m_Class;
450 }
451 
452 inline
454 {
455  m_Class = value;
456  m_set_State[0] |= 0x3;
457 }
458 
459 inline
461 {
462 #ifdef _DEBUG
463  if (!IsSetClass()) {
464  memset(&m_Class,UnassignedByte(),sizeof(m_Class));
465  }
466 #endif
467  m_set_State[0] |= 0x1;
468  return m_Class;
469 }
470 
471 inline
473 {
474  return ((m_set_State[0] & 0xc) != 0);
475 }
476 
477 inline
479 {
480  return IsSetDiv();
481 }
482 
483 inline
485 {
486  m_Div = (EDiv)(0);
487  m_set_State[0] &= ~0xc;
488 }
489 
490 inline
492 {
493  if (!CanGetDiv()) {
494  ThrowUnassigned(1);
495  }
496  return m_Div;
497 }
498 
499 inline
501 {
502  m_Div = value;
503  m_set_State[0] |= 0xc;
504 }
505 
506 inline
508 {
509 #ifdef _DEBUG
510  if (!IsSetDiv()) {
511  memset(&m_Div,UnassignedByte(),sizeof(m_Div));
512  }
513 #endif
514  m_set_State[0] |= 0x4;
515  return m_Div;
516 }
517 
518 inline
520 {
521  return m_Creation_date.NotEmpty();
522 }
523 
524 inline
526 {
527  return true;
528 }
529 
530 inline
532 {
533  if ( !m_Creation_date ) {
534  const_cast<CEMBL_block_Base*>(this)->ResetCreation_date();
535  }
536  return (*m_Creation_date);
537 }
538 
539 inline
541 {
542  if ( !m_Creation_date ) {
544  }
545  return (*m_Creation_date);
546 }
547 
548 inline
550 {
551  return m_Update_date.NotEmpty();
552 }
553 
554 inline
556 {
557  return true;
558 }
559 
560 inline
562 {
563  if ( !m_Update_date ) {
564  const_cast<CEMBL_block_Base*>(this)->ResetUpdate_date();
565  }
566  return (*m_Update_date);
567 }
568 
569 inline
571 {
572  if ( !m_Update_date ) {
574  }
575  return (*m_Update_date);
576 }
577 
578 inline
580 {
581  return ((m_set_State[0] & 0x300) != 0);
582 }
583 
584 inline
586 {
587  return true;
588 }
589 
590 inline
592 {
593  return m_Extra_acc;
594 }
595 
596 inline
598 {
599  m_set_State[0] |= 0x100;
600  return m_Extra_acc;
601 }
602 
603 inline
605 {
606  return ((m_set_State[0] & 0xc00) != 0);
607 }
608 
609 inline
611 {
612  return true;
613 }
614 
615 inline
617 {
618  return m_Keywords;
619 }
620 
621 inline
623 {
624  m_set_State[0] |= 0x400;
625  return m_Keywords;
626 }
627 
628 inline
630 {
631  return ((m_set_State[0] & 0x3000) != 0);
632 }
633 
634 inline
636 {
637  return true;
638 }
639 
640 inline
642 {
643  return m_Xref;
644 }
645 
646 inline
648 {
649  m_set_State[0] |= 0x1000;
650  return m_Xref;
651 }
652 
653 ///////////////////////////////////////////////////////////
654 ////////////////// end of inline methods //////////////////
655 ///////////////////////////////////////////////////////////
656 
657 
658 
659 
660 
661 END_objects_SCOPE // namespace ncbi::objects::
662 
664 
665 
666 #endif // OBJECTS_SEQBLOCK_EMBL_BLOCK_BASE_HPP
Definition: Date.hpp:53
CEMBL_block_Base –.
Definition: EMBL_block_.hpp:79
CEMBL_xref –.
Definition: EMBL_xref.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
#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_SEQBLOCK_EXPORT
Definition: ncbi_export.h:752
TKeywords & SetKeywords(void)
Assign a value to Keywords data member.
bool CanGetExtra_acc(void) const
Check if it is safe to call GetExtra_acc method.
list< string > TExtra_acc
TExtra_acc & SetExtra_acc(void)
Assign a value to Extra_acc data member.
CEMBL_block_Base(const CEMBL_block_Base &)
Tparent::CMemberIndex< E_memberIndex, 8 > TmemberIndex
void ResetCreation_date(void)
Reset Creation_date data member.
Definition: EMBL_block_.cpp:87
const TCreation_date & GetCreation_date(void) const
Get the Creation_date member data.
bool IsSetClass(void) const
Check if a value has been assigned to Class data member.
list< string > m_Keywords
const TXref & GetXref(void) const
Get the Xref member data.
TXref & SetXref(void)
Assign a value to Xref data member.
bool CanGetClass(void) const
Check if it is safe to call GetClass method.
CRef< TCreation_date > m_Creation_date
bool CanGetXref(void) const
Check if it is safe to call GetXref method.
bool CanGetUpdate_date(void) const
Check if it is safe to call GetUpdate_date method.
TCreation_date & SetCreation_date(void)
Assign a value to Creation_date data member.
bool CanGetKeywords(void) const
Check if it is safe to call GetKeywords method.
void SetDefaultClass(void)
Assign default value to Class data member.
void ResetDiv(void)
Reset Div data member.
TClass & SetClass(void)
Assign a value to Class data member.
const TKeywords & GetKeywords(void) const
Get the Keywords member data.
TDiv & SetDiv(void)
Assign a value to Div data member.
bool IsSetExtra_acc(void) const
Check if a value has been assigned to Extra_acc data member.
CRef< TUpdate_date > m_Update_date
const TExtra_acc & GetExtra_acc(void) const
Get the Extra_acc member data.
bool IsSetCreation_date(void) const
Check if a value has been assigned to Creation_date data member.
const TUpdate_date & GetUpdate_date(void) const
Get the Update_date member data.
TClass GetClass(void) const
Get the Class member data.
list< string > m_Extra_acc
void ResetClass(void)
Reset Class data member.
bool IsSetKeywords(void) const
Check if a value has been assigned to Keywords data member.
list< string > TKeywords
bool CanGetCreation_date(void) const
Check if it is safe to call GetCreation_date method.
CSerialObject Tparent
Definition: EMBL_block_.hpp:80
bool IsSetXref(void) const
Check if a value has been assigned to Xref data member.
TUpdate_date & SetUpdate_date(void)
Assign a value to Update_date data member.
list< CRef< CEMBL_xref > > TXref
TDiv GetDiv(void) const
Get the Div member data.
bool CanGetDiv(void) const
Check if it is safe to call GetDiv method.
Uint4 m_set_State[1]
CEMBL_block_Base & operator=(const CEMBL_block_Base &)
list< CRef< CEMBL_xref > > m_Xref
bool IsSetDiv(void) const
Check if a value has been assigned to Div data member.
void ResetUpdate_date(void)
Reset Update_date data member.
bool IsSetUpdate_date(void) const
Check if a value has been assigned to Update_date data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
void SetDiv(CRef< objects::CSeq_entry > entry, string div)
Modified on Wed May 15 15:06:08 2024 by modify_doxy.py rev. 669887