NCBI C++ ToolKit
Submit_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 Submit_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/submit/submit.asn">submit.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/submit/submit.def">submit.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_SUBMIT_SUBMIT_BLOCK_BASE_HPP
42 #define OBJECTS_SUBMIT_SUBMIT_BLOCK_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 CCit_sub;
61 class CContact_info;
62 class CDate;
63 
64 
65 // generated classes
66 
67 
68 /** @addtogroup dataspec_NCBI_Submit
69  *
70  * @{
71  */
72 
73 /////////////////////////////////////////////////////////////////////////////
74 ///
75 /// CSubmit_block_Base --
76 ///
77 
79 {
81 public:
82  // constructor
83  CSubmit_block_Base(void);
84  // destructor
85  virtual ~CSubmit_block_Base(void);
86 
87  // type info
89 
90  /// type of submission
91  enum ESubtype {
92  eSubtype_new = 1, ///< new data
93  eSubtype_update = 2, ///< update by author
94  eSubtype_revision = 3, ///< 3rd party (non-author) update
95  eSubtype_other = 255
96  };
97 
98  /// Access to ESubtype's attributes (values, names) as defined in spec
99  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(ESubtype)(void);
100 
101  // types
103  typedef CCit_sub TCit;
104  typedef bool THup;
105  typedef CDate TReldate;
106  typedef int TSubtype;
107  typedef string TTool;
108  typedef string TUser_tag;
109  typedef string TComment;
110 
111  // member index
112  enum class E_memberIndex {
113  e__allMandatory = 0,
114  e_contact,
115  e_cit,
116  e_hup,
117  e_reldate,
118  e_subtype,
119  e_tool,
120  e_user_tag,
121  e_comment
122  };
124 
125  // getters
126  // setters
127 
128  /// who to contact
129  /// Check if a value has been assigned to Contact data member.
130  ///
131  /// Data member Contact is mandatory;
132  /// its type is defined as 'typedef CContact_info TContact'
133  /// @return
134  /// - true, if a value has been assigned.
135  /// - false, otherwise.
136  bool IsSetContact(void) const;
137 
138  /// Check if it is safe to call GetContact method.
139  ///
140  /// @return
141  /// - true, if the data member is getatable.
142  /// - false, otherwise.
143  bool CanGetContact(void) const;
144 
145  /// Reset Contact data member.
146  void ResetContact(void);
147 
148  /// Get the Contact member data.
149  ///
150  /// @return
151  /// Reference to the member data.
152  const TContact& GetContact(void) const;
153 
154  /// Assign a value to Contact data member.
155  ///
156  /// @param value
157  /// Reference to value.
158  void SetContact(TContact& value);
159 
160  /// Assign a value to Contact data member.
161  ///
162  /// @return
163  /// Reference to the data value.
164  TContact& SetContact(void);
165 
166  /// citation for this submission
167  /// Check if a value has been assigned to Cit data member.
168  ///
169  /// Data member Cit is mandatory;
170  /// its type is defined as 'typedef CCit_sub TCit'
171  /// @return
172  /// - true, if a value has been assigned.
173  /// - false, otherwise.
174  bool IsSetCit(void) const;
175 
176  /// Check if it is safe to call GetCit method.
177  ///
178  /// @return
179  /// - true, if the data member is getatable.
180  /// - false, otherwise.
181  bool CanGetCit(void) const;
182 
183  /// Reset Cit data member.
184  void ResetCit(void);
185 
186  /// Get the Cit member data.
187  ///
188  /// @return
189  /// Reference to the member data.
190  const TCit& GetCit(void) const;
191 
192  /// Assign a value to Cit data member.
193  ///
194  /// @param value
195  /// Reference to value.
196  void SetCit(TCit& value);
197 
198  /// Assign a value to Cit data member.
199  ///
200  /// @return
201  /// Reference to the data value.
202  TCit& SetCit(void);
203 
204  /// hold until publish
205  /// Check if a value has been assigned to Hup data member.
206  ///
207  /// Data member Hup is optional with default false;
208  /// its type is defined as 'typedef bool THup'
209  /// @return
210  /// - true, if a value has been assigned.
211  /// - false, otherwise.
212  bool IsSetHup(void) const;
213 
214  /// Check if it is safe to call GetHup method.
215  ///
216  /// @return
217  /// - true, if the data member is getatable.
218  /// - false, otherwise.
219  bool CanGetHup(void) const;
220 
221  /// Reset Hup data member.
222  void ResetHup(void);
223 
224  /// Assign default value to Hup data member.
225  void SetDefaultHup(void);
226 
227  /// Get the Hup member data.
228  ///
229  /// @return
230  /// Copy of the member data.
231  THup GetHup(void) const;
232 
233  /// Assign a value to Hup data member.
234  ///
235  /// @param value
236  /// Value to assign
237  void SetHup(THup value);
238 
239  /// Assign a value to Hup data member.
240  ///
241  /// @return
242  /// Reference to the data value.
243  THup& SetHup(void);
244 
245  /// release by date
246  /// Check if a value has been assigned to Reldate data member.
247  ///
248  /// Data member Reldate is optional;
249  /// its type is defined as 'typedef CDate TReldate'
250  /// @return
251  /// - true, if a value has been assigned.
252  /// - false, otherwise.
253  bool IsSetReldate(void) const;
254 
255  /// Check if it is safe to call GetReldate method.
256  ///
257  /// @return
258  /// - true, if the data member is getatable.
259  /// - false, otherwise.
260  bool CanGetReldate(void) const;
261 
262  /// Reset Reldate data member.
263  void ResetReldate(void);
264 
265  /// Get the Reldate member data.
266  ///
267  /// @return
268  /// Reference to the member data.
269  const TReldate& GetReldate(void) const;
270 
271  /// Assign a value to Reldate data member.
272  ///
273  /// @param value
274  /// Reference to value.
275  void SetReldate(TReldate& value);
276 
277  /// Assign a value to Reldate data member.
278  ///
279  /// @return
280  /// Reference to the data value.
281  TReldate& SetReldate(void);
282 
283  /// Check if a value has been assigned to Subtype data member.
284  ///
285  /// Data member Subtype is optional;
286  /// its type is defined as 'typedef int TSubtype'
287  /// @return
288  /// - true, if a value has been assigned.
289  /// - false, otherwise.
290  bool IsSetSubtype(void) const;
291 
292  /// Check if it is safe to call GetSubtype method.
293  ///
294  /// @return
295  /// - true, if the data member is getatable.
296  /// - false, otherwise.
297  bool CanGetSubtype(void) const;
298 
299  /// Reset Subtype data member.
300  void ResetSubtype(void);
301 
302  /// Get the Subtype member data.
303  ///
304  /// @return
305  /// Copy of the member data.
306  TSubtype GetSubtype(void) const;
307 
308  /// Assign a value to Subtype data member.
309  ///
310  /// @param value
311  /// Value to assign
312  void SetSubtype(TSubtype value);
313 
314  /// Assign a value to Subtype data member.
315  ///
316  /// @return
317  /// Reference to the data value.
318  TSubtype& SetSubtype(void);
319 
320  /// tool used to make submission
321  /// Check if a value has been assigned to Tool data member.
322  ///
323  /// Data member Tool is optional;
324  /// its type is defined as 'typedef string TTool'
325  /// @return
326  /// - true, if a value has been assigned.
327  /// - false, otherwise.
328  bool IsSetTool(void) const;
329 
330  /// Check if it is safe to call GetTool method.
331  ///
332  /// @return
333  /// - true, if the data member is getatable.
334  /// - false, otherwise.
335  bool CanGetTool(void) const;
336 
337  /// Reset Tool data member.
338  void ResetTool(void);
339 
340  /// Get the Tool member data.
341  ///
342  /// @return
343  /// Reference to the member data.
344  const TTool& GetTool(void) const;
345 
346  /// Assign a value to Tool data member.
347  ///
348  /// @param value
349  /// Value to assign
350  void SetTool(const TTool& value);
351  void SetTool(TTool&& value);
352 
353  /// Assign a value to Tool data member.
354  ///
355  /// @return
356  /// Reference to the data value.
357  TTool& SetTool(void);
358 
359  /// user supplied id for this submission
360  /// Check if a value has been assigned to User_tag data member.
361  ///
362  /// Data member User_tag is optional;
363  /// its type is defined as 'typedef string TUser_tag'
364  /// @return
365  /// - true, if a value has been assigned.
366  /// - false, otherwise.
367  bool IsSetUser_tag(void) const;
368 
369  /// Check if it is safe to call GetUser_tag method.
370  ///
371  /// @return
372  /// - true, if the data member is getatable.
373  /// - false, otherwise.
374  bool CanGetUser_tag(void) const;
375 
376  /// Reset User_tag data member.
377  void ResetUser_tag(void);
378 
379  /// Get the User_tag member data.
380  ///
381  /// @return
382  /// Reference to the member data.
383  const TUser_tag& GetUser_tag(void) const;
384 
385  /// Assign a value to User_tag data member.
386  ///
387  /// @param value
388  /// Value to assign
389  void SetUser_tag(const TUser_tag& value);
390  void SetUser_tag(TUser_tag&& value);
391 
392  /// Assign a value to User_tag data member.
393  ///
394  /// @return
395  /// Reference to the data value.
396  TUser_tag& SetUser_tag(void);
397 
398  /// user comments/advice to database
399  /// Check if a value has been assigned to Comment data member.
400  ///
401  /// Data member Comment is optional;
402  /// its type is defined as 'typedef string TComment'
403  /// @return
404  /// - true, if a value has been assigned.
405  /// - false, otherwise.
406  bool IsSetComment(void) const;
407 
408  /// Check if it is safe to call GetComment method.
409  ///
410  /// @return
411  /// - true, if the data member is getatable.
412  /// - false, otherwise.
413  bool CanGetComment(void) const;
414 
415  /// Reset Comment data member.
416  void ResetComment(void);
417 
418  /// Get the Comment member data.
419  ///
420  /// @return
421  /// Reference to the member data.
422  const TComment& GetComment(void) const;
423 
424  /// Assign a value to Comment data member.
425  ///
426  /// @param value
427  /// Value to assign
428  void SetComment(const TComment& value);
429  void SetComment(TComment&& value);
430 
431  /// Assign a value to Comment data member.
432  ///
433  /// @return
434  /// Reference to the data value.
435  TComment& SetComment(void);
436 
437  /// Reset the whole object
438  virtual void Reset(void);
439 
440 
441 private:
442  // Prohibit copy constructor and assignment operator
445 
446  // data
447  Uint4 m_set_State[1];
450  bool m_Hup;
453  string m_Tool;
454  string m_User_tag;
455  string m_Comment;
456 };
457 
458 /* @} */
459 
460 
461 
462 
463 
464 ///////////////////////////////////////////////////////////
465 ///////////////////// inline methods //////////////////////
466 ///////////////////////////////////////////////////////////
467 inline
469 {
470  return m_Contact.NotEmpty();
471 }
472 
473 inline
475 {
476  return true;
477 }
478 
479 inline
481 {
482  if ( !m_Contact ) {
483  const_cast<CSubmit_block_Base*>(this)->ResetContact();
484  }
485  return (*m_Contact);
486 }
487 
488 inline
490 {
491  if ( !m_Contact ) {
492  ResetContact();
493  }
494  return (*m_Contact);
495 }
496 
497 inline
499 {
500  return m_Cit.NotEmpty();
501 }
502 
503 inline
505 {
506  return true;
507 }
508 
509 inline
511 {
512  if ( !m_Cit ) {
513  const_cast<CSubmit_block_Base*>(this)->ResetCit();
514  }
515  return (*m_Cit);
516 }
517 
518 inline
520 {
521  if ( !m_Cit ) {
522  ResetCit();
523  }
524  return (*m_Cit);
525 }
526 
527 inline
529 {
530  return ((m_set_State[0] & 0x30) != 0);
531 }
532 
533 inline
535 {
536  return true;
537 }
538 
539 inline
541 {
542  m_Hup = false;
543  m_set_State[0] &= ~0x30;
544 }
545 
546 inline
548 {
549  ResetHup();
550 }
551 
552 inline
554 {
555  return m_Hup;
556 }
557 
558 inline
560 {
561  m_Hup = value;
562  m_set_State[0] |= 0x30;
563 }
564 
565 inline
567 {
568 #ifdef _DEBUG
569  if (!IsSetHup()) {
570  memset(&m_Hup,UnassignedByte(),sizeof(m_Hup));
571  }
572 #endif
573  m_set_State[0] |= 0x10;
574  return m_Hup;
575 }
576 
577 inline
579 {
580  return m_Reldate.NotEmpty();
581 }
582 
583 inline
585 {
586  return IsSetReldate();
587 }
588 
589 inline
591 {
592  if (!CanGetReldate()) {
593  ThrowUnassigned(3);
594  }
595  return (*m_Reldate);
596 }
597 
598 inline
600 {
601  return ((m_set_State[0] & 0x300) != 0);
602 }
603 
604 inline
606 {
607  return IsSetSubtype();
608 }
609 
610 inline
612 {
613  m_Subtype = (ESubtype)(0);
614  m_set_State[0] &= ~0x300;
615 }
616 
617 inline
619 {
620  if (!CanGetSubtype()) {
621  ThrowUnassigned(4);
622  }
623  return m_Subtype;
624 }
625 
626 inline
628 {
629  m_Subtype = value;
630  m_set_State[0] |= 0x300;
631 }
632 
633 inline
635 {
636 #ifdef _DEBUG
637  if (!IsSetSubtype()) {
638  memset(&m_Subtype,UnassignedByte(),sizeof(m_Subtype));
639  }
640 #endif
641  m_set_State[0] |= 0x100;
642  return m_Subtype;
643 }
644 
645 inline
647 {
648  return ((m_set_State[0] & 0xc00) != 0);
649 }
650 
651 inline
653 {
654  return IsSetTool();
655 }
656 
657 inline
659 {
660  if (!CanGetTool()) {
661  ThrowUnassigned(5);
662  }
663  return m_Tool;
664 }
665 
666 inline
668 {
669  m_Tool = value;
670  m_set_State[0] |= 0xc00;
671 }
672 
673 inline
675 {
676  m_Tool = std::forward<CSubmit_block_Base::TTool>(value);
677  m_set_State[0] |= 0xc00;
678 }
679 
680 inline
682 {
683 #ifdef _DEBUG
684  if (!IsSetTool()) {
686  }
687 #endif
688  m_set_State[0] |= 0x400;
689  return m_Tool;
690 }
691 
692 inline
694 {
695  return ((m_set_State[0] & 0x3000) != 0);
696 }
697 
698 inline
700 {
701  return IsSetUser_tag();
702 }
703 
704 inline
706 {
707  if (!CanGetUser_tag()) {
708  ThrowUnassigned(6);
709  }
710  return m_User_tag;
711 }
712 
713 inline
715 {
716  m_User_tag = value;
717  m_set_State[0] |= 0x3000;
718 }
719 
720 inline
722 {
723  m_User_tag = std::forward<CSubmit_block_Base::TUser_tag>(value);
724  m_set_State[0] |= 0x3000;
725 }
726 
727 inline
729 {
730 #ifdef _DEBUG
731  if (!IsSetUser_tag()) {
733  }
734 #endif
735  m_set_State[0] |= 0x1000;
736  return m_User_tag;
737 }
738 
739 inline
741 {
742  return ((m_set_State[0] & 0xc000) != 0);
743 }
744 
745 inline
747 {
748  return IsSetComment();
749 }
750 
751 inline
753 {
754  if (!CanGetComment()) {
755  ThrowUnassigned(7);
756  }
757  return m_Comment;
758 }
759 
760 inline
762 {
763  m_Comment = value;
764  m_set_State[0] |= 0xc000;
765 }
766 
767 inline
769 {
770  m_Comment = std::forward<CSubmit_block_Base::TComment>(value);
771  m_set_State[0] |= 0xc000;
772 }
773 
774 inline
776 {
777 #ifdef _DEBUG
778  if (!IsSetComment()) {
780  }
781 #endif
782  m_set_State[0] |= 0x4000;
783  return m_Comment;
784 }
785 
786 ///////////////////////////////////////////////////////////
787 ////////////////// end of inline methods //////////////////
788 ///////////////////////////////////////////////////////////
789 
790 
791 
792 
793 
794 END_objects_SCOPE // namespace ncbi::objects::
795 
797 
798 
799 #endif // OBJECTS_SUBMIT_SUBMIT_BLOCK_BASE_HPP
CContact_info –.
Definition: Date.hpp:53
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
CSubmit_block_Base –.
int GetSubtype(CFieldNamePanel *field_name_panel, string &ncRNA_class)
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
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_SUBMIT_EXPORT
Definition: ncbi_export.h:849
bool IsSetTool(void) const
tool used to make submission Check if a value has been assigned to Tool data member.
const TTool & GetTool(void) const
Get the Tool member data.
const TReldate & GetReldate(void) const
Get the Reldate member data.
TComment & SetComment(void)
Assign a value to Comment data member.
Tparent::CMemberIndex< E_memberIndex, 9 > TmemberIndex
const TCit & GetCit(void) const
Get the Cit member data.
CRef< TContact > m_Contact
const TComment & GetComment(void) const
Get the Comment member data.
TSubtype & SetSubtype(void)
Assign a value to Subtype data member.
bool CanGetTool(void) const
Check if it is safe to call GetTool method.
bool CanGetHup(void) const
Check if it is safe to call GetHup method.
CSubmit_block_Base(const CSubmit_block_Base &)
TUser_tag & SetUser_tag(void)
Assign a value to User_tag data member.
bool CanGetReldate(void) const
Check if it is safe to call GetReldate method.
void ResetContact(void)
Reset Contact data member.
bool CanGetComment(void) const
Check if it is safe to call GetComment method.
TContact & SetContact(void)
Assign a value to Contact data member.
CRef< TReldate > m_Reldate
void ResetCit(void)
Reset Cit data member.
bool IsSetSubtype(void) const
Check if a value has been assigned to Subtype data member.
bool CanGetContact(void) const
Check if it is safe to call GetContact method.
bool IsSetReldate(void) const
release by date Check if a value has been assigned to Reldate data member.
const TUser_tag & GetUser_tag(void) const
Get the User_tag member data.
void SetDefaultHup(void)
Assign default value to Hup data member.
THup & SetHup(void)
Assign a value to Hup data member.
bool CanGetCit(void) const
Check if it is safe to call GetCit method.
CSerialObject Tparent
void ResetHup(void)
Reset Hup data member.
TTool & SetTool(void)
Assign a value to Tool data member.
CSubmit_block_Base & operator=(const CSubmit_block_Base &)
bool IsSetHup(void) const
hold until publish Check if a value has been assigned to Hup data member.
THup GetHup(void) const
Get the Hup member data.
TSubtype GetSubtype(void) const
Get the Subtype member data.
void ResetSubtype(void)
Reset Subtype data member.
bool IsSetUser_tag(void) const
user supplied id for this submission Check if a value has been assigned to User_tag data member.
CContact_info TContact
const TContact & GetContact(void) const
Get the Contact member data.
bool IsSetCit(void) const
citation for this submission Check if a value has been assigned to Cit data member.
TCit & SetCit(void)
Assign a value to Cit data member.
bool IsSetComment(void) const
user comments/advice to database Check if a value has been assigned to Comment data member.
bool CanGetSubtype(void) const
Check if it is safe to call GetSubtype method.
bool IsSetContact(void) const
who to contact Check if a value has been assigned to Contact data member.
ESubtype
type of submission
bool CanGetUser_tag(void) const
Check if it is safe to call GetUser_tag method.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sat May 25 14:17:32 2024 by modify_doxy.py rev. 669887