NCBI C++ ToolKit
PC_AssaySubmit_.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 PC_AssaySubmit_.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/pcassay2/pcassay2.asn">pcassay2.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/pcassay2/pcassay2.def">pcassay2.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_PCASSAY2_PC_ASSAYSUBMIT_BASE_HPP
42 #define OBJECTS_PCASSAY2_PC_ASSAYSUBMIT_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <vector>
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 CPC_ID;
61 class CPC_Source;
62 #ifndef BEGIN_pcassay2_SCOPE
63 # define BEGIN_pcassay2_SCOPE BEGIN_SCOPE(pcassay2)
64 # define END_pcassay2_SCOPE END_SCOPE(pcassay2)
65 #endif
66 BEGIN_pcassay2_SCOPE // namespace ncbi::objects::pcassay2::
67 
69 class CPC_AssayResults;
70 
71 
72 // generated classes
73 
74 
75 /** @addtogroup dataspec_NCBI_PCAssay2
76  *
77  * @{
78  */
79 
80 /////////////////////////////////////////////////////////////////////////////
81 /// Container for Data Depositions and Assay Definitions
82 ///
83 /// CPC_AssaySubmit_Base --
84 ///
85 
87 {
89 public:
90  // constructor
92  // destructor
93  virtual ~CPC_AssaySubmit_Base(void);
94 
95  // type info
97 
98  /////////////////////////////////////////////////////////////////////////////
99  /// Assay Description or pre-existing Identifier
100  ///
101  /// C_Assay --
102  ///
103 
104  class C_Assay : public CSerialObject
105  {
107  public:
108  // constructor
109  C_Assay(void);
110  // destructor
111  ~C_Assay(void);
112 
113  // type info
115 
116 
117  /// Choice variants.
118  enum E_Choice {
119  e_not_set = 0, ///< No variant selected
120  e_Aid, ///< Assay Identifier
121  e_Aid_source, ///< External Assay Identifier
122  e_Descr, ///< Assay Description (new or updated)
123  e_Aidver ///< Assay Identifier/Version (for internal use)
124  };
125  /// Maximum+1 value of the choice variant enumerator.
127  e_MaxChoice = 5 ///< == e_Aidver+1
128  };
129 
130  /// Reset the whole object
131  void Reset(void);
132 
133  /// Reset the selection (set it to e_not_set).
134  void ResetSelection(void);
135 
136  /// Which variant is currently selected.
137  ///
138  /// @return
139  /// Choice state enumerator.
140  E_Choice Which(void) const;
141 
142  /// Verify selection, throw exception if it differs from the expected.
143  ///
144  /// @param index
145  /// Expected selection.
146  void CheckSelected(E_Choice index) const;
147 
148  /// Throw 'InvalidSelection' exception.
149  ///
150  /// @param index
151  /// Expected selection.
152  NCBI_NORETURN void ThrowInvalidSelection(E_Choice index) const;
153 
154  /// Retrieve selection name (for diagnostic purposes).
155  ///
156  /// @param index
157  /// One of possible selection states.
158  /// @return
159  /// Name string.
160  static string SelectionName(E_Choice index);
161 
162  /// Select the requested variant if needed.
163  ///
164  /// @param index
165  /// New selection state.
166  /// @param reset
167  /// Flag that defines the resetting of the variant data. The data will
168  /// be reset if either the current selection differs from the new one,
169  /// or the flag is set to eDoResetVariant.
171  /// Select the requested variant if needed,
172  /// allocating CObject variants from memory pool.
173  void Select(E_Choice index,
174  EResetVariant reset,
175  CObjectMemoryPool* pool);
176 
177  // types
178  typedef int TAid;
179  typedef objects::CPC_Source TAid_source;
181  typedef objects::CPC_ID TAidver;
182 
183  // getters
184  // setters
185 
186 
187  /// Check if variant Aid is selected.
188  ///
189  /// Aid type is defined as 'typedef int TAid'.
190  /// @return
191  /// - true, if the variant is selected.
192  /// - false, otherwise.
193  bool IsAid(void) const;
194 
195  /// Get the variant data.
196  ///
197  /// @return
198  /// Copy of the variant data.
199  TAid GetAid(void) const;
200 
201  /// Select the variant.
202  ///
203  /// @return
204  /// Reference to the variant data.
205  TAid& SetAid(void);
206 
207  /// Select the variant and set its data.
208  ///
209  /// @param value
210  /// Variant data.
212 
213 
214  /// Check if variant Aid_source is selected.
215  ///
216  /// Aid_source type is defined as 'typedef objects::CPC_Source TAid_source'.
217  /// @return
218  /// - true, if the variant is selected.
219  /// - false, otherwise.
220  bool IsAid_source(void) const;
221 
222  /// Get the variant data.
223  ///
224  /// @return
225  /// Reference to the data.
226  const TAid_source& GetAid_source(void) const;
227 
228  /// Select the variant.
229  ///
230  /// @return
231  /// Reference to the variant data.
233  /// Select the variant and set its data.
234  ///
235  /// @param value
236  /// Reference to the data.
238 
239 
240  /// Check if variant Descr is selected.
241  ///
242  /// Descr type is defined as 'typedef CPC_AssayDescription TDescr'.
243  /// @return
244  /// - true, if the variant is selected.
245  /// - false, otherwise.
246  bool IsDescr(void) const;
247 
248  /// Get the variant data.
249  ///
250  /// @return
251  /// Reference to the data.
252  const TDescr& GetDescr(void) const;
253 
254  /// Select the variant.
255  ///
256  /// @return
257  /// Reference to the variant data.
258  TDescr& SetDescr(void);
259  /// Select the variant and set its data.
260  ///
261  /// @param value
262  /// Reference to the data.
264 
265 
266  /// Check if variant Aidver is selected.
267  ///
268  /// Aidver type is defined as 'typedef objects::CPC_ID TAidver'.
269  /// @return
270  /// - true, if the variant is selected.
271  /// - false, otherwise.
272  bool IsAidver(void) const;
273 
274  /// Get the variant data.
275  ///
276  /// @return
277  /// Reference to the data.
278  const TAidver& GetAidver(void) const;
279 
280  /// Select the variant.
281  ///
282  /// @return
283  /// Reference to the variant data.
285  /// Select the variant and set its data.
286  ///
287  /// @param value
288  /// Reference to the data.
290 
291 
292  private:
293  // copy constructor and assignment operator
294  C_Assay(const C_Assay& );
296  // choice state
298  // helper methods
299  void DoSelect(E_Choice index, CObjectMemoryPool* pool = 0);
300 
301  static const char* const sm_SelectionNames[];
302  // data
303  union {
305  NCBI_NS_NCBI::CSerialObject *m_object;
306  };
307  };
308  // types
309  typedef C_Assay TAssay;
310  typedef vector< CRef< CPC_AssayResults > > TData;
311  typedef vector< int > TRevoke;
312 
313  // member index
314  enum class E_memberIndex {
315  e__allMandatory = 0,
316  e_assay,
317  e_data,
318  e_revoke
319  };
321 
322  // getters
323  // setters
324 
325  /// Check if a value has been assigned to Assay data member.
326  ///
327  /// Data member Assay is mandatory;
328  /// its type is defined as 'typedef C_Assay TAssay'
329  /// @return
330  /// - true, if a value has been assigned.
331  /// - false, otherwise.
332  bool IsSetAssay(void) const;
333 
334  /// Check if it is safe to call GetAssay method.
335  ///
336  /// @return
337  /// - true, if the data member is getatable.
338  /// - false, otherwise.
339  bool CanGetAssay(void) const;
340 
341  /// Reset Assay data member.
342  void ResetAssay(void);
343 
344  /// Get the Assay member data.
345  ///
346  /// @return
347  /// Reference to the member data.
348  const TAssay& GetAssay(void) const;
349 
350  /// Assign a value to Assay data member.
351  ///
352  /// @param value
353  /// Reference to value.
355 
356  /// Assign a value to Assay data member.
357  ///
358  /// @return
359  /// Reference to the data value.
360  TAssay& SetAssay(void);
361 
362  /// Assay Data Deposition (vector)
363  /// Check if a value has been assigned to Data data member.
364  ///
365  /// Data member Data is optional;
366  /// its type is defined as 'typedef vector< CRef< CPC_AssayResults > > TData'
367  /// @return
368  /// - true, if a value has been assigned.
369  /// - false, otherwise.
370  bool IsSetData(void) const;
371 
372  /// Check if it is safe to call GetData method.
373  ///
374  /// @return
375  /// - true, if the data member is getatable.
376  /// - false, otherwise.
377  bool CanGetData(void) const;
378 
379  /// Reset Data data member.
380  void ResetData(void);
381 
382  /// Get the Data member data.
383  ///
384  /// @return
385  /// Reference to the member data.
386  const TData& GetData(void) const;
387 
388  /// Assign a value to Data data member.
389  ///
390  /// @return
391  /// Reference to the data value.
392  TData& SetData(void);
393 
394  /// List of SID's whose data is to be suppressed (vector)
395  /// Check if a value has been assigned to Revoke data member.
396  ///
397  /// Data member Revoke is optional;
398  /// its type is defined as 'typedef vector< int > TRevoke'
399  /// @return
400  /// - true, if a value has been assigned.
401  /// - false, otherwise.
402  bool IsSetRevoke(void) const;
403 
404  /// Check if it is safe to call GetRevoke method.
405  ///
406  /// @return
407  /// - true, if the data member is getatable.
408  /// - false, otherwise.
409  bool CanGetRevoke(void) const;
410 
411  /// Reset Revoke data member.
412  void ResetRevoke(void);
413 
414  /// Get the Revoke member data.
415  ///
416  /// @return
417  /// Reference to the member data.
418  const TRevoke& GetRevoke(void) const;
419 
420  /// Assign a value to Revoke data member.
421  ///
422  /// @return
423  /// Reference to the data value.
425 
426  /// Reset the whole object
427  virtual void Reset(void);
428 
429 
430 private:
431  // Prohibit copy constructor and assignment operator
434 
435  // data
436  Uint4 m_set_State[1];
438  vector< CRef< CPC_AssayResults > > m_Data;
439  vector< int > m_Revoke;
440 };
441 
442 /* @} */
443 
444 
445 
446 
447 
448 ///////////////////////////////////////////////////////////
449 ///////////////////// inline methods //////////////////////
450 ///////////////////////////////////////////////////////////
451 inline
453 {
454  return m_choice;
455 }
456 
457 inline
458 void CPC_AssaySubmit_Base::C_Assay::CheckSelected(E_Choice index) const
459 {
460  if ( m_choice != index )
461  ThrowInvalidSelection(index);
462 }
463 
464 inline
465 void CPC_AssaySubmit_Base::C_Assay::Select(E_Choice index, NCBI_NS_NCBI::EResetVariant reset, NCBI_NS_NCBI::CObjectMemoryPool* pool)
466 {
467  if ( reset == NCBI_NS_NCBI::eDoResetVariant || m_choice != index ) {
468  if ( m_choice != e_not_set )
469  ResetSelection();
470  DoSelect(index, pool);
471  }
472 }
473 
474 inline
476 {
477  Select(index, reset, 0);
478 }
479 
480 inline
482 {
483  return m_choice == e_Aid;
484 }
485 
486 inline
488 {
489  CheckSelected(e_Aid);
490  return m_Aid;
491 }
492 
493 inline
495 {
496  Select(e_Aid, NCBI_NS_NCBI::eDoNotResetVariant);
497  return m_Aid;
498 }
499 
500 inline
502 {
503  Select(e_Aid, NCBI_NS_NCBI::eDoNotResetVariant);
504  m_Aid = value;
505 }
506 
507 inline
509 {
510  return m_choice == e_Aid_source;
511 }
512 
513 inline
515 {
516  return m_choice == e_Descr;
517 }
518 
519 inline
521 {
522  return m_choice == e_Aidver;
523 }
524 
525 inline
526 bool CPC_AssaySubmit_Base::IsSetAssay(void) const
527 {
528  return m_Assay.NotEmpty();
529 }
530 
531 inline
532 bool CPC_AssaySubmit_Base::CanGetAssay(void) const
533 {
534  return true;
535 }
536 
537 inline
539 {
540  if ( !m_Assay ) {
541  const_cast<CPC_AssaySubmit_Base*>(this)->ResetAssay();
542  }
543  return (*m_Assay);
544 }
545 
546 inline
548 {
549  if ( !m_Assay ) {
550  ResetAssay();
551  }
552  return (*m_Assay);
553 }
554 
555 inline
556 bool CPC_AssaySubmit_Base::IsSetData(void) const
557 {
558  return ((m_set_State[0] & 0xc) != 0);
559 }
560 
561 inline
562 bool CPC_AssaySubmit_Base::CanGetData(void) const
563 {
564  return true;
565 }
566 
567 inline
569 {
570  return m_Data;
571 }
572 
573 inline
575 {
576  m_set_State[0] |= 0x4;
577  return m_Data;
578 }
579 
580 inline
581 bool CPC_AssaySubmit_Base::IsSetRevoke(void) const
582 {
583  return ((m_set_State[0] & 0x30) != 0);
584 }
585 
586 inline
587 bool CPC_AssaySubmit_Base::CanGetRevoke(void) const
588 {
589  return true;
590 }
591 
592 inline
594 {
595  return m_Revoke;
596 }
597 
598 inline
600 {
601  m_set_State[0] |= 0x10;
602  return m_Revoke;
603 }
604 
605 ///////////////////////////////////////////////////////////
606 ////////////////// end of inline methods //////////////////
607 ///////////////////////////////////////////////////////////
608 
609 
610 
611 
612 
613 END_pcassay2_SCOPE // namespace ncbi::objects::pcassay2::
614 
615 END_objects_SCOPE // namespace ncbi::objects::
616 
618 
619 
620 #endif // OBJECTS_PCASSAY2_PC_ASSAYSUBMIT_BASE_HPP
CPC_AssayDescription –.
CPC_AssayResults –.
Assay Description or pre-existing Identifier.
Container for Data Depositions and Assay Definitions.
CPC_ID –.
Definition: PC_ID.hpp:66
CPC_Source –.
Definition: PC_Source.hpp:66
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
EResetVariant
Definition: serialbase.hpp:76
@ eDoResetVariant
Definition: serialbase.hpp:77
@ eDoNotResetVariant
Definition: serialbase.hpp:78
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
TAid GetAid(void) const
Get the variant data.
TAidver & SetAidver(void)
Select the variant.
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
const TAid_source & GetAid_source(void) const
Get the variant data.
bool CanGetAssay(void) const
Check if it is safe to call GetAssay method.
void ResetAssay(void)
Reset Assay data member.
bool IsAidver(void) const
Check if variant Aidver is selected.
TData & SetData(void)
Assign a value to Data data member.
void ResetRevoke(void)
Reset Revoke data member.
void SetAidver(TAidver &value)
Select the variant and set its data.
void SetAssay(TAssay &value)
Assign a value to Assay data member.
CPC_AssaySubmit_Base & operator=(const CPC_AssaySubmit_Base &)
virtual void Reset(void)
Reset the whole object.
TDescr & SetDescr(void)
Select the variant.
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
TRevoke & SetRevoke(void)
Assign a value to Revoke data member.
void Select(E_Choice index, EResetVariant reset, CObjectMemoryPool *pool)
Select the requested variant if needed, allocating CObject variants from memory pool.
bool IsSetData(void) const
Assay Data Deposition (vector) Check if a value has been assigned to Data data member.
void ResetSelection(void)
Reset the selection (set it to e_not_set).
TAssay & SetAssay(void)
Assign a value to Assay data member.
bool CanGetRevoke(void) const
Check if it is safe to call GetRevoke method.
const TDescr & GetDescr(void) const
Get the variant data.
const TRevoke & GetRevoke(void) const
Get the Revoke member data.
void SetAid_source(TAid_source &value)
Select the variant and set its data.
C_Assay & operator=(const C_Assay &)
const TAidver & GetAidver(void) const
Get the variant data.
bool IsAid_source(void) const
Check if variant Aid_source is selected.
CPC_AssaySubmit_Base(const CPC_AssaySubmit_Base &)
bool IsSetRevoke(void) const
List of SID's whose data is to be suppressed (vector) Check if a value has been assigned to Revoke da...
virtual ~CPC_AssaySubmit_Base(void)
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
TAid_source & SetAid_source(void)
Select the variant.
vector< CRef< CPC_AssayResults > > TData
bool IsSetAssay(void) const
Check if a value has been assigned to Assay data member.
NCBI_NS_NCBI::CSerialObject * m_object
E_Choice Which(void) const
Which variant is currently selected.
void SetAid(TAid value)
Select the variant and set its data.
void Reset(void)
Reset the whole object.
bool IsAid(void) const
Check if variant Aid is selected.
const TAssay & GetAssay(void) const
Get the Assay member data.
const TData & GetData(void) const
Get the Data member data.
void ResetData(void)
Reset Data data member.
bool CanGetData(void) const
Check if it is safe to call GetData method.
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
bool IsDescr(void) const
Check if variant Descr is selected.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
void SetDescr(TDescr &value)
Select the variant and set its data.
TAid & SetAid(void)
Select the variant.
@ e_Aid_source
External Assay Identifier.
@ e_Descr
Assay Description (new or updated)
@ e_Aidver
Assay Identifier/Version (for internal use)
@ e_not_set
No variant selected.
static const char *const sm_SelectionNames[]
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
bool CanGetAssay(void) const
Check if it is safe to call GetAssay method.
void ResetAssay(void)
Reset Assay data member.
bool IsAidver(void) const
Check if variant Aidver is selected.
vector< CRef< CPC_AssayResults > > m_Data
bool IsSetData(void) const
Assay Data Deposition (vector) Check if a value has been assigned to Data data member.
bool CanGetRevoke(void) const
Check if it is safe to call GetRevoke method.
const TRevoke & GetRevoke(void) const
Get the Revoke member data.
const TData & GetData(void) const
Get the Data member data.
E_Choice Which(void) const
Which variant is currently selected.
bool IsAid_source(void) const
Check if variant Aid_source is selected.
TAid GetAid(void) const
Get the variant data.
bool IsSetRevoke(void) const
List of SID's whose data is to be suppressed Check if a value has been assigned to Revoke data member...
E_ChoiceStopper
Maximum+1 value of the choice variant enumerator.
vector< CRef< CPC_AssayResults > > TData
bool IsSetAssay(void) const
Check if a value has been assigned to Assay data member.
TAid & SetAid(void)
Select the variant.
bool IsAid(void) const
Check if variant Aid is selected.
TData & SetData(void)
Assign a value to Data data member.
TRevoke & SetRevoke(void)
Assign a value to Revoke data member.
bool CanGetData(void) const
Check if it is safe to call GetData method.
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
TAssay & SetAssay(void)
Assign a value to Assay data member.
bool IsDescr(void) const
Check if variant Descr is selected.
const TAssay & GetAssay(void) const
Get the Assay member data.
@ e_not_set
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
#define END_pcassay2_SCOPE
#define BEGIN_pcassay2_SCOPE
Modified on Wed Jun 12 11:20:44 2024 by modify_doxy.py rev. 669887