NCBI C++ ToolKit
PC_AssayTargetInfo_.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_AssayTargetInfo_.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/pcassay/pcassay.asn">pcassay.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/pcassay/pcassay.def">pcassay.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_PCASSAY_PC_ASSAYTARGETINFO_BASE_HPP
42 #define OBJECTS_PCASSAY_PC_ASSAYTARGETINFO_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 CBioSource;
62 
63 
64 // generated classes
65 
66 
67 /** @addtogroup dataspec_NCBI_PCAssay
68  *
69  * @{
70  */
71 
72 /////////////////////////////////////////////////////////////////////////////
73 /// Molecular target information provides by organization describes the functionality of the target,
74 /// facilitates the linking between PubChem bioassays, and the linking between target molecule to other NCBI resources
75 ///
76 /// CPC_AssayTargetInfo_Base --
77 ///
78 
80 {
82 public:
83  // constructor
85  // destructor
86  virtual ~CPC_AssayTargetInfo_Base(void);
87 
88  // type info
90 
91  /// Assay Target Type
93  eMolecule_type_protein = 1, ///< mol-id: NCBI Protein GI
94  eMolecule_type_dna = 2, ///< mol-id: NCBI Nucleotide GI
95  eMolecule_type_rna = 3, ///< mol-id: NCBI Nucleotide GI
96  eMolecule_type_gene = 4, ///< mol-id: NCBI Gene ID
97  eMolecule_type_biosystem = 5, ///< mol-id: NCBI BioSystems ID
98  eMolecule_type_other = 255
99  };
100 
101  /// Access to EMolecule_type's attributes (values, names) as defined in spec
102  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EMolecule_type)(void);
103 
104  // types
105  typedef string TName;
106  typedef int TMol_id;
107  typedef int TMolecule_type;
109  typedef string TDescr;
110  typedef list< string > TComment;
111 
112  // member index
113  enum class E_memberIndex {
114  e__allMandatory = 0,
115  e_name,
116  e_mol_id,
117  e_molecule_type,
118  e_organism,
119  e_descr,
120  e_comment
121  };
123 
124  // getters
125  // setters
126 
127  /// Molecular name of target
128  /// Check if a value has been assigned to Name data member.
129  ///
130  /// Data member Name is mandatory;
131  /// its type is defined as 'typedef string TName'
132  /// @return
133  /// - true, if a value has been assigned.
134  /// - false, otherwise.
135  bool IsSetName(void) const;
136 
137  /// Check if it is safe to call GetName method.
138  ///
139  /// @return
140  /// - true, if the data member is getatable.
141  /// - false, otherwise.
142  bool CanGetName(void) const;
143 
144  /// Reset Name data member.
145  void ResetName(void);
146 
147  /// Get the Name member data.
148  ///
149  /// @return
150  /// Reference to the member data.
151  const TName& GetName(void) const;
152 
153  /// Assign a value to Name data member.
154  ///
155  /// @param value
156  /// Value to assign
157  void SetName(const TName& value);
158  void SetName(TName&& value);
159 
160  /// Assign a value to Name data member.
161  ///
162  /// @return
163  /// Reference to the data value.
164  TName& SetName(void);
165 
166  /// NCBI database identifier of the target molecule
167  /// Check if a value has been assigned to Mol_id data member.
168  ///
169  /// Data member Mol_id is mandatory;
170  /// its type is defined as 'typedef int TMol_id'
171  /// @return
172  /// - true, if a value has been assigned.
173  /// - false, otherwise.
174  bool IsSetMol_id(void) const;
175 
176  /// Check if it is safe to call GetMol_id method.
177  ///
178  /// @return
179  /// - true, if the data member is getatable.
180  /// - false, otherwise.
181  bool CanGetMol_id(void) const;
182 
183  /// Reset Mol_id data member.
184  void ResetMol_id(void);
185 
186  /// Get the Mol_id member data.
187  ///
188  /// @return
189  /// Copy of the member data.
190  TMol_id GetMol_id(void) const;
191 
192  /// Assign a value to Mol_id data member.
193  ///
194  /// @param value
195  /// Value to assign
196  void SetMol_id(TMol_id value);
197 
198  /// Assign a value to Mol_id data member.
199  ///
200  /// @return
201  /// Reference to the data value.
202  TMol_id& SetMol_id(void);
203 
204  /// Check if a value has been assigned to Molecule_type data member.
205  ///
206  /// Data member Molecule_type is optional with default eMolecule_type_protein;
207  /// its type is defined as 'typedef int TMolecule_type'
208  /// @return
209  /// - true, if a value has been assigned.
210  /// - false, otherwise.
211  bool IsSetMolecule_type(void) const;
212 
213  /// Check if it is safe to call GetMolecule_type method.
214  ///
215  /// @return
216  /// - true, if the data member is getatable.
217  /// - false, otherwise.
218  bool CanGetMolecule_type(void) const;
219 
220  /// Reset Molecule_type data member.
221  void ResetMolecule_type(void);
222 
223  /// Assign default value to Molecule_type data member.
224  void SetDefaultMolecule_type(void);
225 
226  /// Get the Molecule_type member data.
227  ///
228  /// @return
229  /// Copy of the member data.
230  TMolecule_type GetMolecule_type(void) const;
231 
232  /// Assign a value to Molecule_type data member.
233  ///
234  /// @param value
235  /// Value to assign
236  void SetMolecule_type(TMolecule_type value);
237 
238  /// Assign a value to Molecule_type data member.
239  ///
240  /// @return
241  /// Reference to the data value.
242  TMolecule_type& SetMolecule_type(void);
243 
244  /// Target Organism
245  /// Check if a value has been assigned to Organism data member.
246  ///
247  /// Data member Organism is optional;
248  /// its type is defined as 'typedef CBioSource TOrganism'
249  /// @return
250  /// - true, if a value has been assigned.
251  /// - false, otherwise.
252  bool IsSetOrganism(void) const;
253 
254  /// Check if it is safe to call GetOrganism method.
255  ///
256  /// @return
257  /// - true, if the data member is getatable.
258  /// - false, otherwise.
259  bool CanGetOrganism(void) const;
260 
261  /// Reset Organism data member.
262  void ResetOrganism(void);
263 
264  /// Get the Organism member data.
265  ///
266  /// @return
267  /// Reference to the member data.
268  const TOrganism& GetOrganism(void) const;
269 
270  /// Assign a value to Organism data member.
271  ///
272  /// @param value
273  /// Reference to value.
274  void SetOrganism(TOrganism& value);
275 
276  /// Assign a value to Organism data member.
277  ///
278  /// @return
279  /// Reference to the data value.
280  TOrganism& SetOrganism(void);
281 
282  /// Target Description (e.g., cellular functionality and location)
283  /// Check if a value has been assigned to Descr data member.
284  ///
285  /// Data member Descr is optional;
286  /// its type is defined as 'typedef string TDescr'
287  /// @return
288  /// - true, if a value has been assigned.
289  /// - false, otherwise.
290  bool IsSetDescr(void) const;
291 
292  /// Check if it is safe to call GetDescr method.
293  ///
294  /// @return
295  /// - true, if the data member is getatable.
296  /// - false, otherwise.
297  bool CanGetDescr(void) const;
298 
299  /// Reset Descr data member.
300  void ResetDescr(void);
301 
302  /// Get the Descr member data.
303  ///
304  /// @return
305  /// Reference to the member data.
306  const TDescr& GetDescr(void) const;
307 
308  /// Assign a value to Descr data member.
309  ///
310  /// @param value
311  /// Value to assign
312  void SetDescr(const TDescr& value);
313  void SetDescr(TDescr&& value);
314 
315  /// Assign a value to Descr data member.
316  ///
317  /// @return
318  /// Reference to the data value.
319  TDescr& SetDescr(void);
320 
321  /// Comments or Additional Information
322  /// Check if a value has been assigned to Comment data member.
323  ///
324  /// Data member Comment is optional;
325  /// its type is defined as 'typedef list< string > TComment'
326  /// @return
327  /// - true, if a value has been assigned.
328  /// - false, otherwise.
329  bool IsSetComment(void) const;
330 
331  /// Check if it is safe to call GetComment method.
332  ///
333  /// @return
334  /// - true, if the data member is getatable.
335  /// - false, otherwise.
336  bool CanGetComment(void) const;
337 
338  /// Reset Comment data member.
339  void ResetComment(void);
340 
341  /// Get the Comment member data.
342  ///
343  /// @return
344  /// Reference to the member data.
345  const TComment& GetComment(void) const;
346 
347  /// Assign a value to Comment data member.
348  ///
349  /// @return
350  /// Reference to the data value.
351  TComment& SetComment(void);
352 
353  /// Reset the whole object
354  virtual void Reset(void);
355 
356 
357 private:
358  // Prohibit copy constructor and assignment operator
361 
362  // data
363  Uint4 m_set_State[1];
364  string m_Name;
365  int m_Mol_id;
368  string m_Descr;
369  list< string > m_Comment;
370 };
371 
372 /* @} */
373 
374 
375 
376 
377 
378 ///////////////////////////////////////////////////////////
379 ///////////////////// inline methods //////////////////////
380 ///////////////////////////////////////////////////////////
381 inline
383 {
384  return ((m_set_State[0] & 0x3) != 0);
385 }
386 
387 inline
389 {
390  return IsSetName();
391 }
392 
393 inline
395 {
396  if (!CanGetName()) {
397  ThrowUnassigned(0);
398  }
399  return m_Name;
400 }
401 
402 inline
404 {
405  m_Name = value;
406  m_set_State[0] |= 0x3;
407 }
408 
409 inline
411 {
412  m_Name = std::forward<CPC_AssayTargetInfo_Base::TName>(value);
413  m_set_State[0] |= 0x3;
414 }
415 
416 inline
418 {
419 #ifdef _DEBUG
420  if (!IsSetName()) {
422  }
423 #endif
424  m_set_State[0] |= 0x1;
425  return m_Name;
426 }
427 
428 inline
430 {
431  return ((m_set_State[0] & 0xc) != 0);
432 }
433 
434 inline
436 {
437  return IsSetMol_id();
438 }
439 
440 inline
442 {
443  m_Mol_id = 0;
444  m_set_State[0] &= ~0xc;
445 }
446 
447 inline
449 {
450  if (!CanGetMol_id()) {
451  ThrowUnassigned(1);
452  }
453  return m_Mol_id;
454 }
455 
456 inline
458 {
459  m_Mol_id = value;
460  m_set_State[0] |= 0xc;
461 }
462 
463 inline
465 {
466 #ifdef _DEBUG
467  if (!IsSetMol_id()) {
468  memset(&m_Mol_id,UnassignedByte(),sizeof(m_Mol_id));
469  }
470 #endif
471  m_set_State[0] |= 0x4;
472  return m_Mol_id;
473 }
474 
475 inline
477 {
478  return ((m_set_State[0] & 0x30) != 0);
479 }
480 
481 inline
483 {
484  return true;
485 }
486 
487 inline
489 {
491  m_set_State[0] &= ~0x30;
492 }
493 
494 inline
496 {
498 }
499 
500 inline
502 {
503  return m_Molecule_type;
504 }
505 
506 inline
508 {
510  m_set_State[0] |= 0x30;
511 }
512 
513 inline
515 {
516 #ifdef _DEBUG
517  if (!IsSetMolecule_type()) {
519  }
520 #endif
521  m_set_State[0] |= 0x10;
522  return m_Molecule_type;
523 }
524 
525 inline
527 {
528  return m_Organism.NotEmpty();
529 }
530 
531 inline
533 {
534  return IsSetOrganism();
535 }
536 
537 inline
539 {
540  if (!CanGetOrganism()) {
541  ThrowUnassigned(3);
542  }
543  return (*m_Organism);
544 }
545 
546 inline
548 {
549  return ((m_set_State[0] & 0x300) != 0);
550 }
551 
552 inline
554 {
555  return IsSetDescr();
556 }
557 
558 inline
560 {
561  if (!CanGetDescr()) {
562  ThrowUnassigned(4);
563  }
564  return m_Descr;
565 }
566 
567 inline
569 {
570  m_Descr = value;
571  m_set_State[0] |= 0x300;
572 }
573 
574 inline
576 {
577  m_Descr = std::forward<CPC_AssayTargetInfo_Base::TDescr>(value);
578  m_set_State[0] |= 0x300;
579 }
580 
581 inline
583 {
584 #ifdef _DEBUG
585  if (!IsSetDescr()) {
587  }
588 #endif
589  m_set_State[0] |= 0x100;
590  return m_Descr;
591 }
592 
593 inline
595 {
596  return ((m_set_State[0] & 0xc00) != 0);
597 }
598 
599 inline
601 {
602  return true;
603 }
604 
605 inline
607 {
608  return m_Comment;
609 }
610 
611 inline
613 {
614  m_set_State[0] |= 0x400;
615  return m_Comment;
616 }
617 
618 ///////////////////////////////////////////////////////////
619 ////////////////// end of inline methods //////////////////
620 ///////////////////////////////////////////////////////////
621 
622 
623 
624 
625 
626 END_objects_SCOPE // namespace ncbi::objects::
627 
629 
630 
631 #endif // OBJECTS_PCASSAY_PC_ASSAYTARGETINFO_BASE_HPP
Molecular target information provides by organization describes the functionality of the target,...
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
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_PCASSAY_EXPORT
Definition: ncbi_export.h:680
bool IsSetMol_id(void) const
NCBI database identifier of the target molecule Check if a value has been assigned to Mol_id data mem...
bool CanGetName(void) const
Check if it is safe to call GetName method.
bool CanGetDescr(void) const
Check if it is safe to call GetDescr method.
const TDescr & GetDescr(void) const
Get the Descr member data.
CPC_AssayTargetInfo_Base(const CPC_AssayTargetInfo_Base &)
TMol_id GetMol_id(void) const
Get the Mol_id member data.
CPC_AssayTargetInfo_Base & operator=(const CPC_AssayTargetInfo_Base &)
void SetDefaultMolecule_type(void)
Assign default value to Molecule_type data member.
TComment & SetComment(void)
Assign a value to Comment data member.
bool IsSetDescr(void) const
Target Description (e.g., cellular functionality and location) Check if a value has been assigned to ...
bool IsSetName(void) const
Molecular name of target Check if a value has been assigned to Name data member.
Tparent::CMemberIndex< E_memberIndex, 7 > TmemberIndex
TMolecule_type GetMolecule_type(void) const
Get the Molecule_type member data.
bool CanGetMolecule_type(void) const
Check if it is safe to call GetMolecule_type method.
bool CanGetMol_id(void) const
Check if it is safe to call GetMol_id method.
const TComment & GetComment(void) const
Get the Comment member data.
TDescr & SetDescr(void)
Assign a value to Descr data member.
const TOrganism & GetOrganism(void) const
Get the Organism member data.
EMolecule_type
Assay Target Type.
bool CanGetOrganism(void) const
Check if it is safe to call GetOrganism method.
bool IsSetOrganism(void) const
Target Organism Check if a value has been assigned to Organism data member.
bool IsSetComment(void) const
Comments or Additional Information Check if a value has been assigned to Comment data member.
TName & SetName(void)
Assign a value to Name data member.
bool IsSetMolecule_type(void) const
Check if a value has been assigned to Molecule_type data member.
const TName & GetName(void) const
Get the Name member data.
bool CanGetComment(void) const
Check if it is safe to call GetComment method.
void ResetMol_id(void)
Reset Mol_id data member.
TMol_id & SetMol_id(void)
Assign a value to Mol_id data member.
TMolecule_type & SetMolecule_type(void)
Assign a value to Molecule_type data member.
void ResetMolecule_type(void)
Reset Molecule_type data member.
@ eMolecule_type_protein
mol-id: NCBI Protein GI
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sun Jul 21 04:22:00 2024 by modify_doxy.py rev. 669887