NCBI C++ ToolKit
PC_Atoms_.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_Atoms_.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_ATOMS_BASE_HPP
42 #define OBJECTS_PCSUBSTANCE_PC_ATOMS_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
49 #include <vector>
51 
53 
54 #ifndef BEGIN_objects_SCOPE
55 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
56 # define END_objects_SCOPE END_SCOPE(objects)
57 #endif
58 BEGIN_objects_SCOPE // namespace ncbi::objects::
59 
60 
61 // forward declarations
62 class CPC_AtomInt;
63 class CPC_AtomRadical;
64 class CPC_AtomSource;
65 class CPC_AtomString;
66 
67 
68 // generated classes
69 
70 
71 /** @addtogroup dataspec_NCBI_PCSubstance
72  *
73  * @{
74  */
75 
76 /////////////////////////////////////////////////////////////////////////////
77 /// Atom Information (in Parallel Arrays)
78 ///
79 /// CPC_Atoms_Base --
80 ///
81 
83 {
85 public:
86  // constructor
87  CPC_Atoms_Base(void);
88  // destructor
89  virtual ~CPC_Atoms_Base(void);
90 
91  // type info
93 
94  // types
95  typedef vector< int > TAid;
96  typedef vector< int > TElement;
97  typedef list< CRef< CPC_AtomString > > TLabel;
98  typedef list< CRef< CPC_AtomInt > > TIsotope;
99  typedef list< CRef< CPC_AtomInt > > TCharge;
100  typedef list< CRef< CPC_AtomRadical > > TRadical;
101  typedef list< CRef< CPC_AtomSource > > TSource;
102  typedef list< CRef< CPC_AtomString > > TComment;
103 
104  // member index
105  enum class E_memberIndex {
106  e__allMandatory = 0,
107  e_aid,
108  e_element,
109  e_label,
110  e_isotope,
111  e_charge,
112  e_radical,
113  e_source,
114  e_comment
115  };
117 
118  // getters
119  // setters
120 
121  /// [Note: Parallel Arrays must be kept Synchronized]
122  /// Atom Identifiers (vector)
123  /// Note: Atom ID's must be greater than "0"
124  /// Check if a value has been assigned to Aid data member.
125  ///
126  /// Data member Aid is mandatory;
127  /// its type is defined as 'typedef vector< int > TAid'
128  /// @return
129  /// - true, if a value has been assigned.
130  /// - false, otherwise.
131  bool IsSetAid(void) const;
132 
133  /// Check if it is safe to call GetAid method.
134  ///
135  /// @return
136  /// - true, if the data member is getatable.
137  /// - false, otherwise.
138  bool CanGetAid(void) const;
139 
140  /// Reset Aid data member.
141  void ResetAid(void);
142 
143  /// Get the Aid member data.
144  ///
145  /// @return
146  /// Reference to the member data.
147  const TAid& GetAid(void) const;
148 
149  /// Assign a value to Aid data member.
150  ///
151  /// @return
152  /// Reference to the data value.
153  TAid& SetAid(void);
154 
155  /// Atomic Numbers (vector)
156  /// Check if a value has been assigned to Element data member.
157  ///
158  /// Data member Element is mandatory;
159  /// its type is defined as 'typedef vector< int > TElement'
160  /// @return
161  /// - true, if a value has been assigned.
162  /// - false, otherwise.
163  bool IsSetElement(void) const;
164 
165  /// Check if it is safe to call GetElement method.
166  ///
167  /// @return
168  /// - true, if the data member is getatable.
169  /// - false, otherwise.
170  bool CanGetElement(void) const;
171 
172  /// Reset Element data member.
173  void ResetElement(void);
174 
175  /// Get the Element member data.
176  ///
177  /// @return
178  /// Reference to the member data.
179  const TElement& GetElement(void) const;
180 
181  /// Assign a value to Element data member.
182  ///
183  /// @return
184  /// Reference to the data value.
185  TElement& SetElement(void);
186 
187  /// Independent Arrays of ID-Value Pairs (Technically allows multiple values per Atom)
188  /// Atom labels
189  /// Check if a value has been assigned to Label data member.
190  ///
191  /// Data member Label is optional;
192  /// its type is defined as 'typedef list< CRef< CPC_AtomString > > TLabel'
193  /// @return
194  /// - true, if a value has been assigned.
195  /// - false, otherwise.
196  bool IsSetLabel(void) const;
197 
198  /// Check if it is safe to call GetLabel method.
199  ///
200  /// @return
201  /// - true, if the data member is getatable.
202  /// - false, otherwise.
203  bool CanGetLabel(void) const;
204 
205  /// Reset Label data member.
206  void ResetLabel(void);
207 
208  /// Get the Label member data.
209  ///
210  /// @return
211  /// Reference to the member data.
212  const TLabel& GetLabel(void) const;
213 
214  /// Assign a value to Label data member.
215  ///
216  /// @return
217  /// Reference to the data value.
218  TLabel& SetLabel(void);
219 
220  /// Isotopic Information
221  /// Check if a value has been assigned to Isotope data member.
222  ///
223  /// Data member Isotope is optional;
224  /// its type is defined as 'typedef list< CRef< CPC_AtomInt > > TIsotope'
225  /// @return
226  /// - true, if a value has been assigned.
227  /// - false, otherwise.
228  bool IsSetIsotope(void) const;
229 
230  /// Check if it is safe to call GetIsotope method.
231  ///
232  /// @return
233  /// - true, if the data member is getatable.
234  /// - false, otherwise.
235  bool CanGetIsotope(void) const;
236 
237  /// Reset Isotope data member.
238  void ResetIsotope(void);
239 
240  /// Get the Isotope member data.
241  ///
242  /// @return
243  /// Reference to the member data.
244  const TIsotope& GetIsotope(void) const;
245 
246  /// Assign a value to Isotope data member.
247  ///
248  /// @return
249  /// Reference to the data value.
250  TIsotope& SetIsotope(void);
251 
252  /// Formal Charges
253  /// Check if a value has been assigned to Charge data member.
254  ///
255  /// Data member Charge is optional;
256  /// its type is defined as 'typedef list< CRef< CPC_AtomInt > > TCharge'
257  /// @return
258  /// - true, if a value has been assigned.
259  /// - false, otherwise.
260  bool IsSetCharge(void) const;
261 
262  /// Check if it is safe to call GetCharge method.
263  ///
264  /// @return
265  /// - true, if the data member is getatable.
266  /// - false, otherwise.
267  bool CanGetCharge(void) const;
268 
269  /// Reset Charge data member.
270  void ResetCharge(void);
271 
272  /// Get the Charge member data.
273  ///
274  /// @return
275  /// Reference to the member data.
276  const TCharge& GetCharge(void) const;
277 
278  /// Assign a value to Charge data member.
279  ///
280  /// @return
281  /// Reference to the data value.
282  TCharge& SetCharge(void);
283 
284  /// Radical Information
285  /// Check if a value has been assigned to Radical data member.
286  ///
287  /// Data member Radical is optional;
288  /// its type is defined as 'typedef list< CRef< CPC_AtomRadical > > TRadical'
289  /// @return
290  /// - true, if a value has been assigned.
291  /// - false, otherwise.
292  bool IsSetRadical(void) const;
293 
294  /// Check if it is safe to call GetRadical method.
295  ///
296  /// @return
297  /// - true, if the data member is getatable.
298  /// - false, otherwise.
299  bool CanGetRadical(void) const;
300 
301  /// Reset Radical data member.
302  void ResetRadical(void);
303 
304  /// Get the Radical member data.
305  ///
306  /// @return
307  /// Reference to the member data.
308  const TRadical& GetRadical(void) const;
309 
310  /// Assign a value to Radical data member.
311  ///
312  /// @return
313  /// Reference to the data value.
314  TRadical& SetRadical(void);
315 
316  /// E.g. identity of MMDB "R" groups
317  /// Check if a value has been assigned to Source data member.
318  ///
319  /// Data member Source is optional;
320  /// its type is defined as 'typedef list< CRef< CPC_AtomSource > > TSource'
321  /// @return
322  /// - true, if a value has been assigned.
323  /// - false, otherwise.
324  bool IsSetSource(void) const;
325 
326  /// Check if it is safe to call GetSource method.
327  ///
328  /// @return
329  /// - true, if the data member is getatable.
330  /// - false, otherwise.
331  bool CanGetSource(void) const;
332 
333  /// Reset Source data member.
334  void ResetSource(void);
335 
336  /// Get the Source member data.
337  ///
338  /// @return
339  /// Reference to the member data.
340  const TSource& GetSource(void) const;
341 
342  /// Assign a value to Source data member.
343  ///
344  /// @return
345  /// Reference to the data value.
346  TSource& SetSource(void);
347 
348  /// Atom Comments
349  /// Check if a value has been assigned to Comment data member.
350  ///
351  /// Data member Comment is optional;
352  /// its type is defined as 'typedef list< CRef< CPC_AtomString > > TComment'
353  /// @return
354  /// - true, if a value has been assigned.
355  /// - false, otherwise.
356  bool IsSetComment(void) const;
357 
358  /// Check if it is safe to call GetComment method.
359  ///
360  /// @return
361  /// - true, if the data member is getatable.
362  /// - false, otherwise.
363  bool CanGetComment(void) const;
364 
365  /// Reset Comment data member.
366  void ResetComment(void);
367 
368  /// Get the Comment member data.
369  ///
370  /// @return
371  /// Reference to the member data.
372  const TComment& GetComment(void) const;
373 
374  /// Assign a value to Comment data member.
375  ///
376  /// @return
377  /// Reference to the data value.
378  TComment& SetComment(void);
379 
380  /// Reset the whole object
381  virtual void Reset(void);
382 
383 
384 private:
385  // Prohibit copy constructor and assignment operator
388 
389  // data
390  Uint4 m_set_State[1];
391  vector< int > m_Aid;
392  vector< int > m_Element;
393  list< CRef< CPC_AtomString > > m_Label;
394  list< CRef< CPC_AtomInt > > m_Isotope;
395  list< CRef< CPC_AtomInt > > m_Charge;
396  list< CRef< CPC_AtomRadical > > m_Radical;
397  list< CRef< CPC_AtomSource > > m_Source;
398  list< CRef< CPC_AtomString > > m_Comment;
399 };
400 
401 /* @} */
402 
403 
404 
405 
406 
407 ///////////////////////////////////////////////////////////
408 ///////////////////// inline methods //////////////////////
409 ///////////////////////////////////////////////////////////
410 inline
411 bool CPC_Atoms_Base::IsSetAid(void) const
412 {
413  return ((m_set_State[0] & 0x3) != 0);
414 }
415 
416 inline
418 {
419  return true;
420 }
421 
422 inline
424 {
425  return m_Aid;
426 }
427 
428 inline
430 {
431  m_set_State[0] |= 0x1;
432  return m_Aid;
433 }
434 
435 inline
437 {
438  return ((m_set_State[0] & 0xc) != 0);
439 }
440 
441 inline
443 {
444  return true;
445 }
446 
447 inline
449 {
450  return m_Element;
451 }
452 
453 inline
455 {
456  m_set_State[0] |= 0x4;
457  return m_Element;
458 }
459 
460 inline
462 {
463  return ((m_set_State[0] & 0x30) != 0);
464 }
465 
466 inline
468 {
469  return true;
470 }
471 
472 inline
474 {
475  return m_Label;
476 }
477 
478 inline
480 {
481  m_set_State[0] |= 0x10;
482  return m_Label;
483 }
484 
485 inline
487 {
488  return ((m_set_State[0] & 0xc0) != 0);
489 }
490 
491 inline
493 {
494  return true;
495 }
496 
497 inline
499 {
500  return m_Isotope;
501 }
502 
503 inline
505 {
506  m_set_State[0] |= 0x40;
507  return m_Isotope;
508 }
509 
510 inline
512 {
513  return ((m_set_State[0] & 0x300) != 0);
514 }
515 
516 inline
518 {
519  return true;
520 }
521 
522 inline
524 {
525  return m_Charge;
526 }
527 
528 inline
530 {
531  m_set_State[0] |= 0x100;
532  return m_Charge;
533 }
534 
535 inline
537 {
538  return ((m_set_State[0] & 0xc00) != 0);
539 }
540 
541 inline
543 {
544  return true;
545 }
546 
547 inline
549 {
550  return m_Radical;
551 }
552 
553 inline
555 {
556  m_set_State[0] |= 0x400;
557  return m_Radical;
558 }
559 
560 inline
562 {
563  return ((m_set_State[0] & 0x3000) != 0);
564 }
565 
566 inline
568 {
569  return true;
570 }
571 
572 inline
574 {
575  return m_Source;
576 }
577 
578 inline
580 {
581  m_set_State[0] |= 0x1000;
582  return m_Source;
583 }
584 
585 inline
587 {
588  return ((m_set_State[0] & 0xc000) != 0);
589 }
590 
591 inline
593 {
594  return true;
595 }
596 
597 inline
599 {
600  return m_Comment;
601 }
602 
603 inline
605 {
606  m_set_State[0] |= 0x4000;
607  return m_Comment;
608 }
609 
610 ///////////////////////////////////////////////////////////
611 ////////////////// end of inline methods //////////////////
612 ///////////////////////////////////////////////////////////
613 
614 
615 
616 
617 
618 END_objects_SCOPE // namespace ncbi::objects::
619 
621 
622 
623 #endif // OBJECTS_PCSUBSTANCE_PC_ATOMS_BASE_HPP
User-defined methods of the data storage class.
CPC_AtomInt –.
Definition: PC_AtomInt.hpp:66
CPC_AtomRadical –.
CPC_AtomSource –.
CPC_AtomString –.
Atom Information (in Parallel Arrays)
Definition: PC_Atoms_.hpp:83
Base class for all serializable objects.
Definition: serialbase.hpp:150
string GetLabel(const CSeq_id &id)
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
list< CRef< CPC_AtomRadical > > m_Radical
Definition: PC_Atoms_.hpp:396
list< CRef< CPC_AtomSource > > TSource
Definition: PC_Atoms_.hpp:101
list< CRef< CPC_AtomInt > > m_Isotope
Definition: PC_Atoms_.hpp:394
list< CRef< CPC_AtomInt > > TIsotope
Definition: PC_Atoms_.hpp:98
Uint4 m_set_State[1]
Definition: PC_Atoms_.hpp:390
list< CRef< CPC_AtomInt > > m_Charge
Definition: PC_Atoms_.hpp:395
list< CRef< CPC_AtomRadical > > TRadical
Definition: PC_Atoms_.hpp:100
bool CanGetCharge(void) const
Check if it is safe to call GetCharge method.
Definition: PC_Atoms_.hpp:517
CPC_Atoms_Base(const CPC_Atoms_Base &)
bool IsSetLabel(void) const
Independent Arrays of ID-Value Pairs (Technically allows multiple values per Atom) Atom labels Check ...
Definition: PC_Atoms_.hpp:461
bool IsSetAid(void) const
[Note: Parallel Arrays must be kept Synchronized] Atom Identifiers (vector) Note: Atom ID's must be g...
Definition: PC_Atoms_.hpp:411
bool IsSetCharge(void) const
Formal Charges Check if a value has been assigned to Charge data member.
Definition: PC_Atoms_.hpp:511
list< CRef< CPC_AtomString > > m_Label
Definition: PC_Atoms_.hpp:393
list< CRef< CPC_AtomString > > TLabel
Definition: PC_Atoms_.hpp:97
bool IsSetElement(void) const
Atomic Numbers (vector) Check if a value has been assigned to Element data member.
Definition: PC_Atoms_.hpp:436
const TIsotope & GetIsotope(void) const
Get the Isotope member data.
Definition: PC_Atoms_.hpp:498
list< CRef< CPC_AtomString > > TComment
Definition: PC_Atoms_.hpp:102
const TComment & GetComment(void) const
Get the Comment member data.
Definition: PC_Atoms_.hpp:598
TComment & SetComment(void)
Assign a value to Comment data member.
Definition: PC_Atoms_.hpp:604
const TRadical & GetRadical(void) const
Get the Radical member data.
Definition: PC_Atoms_.hpp:548
bool CanGetLabel(void) const
Check if it is safe to call GetLabel method.
Definition: PC_Atoms_.hpp:467
TIsotope & SetIsotope(void)
Assign a value to Isotope data member.
Definition: PC_Atoms_.hpp:504
list< CRef< CPC_AtomString > > m_Comment
Definition: PC_Atoms_.hpp:398
vector< int > m_Aid
Definition: PC_Atoms_.hpp:391
bool IsSetIsotope(void) const
Isotopic Information Check if a value has been assigned to Isotope data member.
Definition: PC_Atoms_.hpp:486
bool CanGetRadical(void) const
Check if it is safe to call GetRadical method.
Definition: PC_Atoms_.hpp:542
const TSource & GetSource(void) const
Get the Source member data.
Definition: PC_Atoms_.hpp:573
vector< int > m_Element
Definition: PC_Atoms_.hpp:392
bool CanGetAid(void) const
Check if it is safe to call GetAid method.
Definition: PC_Atoms_.hpp:417
const TCharge & GetCharge(void) const
Get the Charge member data.
Definition: PC_Atoms_.hpp:523
TElement & SetElement(void)
Assign a value to Element data member.
Definition: PC_Atoms_.hpp:454
const TAid & GetAid(void) const
Get the Aid member data.
Definition: PC_Atoms_.hpp:423
Tparent::CMemberIndex< E_memberIndex, 9 > TmemberIndex
Definition: PC_Atoms_.hpp:116
CSerialObject Tparent
Definition: PC_Atoms_.hpp:84
bool CanGetIsotope(void) const
Check if it is safe to call GetIsotope method.
Definition: PC_Atoms_.hpp:492
const TLabel & GetLabel(void) const
Get the Label member data.
Definition: PC_Atoms_.hpp:473
list< CRef< CPC_AtomSource > > m_Source
Definition: PC_Atoms_.hpp:397
bool IsSetRadical(void) const
Radical Information Check if a value has been assigned to Radical data member.
Definition: PC_Atoms_.hpp:536
list< CRef< CPC_AtomInt > > TCharge
Definition: PC_Atoms_.hpp:99
vector< int > TAid
Definition: PC_Atoms_.hpp:95
vector< int > TElement
Definition: PC_Atoms_.hpp:96
CPC_Atoms_Base & operator=(const CPC_Atoms_Base &)
TRadical & SetRadical(void)
Assign a value to Radical data member.
Definition: PC_Atoms_.hpp:554
DECLARE_INTERNAL_TYPE_INFO()
TSource & SetSource(void)
Assign a value to Source data member.
Definition: PC_Atoms_.hpp:579
const TElement & GetElement(void) const
Get the Element member data.
Definition: PC_Atoms_.hpp:448
bool CanGetElement(void) const
Check if it is safe to call GetElement method.
Definition: PC_Atoms_.hpp:442
bool IsSetSource(void) const
E.g.
Definition: PC_Atoms_.hpp:561
bool IsSetComment(void) const
Atom Comments Check if a value has been assigned to Comment data member.
Definition: PC_Atoms_.hpp:586
bool CanGetSource(void) const
Check if it is safe to call GetSource method.
Definition: PC_Atoms_.hpp:567
TLabel & SetLabel(void)
Assign a value to Label data member.
Definition: PC_Atoms_.hpp:479
TCharge & SetCharge(void)
Assign a value to Charge data member.
Definition: PC_Atoms_.hpp:529
TAid & SetAid(void)
Assign a value to Aid data member.
Definition: PC_Atoms_.hpp:429
bool CanGetComment(void) const
Check if it is safe to call GetComment method.
Definition: PC_Atoms_.hpp:592
int GetCharge(char code)
Modified on Sun Apr 21 03:42:47 2024 by modify_doxy.py rev. 669887