NCBI C++ ToolKit
PC_StereoSquarePlanar_.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_StereoSquarePlanar_.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_STEREOSQUAREPLANAR_BASE_HPP
42 #define OBJECTS_PCSUBSTANCE_PC_STEREOSQUAREPLANAR_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
47 
48 #ifndef BEGIN_objects_SCOPE
49 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
50 # define END_objects_SCOPE END_SCOPE(objects)
51 #endif
52 BEGIN_objects_SCOPE // namespace ncbi::objects::
53 
54 
55 // generated classes
56 
57 
58 /** @addtogroup dataspec_NCBI_PCSubstance
59  *
60  * @{
61  */
62 
63 /////////////////////////////////////////////////////////////////////////////
64 /// Square Planar (SP4) StereoCenters
65 /// [Using IUPAC Stereogenic Center recommendations and terminology]
66 /// [Note: "-1" can be used for the Atom Identifier to represent a lone-pair or implicit hydrogen]
67 ///
68 /// CPC_StereoSquarePlanar_Base --
69 ///
70 
72 {
74 public:
75  // constructor
77  // destructor
78  virtual ~CPC_StereoSquarePlanar_Base(void);
79 
80  // type info
82 
83  /// StereoCenter Type
84  enum EParity {
85  eParity_u_shape = 1, ///< U shaped isomer (labove-lbelow-rbelow-rabove)
86  eParity_z_shape = 2, ///< Z shaped isomer (labove-rabove-lbelow-rbelow)
87  eParity_x_shape = 3, ///< X shaped isomer (labove-rbelow-rabove-lbelow)
88  eParity_any = 4, ///< Nonspecific mixture of isomers
89  eParity_unknown = 255
90  };
91 
92  /// Access to EParity's attributes (values, names) as defined in spec
93  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EParity)(void);
94 
95  // types
96  typedef int TCenter;
97  typedef int TLbelow;
98  typedef int TRbelow;
99  typedef int TLabove;
100  typedef int TRabove;
101  typedef int TParity;
102 
103  // member index
104  enum class E_memberIndex {
105  e__allMandatory = 0,
106  e_center,
107  e_lbelow,
108  e_rbelow,
109  e_labove,
110  e_rabove,
111  e_parity
112  };
114 
115  // getters
116  // setters
117 
118  /// Atom ID of Atom Center
119  /// Note: Atom ID's must be greater than "0"
120  /// Check if a value has been assigned to Center data member.
121  ///
122  /// Data member Center is mandatory;
123  /// its type is defined as 'typedef int TCenter'
124  /// @return
125  /// - true, if a value has been assigned.
126  /// - false, otherwise.
127  bool IsSetCenter(void) const;
128 
129  /// Check if it is safe to call GetCenter method.
130  ///
131  /// @return
132  /// - true, if the data member is getatable.
133  /// - false, otherwise.
134  bool CanGetCenter(void) const;
135 
136  /// Reset Center data member.
137  void ResetCenter(void);
138 
139  /// Get the Center member data.
140  ///
141  /// @return
142  /// Copy of the member data.
143  TCenter GetCenter(void) const;
144 
145  /// Assign a value to Center data member.
146  ///
147  /// @param value
148  /// Value to assign
149  void SetCenter(TCenter value);
150 
151  /// Assign a value to Center data member.
152  ///
153  /// @return
154  /// Reference to the data value.
155  TCenter& SetCenter(void);
156 
157  /// Atom ID of Left Below Plane Atom
158  /// Note: Atom ID's must be greater than "0"
159  /// Check if a value has been assigned to Lbelow data member.
160  ///
161  /// Data member Lbelow is mandatory;
162  /// its type is defined as 'typedef int TLbelow'
163  /// @return
164  /// - true, if a value has been assigned.
165  /// - false, otherwise.
166  bool IsSetLbelow(void) const;
167 
168  /// Check if it is safe to call GetLbelow method.
169  ///
170  /// @return
171  /// - true, if the data member is getatable.
172  /// - false, otherwise.
173  bool CanGetLbelow(void) const;
174 
175  /// Reset Lbelow data member.
176  void ResetLbelow(void);
177 
178  /// Get the Lbelow member data.
179  ///
180  /// @return
181  /// Copy of the member data.
182  TLbelow GetLbelow(void) const;
183 
184  /// Assign a value to Lbelow data member.
185  ///
186  /// @param value
187  /// Value to assign
188  void SetLbelow(TLbelow value);
189 
190  /// Assign a value to Lbelow data member.
191  ///
192  /// @return
193  /// Reference to the data value.
194  TLbelow& SetLbelow(void);
195 
196  /// Atom ID of Right Below Plane Atom
197  /// Note: Atom ID's must be greater than "0"
198  /// Check if a value has been assigned to Rbelow data member.
199  ///
200  /// Data member Rbelow is mandatory;
201  /// its type is defined as 'typedef int TRbelow'
202  /// @return
203  /// - true, if a value has been assigned.
204  /// - false, otherwise.
205  bool IsSetRbelow(void) const;
206 
207  /// Check if it is safe to call GetRbelow method.
208  ///
209  /// @return
210  /// - true, if the data member is getatable.
211  /// - false, otherwise.
212  bool CanGetRbelow(void) const;
213 
214  /// Reset Rbelow data member.
215  void ResetRbelow(void);
216 
217  /// Get the Rbelow member data.
218  ///
219  /// @return
220  /// Copy of the member data.
221  TRbelow GetRbelow(void) const;
222 
223  /// Assign a value to Rbelow data member.
224  ///
225  /// @param value
226  /// Value to assign
227  void SetRbelow(TRbelow value);
228 
229  /// Assign a value to Rbelow data member.
230  ///
231  /// @return
232  /// Reference to the data value.
233  TRbelow& SetRbelow(void);
234 
235  /// Atom ID of Left Above Plane Atom
236  /// Note: Atom ID's must be greater than "0"
237  /// Check if a value has been assigned to Labove data member.
238  ///
239  /// Data member Labove is mandatory;
240  /// its type is defined as 'typedef int TLabove'
241  /// @return
242  /// - true, if a value has been assigned.
243  /// - false, otherwise.
244  bool IsSetLabove(void) const;
245 
246  /// Check if it is safe to call GetLabove method.
247  ///
248  /// @return
249  /// - true, if the data member is getatable.
250  /// - false, otherwise.
251  bool CanGetLabove(void) const;
252 
253  /// Reset Labove data member.
254  void ResetLabove(void);
255 
256  /// Get the Labove member data.
257  ///
258  /// @return
259  /// Copy of the member data.
260  TLabove GetLabove(void) const;
261 
262  /// Assign a value to Labove data member.
263  ///
264  /// @param value
265  /// Value to assign
266  void SetLabove(TLabove value);
267 
268  /// Assign a value to Labove data member.
269  ///
270  /// @return
271  /// Reference to the data value.
272  TLabove& SetLabove(void);
273 
274  /// Atom ID of Right Above Plane Atom
275  /// Note: Atom ID's must be greater than "0"
276  /// Check if a value has been assigned to Rabove data member.
277  ///
278  /// Data member Rabove is mandatory;
279  /// its type is defined as 'typedef int TRabove'
280  /// @return
281  /// - true, if a value has been assigned.
282  /// - false, otherwise.
283  bool IsSetRabove(void) const;
284 
285  /// Check if it is safe to call GetRabove method.
286  ///
287  /// @return
288  /// - true, if the data member is getatable.
289  /// - false, otherwise.
290  bool CanGetRabove(void) const;
291 
292  /// Reset Rabove data member.
293  void ResetRabove(void);
294 
295  /// Get the Rabove member data.
296  ///
297  /// @return
298  /// Copy of the member data.
299  TRabove GetRabove(void) const;
300 
301  /// Assign a value to Rabove data member.
302  ///
303  /// @param value
304  /// Value to assign
305  void SetRabove(TRabove value);
306 
307  /// Assign a value to Rabove data member.
308  ///
309  /// @return
310  /// Reference to the data value.
311  TRabove& SetRabove(void);
312 
313  /// Check if a value has been assigned to Parity data member.
314  ///
315  /// Data member Parity is optional;
316  /// its type is defined as 'typedef int TParity'
317  /// @return
318  /// - true, if a value has been assigned.
319  /// - false, otherwise.
320  bool IsSetParity(void) const;
321 
322  /// Check if it is safe to call GetParity method.
323  ///
324  /// @return
325  /// - true, if the data member is getatable.
326  /// - false, otherwise.
327  bool CanGetParity(void) const;
328 
329  /// Reset Parity data member.
330  void ResetParity(void);
331 
332  /// Get the Parity member data.
333  ///
334  /// @return
335  /// Copy of the member data.
336  TParity GetParity(void) const;
337 
338  /// Assign a value to Parity data member.
339  ///
340  /// @param value
341  /// Value to assign
342  void SetParity(TParity value);
343 
344  /// Assign a value to Parity data member.
345  ///
346  /// @return
347  /// Reference to the data value.
348  TParity& SetParity(void);
349 
350  /// Reset the whole object
351  virtual void Reset(void);
352 
353 
354 private:
355  // Prohibit copy constructor and assignment operator
358 
359  // data
360  Uint4 m_set_State[1];
361  int m_Center;
362  int m_Lbelow;
363  int m_Rbelow;
364  int m_Labove;
365  int m_Rabove;
366  int m_Parity;
367 };
368 
369 /* @} */
370 
371 
372 
373 
374 
375 ///////////////////////////////////////////////////////////
376 ///////////////////// inline methods //////////////////////
377 ///////////////////////////////////////////////////////////
378 inline
380 {
381  return ((m_set_State[0] & 0x3) != 0);
382 }
383 
384 inline
386 {
387  return IsSetCenter();
388 }
389 
390 inline
392 {
393  m_Center = 0;
394  m_set_State[0] &= ~0x3;
395 }
396 
397 inline
399 {
400  if (!CanGetCenter()) {
401  ThrowUnassigned(0);
402  }
403  return m_Center;
404 }
405 
406 inline
408 {
409  m_Center = value;
410  m_set_State[0] |= 0x3;
411 }
412 
413 inline
415 {
416 #ifdef _DEBUG
417  if (!IsSetCenter()) {
418  memset(&m_Center,UnassignedByte(),sizeof(m_Center));
419  }
420 #endif
421  m_set_State[0] |= 0x1;
422  return m_Center;
423 }
424 
425 inline
427 {
428  return ((m_set_State[0] & 0xc) != 0);
429 }
430 
431 inline
433 {
434  return IsSetLbelow();
435 }
436 
437 inline
439 {
440  m_Lbelow = 0;
441  m_set_State[0] &= ~0xc;
442 }
443 
444 inline
446 {
447  if (!CanGetLbelow()) {
448  ThrowUnassigned(1);
449  }
450  return m_Lbelow;
451 }
452 
453 inline
455 {
456  m_Lbelow = value;
457  m_set_State[0] |= 0xc;
458 }
459 
460 inline
462 {
463 #ifdef _DEBUG
464  if (!IsSetLbelow()) {
465  memset(&m_Lbelow,UnassignedByte(),sizeof(m_Lbelow));
466  }
467 #endif
468  m_set_State[0] |= 0x4;
469  return m_Lbelow;
470 }
471 
472 inline
474 {
475  return ((m_set_State[0] & 0x30) != 0);
476 }
477 
478 inline
480 {
481  return IsSetRbelow();
482 }
483 
484 inline
486 {
487  m_Rbelow = 0;
488  m_set_State[0] &= ~0x30;
489 }
490 
491 inline
493 {
494  if (!CanGetRbelow()) {
495  ThrowUnassigned(2);
496  }
497  return m_Rbelow;
498 }
499 
500 inline
502 {
503  m_Rbelow = value;
504  m_set_State[0] |= 0x30;
505 }
506 
507 inline
509 {
510 #ifdef _DEBUG
511  if (!IsSetRbelow()) {
512  memset(&m_Rbelow,UnassignedByte(),sizeof(m_Rbelow));
513  }
514 #endif
515  m_set_State[0] |= 0x10;
516  return m_Rbelow;
517 }
518 
519 inline
521 {
522  return ((m_set_State[0] & 0xc0) != 0);
523 }
524 
525 inline
527 {
528  return IsSetLabove();
529 }
530 
531 inline
533 {
534  m_Labove = 0;
535  m_set_State[0] &= ~0xc0;
536 }
537 
538 inline
540 {
541  if (!CanGetLabove()) {
542  ThrowUnassigned(3);
543  }
544  return m_Labove;
545 }
546 
547 inline
549 {
550  m_Labove = value;
551  m_set_State[0] |= 0xc0;
552 }
553 
554 inline
556 {
557 #ifdef _DEBUG
558  if (!IsSetLabove()) {
559  memset(&m_Labove,UnassignedByte(),sizeof(m_Labove));
560  }
561 #endif
562  m_set_State[0] |= 0x40;
563  return m_Labove;
564 }
565 
566 inline
568 {
569  return ((m_set_State[0] & 0x300) != 0);
570 }
571 
572 inline
574 {
575  return IsSetRabove();
576 }
577 
578 inline
580 {
581  m_Rabove = 0;
582  m_set_State[0] &= ~0x300;
583 }
584 
585 inline
587 {
588  if (!CanGetRabove()) {
589  ThrowUnassigned(4);
590  }
591  return m_Rabove;
592 }
593 
594 inline
596 {
597  m_Rabove = value;
598  m_set_State[0] |= 0x300;
599 }
600 
601 inline
603 {
604 #ifdef _DEBUG
605  if (!IsSetRabove()) {
606  memset(&m_Rabove,UnassignedByte(),sizeof(m_Rabove));
607  }
608 #endif
609  m_set_State[0] |= 0x100;
610  return m_Rabove;
611 }
612 
613 inline
615 {
616  return ((m_set_State[0] & 0xc00) != 0);
617 }
618 
619 inline
621 {
622  return IsSetParity();
623 }
624 
625 inline
627 {
628  m_Parity = (EParity)(0);
629  m_set_State[0] &= ~0xc00;
630 }
631 
632 inline
634 {
635  if (!CanGetParity()) {
636  ThrowUnassigned(5);
637  }
638  return m_Parity;
639 }
640 
641 inline
643 {
644  m_Parity = value;
645  m_set_State[0] |= 0xc00;
646 }
647 
648 inline
650 {
651 #ifdef _DEBUG
652  if (!IsSetParity()) {
653  memset(&m_Parity,UnassignedByte(),sizeof(m_Parity));
654  }
655 #endif
656  m_set_State[0] |= 0x400;
657  return m_Parity;
658 }
659 
660 ///////////////////////////////////////////////////////////
661 ////////////////// end of inline methods //////////////////
662 ///////////////////////////////////////////////////////////
663 
664 
665 
666 
667 
668 END_objects_SCOPE // namespace ncbi::objects::
669 
671 
672 
673 #endif // OBJECTS_PCSUBSTANCE_PC_STEREOSQUAREPLANAR_BASE_HPP
Square Planar (SP4) StereoCenters [Using IUPAC Stereogenic Center recommendations and terminology] [N...
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
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
void ResetRabove(void)
Reset Rabove data member.
bool CanGetRabove(void) const
Check if it is safe to call GetRabove method.
bool IsSetCenter(void) const
Atom ID of Atom Center Note: Atom ID's must be greater than "0" Check if a value has been assigned to...
TCenter & SetCenter(void)
Assign a value to Center data member.
TRabove GetRabove(void) const
Get the Rabove member data.
bool IsSetLabove(void) const
Atom ID of Left Above Plane Atom Note: Atom ID's must be greater than "0" Check if a value has been a...
TLbelow & SetLbelow(void)
Assign a value to Lbelow data member.
void ResetLbelow(void)
Reset Lbelow data member.
TLabove GetLabove(void) const
Get the Labove member data.
bool CanGetCenter(void) const
Check if it is safe to call GetCenter method.
TLabove & SetLabove(void)
Assign a value to Labove data member.
bool CanGetRbelow(void) const
Check if it is safe to call GetRbelow method.
void ResetRbelow(void)
Reset Rbelow data member.
bool IsSetRabove(void) const
Atom ID of Right Above Plane Atom Note: Atom ID's must be greater than "0" Check if a value has been ...
TRabove & SetRabove(void)
Assign a value to Rabove data member.
bool CanGetParity(void) const
Check if it is safe to call GetParity method.
TCenter GetCenter(void) const
Get the Center member data.
bool IsSetRbelow(void) const
Atom ID of Right Below Plane Atom Note: Atom ID's must be greater than "0" Check if a value has been ...
void ResetParity(void)
Reset Parity data member.
void ResetLabove(void)
Reset Labove data member.
TParity & SetParity(void)
Assign a value to Parity data member.
bool CanGetLbelow(void) const
Check if it is safe to call GetLbelow method.
bool CanGetLabove(void) const
Check if it is safe to call GetLabove method.
TRbelow & SetRbelow(void)
Assign a value to Rbelow data member.
TLbelow GetLbelow(void) const
Get the Lbelow member data.
Tparent::CMemberIndex< E_memberIndex, 7 > TmemberIndex
void ResetCenter(void)
Reset Center data member.
TParity GetParity(void) const
Get the Parity member data.
CPC_StereoSquarePlanar_Base & operator=(const CPC_StereoSquarePlanar_Base &)
CPC_StereoSquarePlanar_Base(const CPC_StereoSquarePlanar_Base &)
bool IsSetLbelow(void) const
Atom ID of Left Below Plane Atom Note: Atom ID's must be greater than "0" Check if a value has been a...
bool IsSetParity(void) const
Check if a value has been assigned to Parity data member.
TRbelow GetRbelow(void) const
Get the Rbelow member data.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:52 2024 by modify_doxy.py rev. 669887