NCBI C++ ToolKit
PC_MMDBSource_.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_MMDBSource_.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/pcsubstance/pcsubstance.asn">pcsubstance.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/pcsubstance/pcsubstance.def">pcsubstance.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_PCSUBSTANCE_PC_MMDBSOURCE_BASE_HPP
42 #define OBJECTS_PCSUBSTANCE_PC_MMDBSOURCE_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 // generated classes
61 
62 
63 /** @addtogroup dataspec_NCBI_PCSubstance
64  *
65  * @{
66  */
67 
68 /////////////////////////////////////////////////////////////////////////////
69 /// MMDB Source Record detailing specific location or part of an MMDB Record
70 ///
71 /// CPC_MMDBSource_Base --
72 ///
73 
75 {
77 public:
78  // constructor
79  CPC_MMDBSource_Base(void);
80  // destructor
81  virtual ~CPC_MMDBSource_Base(void);
82 
83  // type info
85 
86  // types
87  typedef int TMmdb_id;
88  typedef int TMolecule_id;
89  typedef list< string > TMolecule_name;
90  typedef int TResidue_id;
91  typedef string TResidue_name;
92  typedef int TAtom_id;
93  typedef string TAtom_name;
94 
95  // member index
96  enum class E_memberIndex {
97  e__allMandatory = 0,
98  e_mmdb_id,
99  e_molecule_id,
100  e_molecule_name,
101  e_residue_id,
102  e_residue_name,
103  e_atom_id,
104  e_atom_name
105  };
107 
108  // getters
109  // setters
110 
111  /// MMDB Record ID
112  /// Note: Must be greater than "0" or, if invalid, "0"
113  /// Check if a value has been assigned to Mmdb_id data member.
114  ///
115  /// Data member Mmdb_id is mandatory;
116  /// its type is defined as 'typedef int TMmdb_id'
117  /// @return
118  /// - true, if a value has been assigned.
119  /// - false, otherwise.
120  bool IsSetMmdb_id(void) const;
121 
122  /// Check if it is safe to call GetMmdb_id method.
123  ///
124  /// @return
125  /// - true, if the data member is getatable.
126  /// - false, otherwise.
127  bool CanGetMmdb_id(void) const;
128 
129  /// Reset Mmdb_id data member.
130  void ResetMmdb_id(void);
131 
132  /// Get the Mmdb_id member data.
133  ///
134  /// @return
135  /// Copy of the member data.
136  TMmdb_id GetMmdb_id(void) const;
137 
138  /// Assign a value to Mmdb_id data member.
139  ///
140  /// @param value
141  /// Value to assign
142  void SetMmdb_id(TMmdb_id value);
143 
144  /// Assign a value to Mmdb_id data member.
145  ///
146  /// @return
147  /// Reference to the data value.
148  TMmdb_id& SetMmdb_id(void);
149 
150  /// MMDB Molecule ID
151  /// Note: Must be greater than "0" or, if invalid, "0"
152  /// Check if a value has been assigned to Molecule_id data member.
153  ///
154  /// Data member Molecule_id is mandatory;
155  /// its type is defined as 'typedef int TMolecule_id'
156  /// @return
157  /// - true, if a value has been assigned.
158  /// - false, otherwise.
159  bool IsSetMolecule_id(void) const;
160 
161  /// Check if it is safe to call GetMolecule_id method.
162  ///
163  /// @return
164  /// - true, if the data member is getatable.
165  /// - false, otherwise.
166  bool CanGetMolecule_id(void) const;
167 
168  /// Reset Molecule_id data member.
169  void ResetMolecule_id(void);
170 
171  /// Get the Molecule_id member data.
172  ///
173  /// @return
174  /// Copy of the member data.
175  TMolecule_id GetMolecule_id(void) const;
176 
177  /// Assign a value to Molecule_id data member.
178  ///
179  /// @param value
180  /// Value to assign
181  void SetMolecule_id(TMolecule_id value);
182 
183  /// Assign a value to Molecule_id data member.
184  ///
185  /// @return
186  /// Reference to the data value.
187  TMolecule_id& SetMolecule_id(void);
188 
189  /// MMDB Molecule Name
190  /// Check if a value has been assigned to Molecule_name data member.
191  ///
192  /// Data member Molecule_name is mandatory;
193  /// its type is defined as 'typedef list< string > TMolecule_name'
194  /// @return
195  /// - true, if a value has been assigned.
196  /// - false, otherwise.
197  bool IsSetMolecule_name(void) const;
198 
199  /// Check if it is safe to call GetMolecule_name method.
200  ///
201  /// @return
202  /// - true, if the data member is getatable.
203  /// - false, otherwise.
204  bool CanGetMolecule_name(void) const;
205 
206  /// Reset Molecule_name data member.
207  void ResetMolecule_name(void);
208 
209  /// Get the Molecule_name member data.
210  ///
211  /// @return
212  /// Reference to the member data.
213  const TMolecule_name& GetMolecule_name(void) const;
214 
215  /// Assign a value to Molecule_name data member.
216  ///
217  /// @return
218  /// Reference to the data value.
219  TMolecule_name& SetMolecule_name(void);
220 
221  /// Residue ID
222  /// Note: Must be greater than "0" or, if invalid, "0"
223  /// Check if a value has been assigned to Residue_id data member.
224  ///
225  /// Data member Residue_id is optional;
226  /// its type is defined as 'typedef int TResidue_id'
227  /// @return
228  /// - true, if a value has been assigned.
229  /// - false, otherwise.
230  bool IsSetResidue_id(void) const;
231 
232  /// Check if it is safe to call GetResidue_id method.
233  ///
234  /// @return
235  /// - true, if the data member is getatable.
236  /// - false, otherwise.
237  bool CanGetResidue_id(void) const;
238 
239  /// Reset Residue_id data member.
240  void ResetResidue_id(void);
241 
242  /// Get the Residue_id member data.
243  ///
244  /// @return
245  /// Copy of the member data.
246  TResidue_id GetResidue_id(void) const;
247 
248  /// Assign a value to Residue_id data member.
249  ///
250  /// @param value
251  /// Value to assign
252  void SetResidue_id(TResidue_id value);
253 
254  /// Assign a value to Residue_id data member.
255  ///
256  /// @return
257  /// Reference to the data value.
258  TResidue_id& SetResidue_id(void);
259 
260  /// Residue Name
261  /// Check if a value has been assigned to Residue_name data member.
262  ///
263  /// Data member Residue_name is optional;
264  /// its type is defined as 'typedef string TResidue_name'
265  /// @return
266  /// - true, if a value has been assigned.
267  /// - false, otherwise.
268  bool IsSetResidue_name(void) const;
269 
270  /// Check if it is safe to call GetResidue_name method.
271  ///
272  /// @return
273  /// - true, if the data member is getatable.
274  /// - false, otherwise.
275  bool CanGetResidue_name(void) const;
276 
277  /// Reset Residue_name data member.
278  void ResetResidue_name(void);
279 
280  /// Get the Residue_name member data.
281  ///
282  /// @return
283  /// Reference to the member data.
284  const TResidue_name& GetResidue_name(void) const;
285 
286  /// Assign a value to Residue_name data member.
287  ///
288  /// @param value
289  /// Value to assign
290  void SetResidue_name(const TResidue_name& value);
291  void SetResidue_name(TResidue_name&& value);
292 
293  /// Assign a value to Residue_name data member.
294  ///
295  /// @return
296  /// Reference to the data value.
297  TResidue_name& SetResidue_name(void);
298 
299  /// Atom ID
300  /// Note: Must be greater than "0" or, if invalid, "0"
301  /// Check if a value has been assigned to Atom_id data member.
302  ///
303  /// Data member Atom_id is optional;
304  /// its type is defined as 'typedef int TAtom_id'
305  /// @return
306  /// - true, if a value has been assigned.
307  /// - false, otherwise.
308  bool IsSetAtom_id(void) const;
309 
310  /// Check if it is safe to call GetAtom_id method.
311  ///
312  /// @return
313  /// - true, if the data member is getatable.
314  /// - false, otherwise.
315  bool CanGetAtom_id(void) const;
316 
317  /// Reset Atom_id data member.
318  void ResetAtom_id(void);
319 
320  /// Get the Atom_id member data.
321  ///
322  /// @return
323  /// Copy of the member data.
324  TAtom_id GetAtom_id(void) const;
325 
326  /// Assign a value to Atom_id data member.
327  ///
328  /// @param value
329  /// Value to assign
330  void SetAtom_id(TAtom_id value);
331 
332  /// Assign a value to Atom_id data member.
333  ///
334  /// @return
335  /// Reference to the data value.
336  TAtom_id& SetAtom_id(void);
337 
338  /// Atom Name
339  /// Check if a value has been assigned to Atom_name data member.
340  ///
341  /// Data member Atom_name is optional;
342  /// its type is defined as 'typedef string TAtom_name'
343  /// @return
344  /// - true, if a value has been assigned.
345  /// - false, otherwise.
346  bool IsSetAtom_name(void) const;
347 
348  /// Check if it is safe to call GetAtom_name method.
349  ///
350  /// @return
351  /// - true, if the data member is getatable.
352  /// - false, otherwise.
353  bool CanGetAtom_name(void) const;
354 
355  /// Reset Atom_name data member.
356  void ResetAtom_name(void);
357 
358  /// Get the Atom_name member data.
359  ///
360  /// @return
361  /// Reference to the member data.
362  const TAtom_name& GetAtom_name(void) const;
363 
364  /// Assign a value to Atom_name data member.
365  ///
366  /// @param value
367  /// Value to assign
368  void SetAtom_name(const TAtom_name& value);
369  void SetAtom_name(TAtom_name&& value);
370 
371  /// Assign a value to Atom_name data member.
372  ///
373  /// @return
374  /// Reference to the data value.
375  TAtom_name& SetAtom_name(void);
376 
377  /// Reset the whole object
378  virtual void Reset(void);
379 
380 
381 private:
382  // Prohibit copy constructor and assignment operator
385 
386  // data
387  Uint4 m_set_State[1];
390  list< string > m_Molecule_name;
394  string m_Atom_name;
395 };
396 
397 /* @} */
398 
399 
400 
401 
402 
403 ///////////////////////////////////////////////////////////
404 ///////////////////// inline methods //////////////////////
405 ///////////////////////////////////////////////////////////
406 inline
408 {
409  return ((m_set_State[0] & 0x3) != 0);
410 }
411 
412 inline
414 {
415  return IsSetMmdb_id();
416 }
417 
418 inline
420 {
421  m_Mmdb_id = 0;
422  m_set_State[0] &= ~0x3;
423 }
424 
425 inline
427 {
428  if (!CanGetMmdb_id()) {
429  ThrowUnassigned(0);
430  }
431  return m_Mmdb_id;
432 }
433 
434 inline
436 {
437  m_Mmdb_id = value;
438  m_set_State[0] |= 0x3;
439 }
440 
441 inline
443 {
444 #ifdef _DEBUG
445  if (!IsSetMmdb_id()) {
446  memset(&m_Mmdb_id,UnassignedByte(),sizeof(m_Mmdb_id));
447  }
448 #endif
449  m_set_State[0] |= 0x1;
450  return m_Mmdb_id;
451 }
452 
453 inline
455 {
456  return ((m_set_State[0] & 0xc) != 0);
457 }
458 
459 inline
461 {
462  return IsSetMolecule_id();
463 }
464 
465 inline
467 {
468  m_Molecule_id = 0;
469  m_set_State[0] &= ~0xc;
470 }
471 
472 inline
474 {
475  if (!CanGetMolecule_id()) {
476  ThrowUnassigned(1);
477  }
478  return m_Molecule_id;
479 }
480 
481 inline
483 {
485  m_set_State[0] |= 0xc;
486 }
487 
488 inline
490 {
491 #ifdef _DEBUG
492  if (!IsSetMolecule_id()) {
493  memset(&m_Molecule_id,UnassignedByte(),sizeof(m_Molecule_id));
494  }
495 #endif
496  m_set_State[0] |= 0x4;
497  return m_Molecule_id;
498 }
499 
500 inline
502 {
503  return ((m_set_State[0] & 0x30) != 0);
504 }
505 
506 inline
508 {
509  return true;
510 }
511 
512 inline
514 {
515  return m_Molecule_name;
516 }
517 
518 inline
520 {
521  m_set_State[0] |= 0x10;
522  return m_Molecule_name;
523 }
524 
525 inline
527 {
528  return ((m_set_State[0] & 0xc0) != 0);
529 }
530 
531 inline
533 {
534  return IsSetResidue_id();
535 }
536 
537 inline
539 {
540  m_Residue_id = 0;
541  m_set_State[0] &= ~0xc0;
542 }
543 
544 inline
546 {
547  if (!CanGetResidue_id()) {
548  ThrowUnassigned(3);
549  }
550  return m_Residue_id;
551 }
552 
553 inline
555 {
557  m_set_State[0] |= 0xc0;
558 }
559 
560 inline
562 {
563 #ifdef _DEBUG
564  if (!IsSetResidue_id()) {
565  memset(&m_Residue_id,UnassignedByte(),sizeof(m_Residue_id));
566  }
567 #endif
568  m_set_State[0] |= 0x40;
569  return m_Residue_id;
570 }
571 
572 inline
574 {
575  return ((m_set_State[0] & 0x300) != 0);
576 }
577 
578 inline
580 {
581  return IsSetResidue_name();
582 }
583 
584 inline
586 {
587  if (!CanGetResidue_name()) {
588  ThrowUnassigned(4);
589  }
590  return m_Residue_name;
591 }
592 
593 inline
595 {
597  m_set_State[0] |= 0x300;
598 }
599 
600 inline
602 {
603  m_Residue_name = std::forward<CPC_MMDBSource_Base::TResidue_name>(value);
604  m_set_State[0] |= 0x300;
605 }
606 
607 inline
609 {
610 #ifdef _DEBUG
611  if (!IsSetResidue_name()) {
613  }
614 #endif
615  m_set_State[0] |= 0x100;
616  return m_Residue_name;
617 }
618 
619 inline
621 {
622  return ((m_set_State[0] & 0xc00) != 0);
623 }
624 
625 inline
627 {
628  return IsSetAtom_id();
629 }
630 
631 inline
633 {
634  m_Atom_id = 0;
635  m_set_State[0] &= ~0xc00;
636 }
637 
638 inline
640 {
641  if (!CanGetAtom_id()) {
642  ThrowUnassigned(5);
643  }
644  return m_Atom_id;
645 }
646 
647 inline
649 {
650  m_Atom_id = value;
651  m_set_State[0] |= 0xc00;
652 }
653 
654 inline
656 {
657 #ifdef _DEBUG
658  if (!IsSetAtom_id()) {
659  memset(&m_Atom_id,UnassignedByte(),sizeof(m_Atom_id));
660  }
661 #endif
662  m_set_State[0] |= 0x400;
663  return m_Atom_id;
664 }
665 
666 inline
668 {
669  return ((m_set_State[0] & 0x3000) != 0);
670 }
671 
672 inline
674 {
675  return IsSetAtom_name();
676 }
677 
678 inline
680 {
681  if (!CanGetAtom_name()) {
682  ThrowUnassigned(6);
683  }
684  return m_Atom_name;
685 }
686 
687 inline
689 {
690  m_Atom_name = value;
691  m_set_State[0] |= 0x3000;
692 }
693 
694 inline
696 {
697  m_Atom_name = std::forward<CPC_MMDBSource_Base::TAtom_name>(value);
698  m_set_State[0] |= 0x3000;
699 }
700 
701 inline
703 {
704 #ifdef _DEBUG
705  if (!IsSetAtom_name()) {
707  }
708 #endif
709  m_set_State[0] |= 0x1000;
710  return m_Atom_name;
711 }
712 
713 ///////////////////////////////////////////////////////////
714 ////////////////// end of inline methods //////////////////
715 ///////////////////////////////////////////////////////////
716 
717 
718 
719 
720 
721 END_objects_SCOPE // namespace ncbi::objects::
722 
724 
725 
726 #endif // OBJECTS_PCSUBSTANCE_PC_MMDBSOURCE_BASE_HPP
MMDB Source Record detailing specific location or part of an MMDB Record.
Base class for all serializable objects.
Definition: serialbase.hpp:150
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
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_PCSUBSTANCE_EXPORT
Definition: ncbi_export.h:688
CPC_MMDBSource_Base & operator=(const CPC_MMDBSource_Base &)
TResidue_name & SetResidue_name(void)
Assign a value to Residue_name data member.
TAtom_name & SetAtom_name(void)
Assign a value to Atom_name data member.
bool CanGetResidue_id(void) const
Check if it is safe to call GetResidue_id method.
TMmdb_id & SetMmdb_id(void)
Assign a value to Mmdb_id data member.
bool CanGetAtom_id(void) const
Check if it is safe to call GetAtom_id method.
TAtom_id & SetAtom_id(void)
Assign a value to Atom_id data member.
bool IsSetMmdb_id(void) const
MMDB Record ID Note: Must be greater than "0" or, if invalid, "0" Check if a value has been assigned ...
bool IsSetAtom_name(void) const
Atom Name Check if a value has been assigned to Atom_name data member.
const TMolecule_name & GetMolecule_name(void) const
Get the Molecule_name member data.
bool IsSetResidue_name(void) const
Residue Name Check if a value has been assigned to Residue_name data member.
bool CanGetResidue_name(void) const
Check if it is safe to call GetResidue_name method.
bool IsSetMolecule_name(void) const
MMDB Molecule Name Check if a value has been assigned to Molecule_name data member.
const TResidue_name & GetResidue_name(void) const
Get the Residue_name member data.
CPC_MMDBSource_Base(const CPC_MMDBSource_Base &)
list< string > TMolecule_name
bool CanGetAtom_name(void) const
Check if it is safe to call GetAtom_name method.
void ResetResidue_id(void)
Reset Residue_id data member.
void ResetAtom_id(void)
Reset Atom_id data member.
Tparent::CMemberIndex< E_memberIndex, 8 > TmemberIndex
bool CanGetMolecule_name(void) const
Check if it is safe to call GetMolecule_name method.
TMmdb_id GetMmdb_id(void) const
Get the Mmdb_id member data.
bool IsSetAtom_id(void) const
Atom ID Note: Must be greater than "0" or, if invalid, "0" Check if a value has been assigned to Atom...
TMolecule_name & SetMolecule_name(void)
Assign a value to Molecule_name data member.
void ResetMmdb_id(void)
Reset Mmdb_id data member.
TMolecule_id & SetMolecule_id(void)
Assign a value to Molecule_id data member.
TResidue_id GetResidue_id(void) const
Get the Residue_id member data.
bool IsSetResidue_id(void) const
Residue ID Note: Must be greater than "0" or, if invalid, "0" Check if a value has been assigned to R...
bool CanGetMmdb_id(void) const
Check if it is safe to call GetMmdb_id method.
bool IsSetMolecule_id(void) const
MMDB Molecule ID Note: Must be greater than "0" or, if invalid, "0" Check if a value has been assigne...
TResidue_id & SetResidue_id(void)
Assign a value to Residue_id data member.
list< string > m_Molecule_name
bool CanGetMolecule_id(void) const
Check if it is safe to call GetMolecule_id method.
TMolecule_id GetMolecule_id(void) const
Get the Molecule_id member data.
TAtom_id GetAtom_id(void) const
Get the Atom_id member data.
CSerialObject Tparent
void ResetMolecule_id(void)
Reset Molecule_id data member.
const TAtom_name & GetAtom_name(void) const
Get the Atom_name member data.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed Sep 04 15:01:21 2024 by modify_doxy.py rev. 669887