NCBI C++ ToolKit
PC_StereoTShape_.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_StereoTShape_.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_STEREOTSHAPE_BASE_HPP
42 #define OBJECTS_PCSUBSTANCE_PC_STEREOTSHAPE_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 /// T-Shaped (TS-3) 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_StereoTShape_Base --
69 ///
70 
72 {
74 public:
75  // constructor
77  // destructor
78  virtual ~CPC_StereoTShape_Base(void);
79 
80  // type info
82 
83  // types
84  typedef int TCenter;
85  typedef int TTop;
86  typedef int TBottom;
87  typedef int TAbove;
88 
89  // member index
90  enum class E_memberIndex {
91  e__allMandatory = 0,
92  e_center,
93  e_top,
94  e_bottom,
95  e_above
96  };
98 
99  // getters
100  // setters
101 
102  /// Atom ID of Atom Center
103  /// Note: Atom ID's must be greater than "0"
104  /// Check if a value has been assigned to Center data member.
105  ///
106  /// Data member Center is mandatory;
107  /// its type is defined as 'typedef int TCenter'
108  /// @return
109  /// - true, if a value has been assigned.
110  /// - false, otherwise.
111  bool IsSetCenter(void) const;
112 
113  /// Check if it is safe to call GetCenter method.
114  ///
115  /// @return
116  /// - true, if the data member is getatable.
117  /// - false, otherwise.
118  bool CanGetCenter(void) const;
119 
120  /// Reset Center data member.
121  void ResetCenter(void);
122 
123  /// Get the Center member data.
124  ///
125  /// @return
126  /// Copy of the member data.
127  TCenter GetCenter(void) const;
128 
129  /// Assign a value to Center data member.
130  ///
131  /// @param value
132  /// Value to assign
133  void SetCenter(TCenter value);
134 
135  /// Assign a value to Center data member.
136  ///
137  /// @return
138  /// Reference to the data value.
139  TCenter& SetCenter(void);
140 
141  /// Atom ID of Atom In-Plane and at the Top
142  /// Note: Atom ID's must be greater than "0"
143  /// Check if a value has been assigned to Top data member.
144  ///
145  /// Data member Top is mandatory;
146  /// its type is defined as 'typedef int TTop'
147  /// @return
148  /// - true, if a value has been assigned.
149  /// - false, otherwise.
150  bool IsSetTop(void) const;
151 
152  /// Check if it is safe to call GetTop method.
153  ///
154  /// @return
155  /// - true, if the data member is getatable.
156  /// - false, otherwise.
157  bool CanGetTop(void) const;
158 
159  /// Reset Top data member.
160  void ResetTop(void);
161 
162  /// Get the Top member data.
163  ///
164  /// @return
165  /// Copy of the member data.
166  TTop GetTop(void) const;
167 
168  /// Assign a value to Top data member.
169  ///
170  /// @param value
171  /// Value to assign
172  void SetTop(TTop value);
173 
174  /// Assign a value to Top data member.
175  ///
176  /// @return
177  /// Reference to the data value.
178  TTop& SetTop(void);
179 
180  /// Atom ID of Atom In-Plane and at the Bottom
181  /// Note: Atom ID's must be greater than "0"
182  /// Check if a value has been assigned to Bottom data member.
183  ///
184  /// Data member Bottom is mandatory;
185  /// its type is defined as 'typedef int TBottom'
186  /// @return
187  /// - true, if a value has been assigned.
188  /// - false, otherwise.
189  bool IsSetBottom(void) const;
190 
191  /// Check if it is safe to call GetBottom method.
192  ///
193  /// @return
194  /// - true, if the data member is getatable.
195  /// - false, otherwise.
196  bool CanGetBottom(void) const;
197 
198  /// Reset Bottom data member.
199  void ResetBottom(void);
200 
201  /// Get the Bottom member data.
202  ///
203  /// @return
204  /// Copy of the member data.
205  TBottom GetBottom(void) const;
206 
207  /// Assign a value to Bottom data member.
208  ///
209  /// @param value
210  /// Value to assign
211  void SetBottom(TBottom value);
212 
213  /// Assign a value to Bottom data member.
214  ///
215  /// @return
216  /// Reference to the data value.
217  TBottom& SetBottom(void);
218 
219  /// Atom ID of Atom Above the Plane
220  /// Note: Atom ID's must be greater than "0"
221  /// Check if a value has been assigned to Above data member.
222  ///
223  /// Data member Above is mandatory;
224  /// its type is defined as 'typedef int TAbove'
225  /// @return
226  /// - true, if a value has been assigned.
227  /// - false, otherwise.
228  bool IsSetAbove(void) const;
229 
230  /// Check if it is safe to call GetAbove method.
231  ///
232  /// @return
233  /// - true, if the data member is getatable.
234  /// - false, otherwise.
235  bool CanGetAbove(void) const;
236 
237  /// Reset Above data member.
238  void ResetAbove(void);
239 
240  /// Get the Above member data.
241  ///
242  /// @return
243  /// Copy of the member data.
244  TAbove GetAbove(void) const;
245 
246  /// Assign a value to Above data member.
247  ///
248  /// @param value
249  /// Value to assign
250  void SetAbove(TAbove value);
251 
252  /// Assign a value to Above data member.
253  ///
254  /// @return
255  /// Reference to the data value.
256  TAbove& SetAbove(void);
257 
258  /// Reset the whole object
259  virtual void Reset(void);
260 
261 
262 private:
263  // Prohibit copy constructor and assignment operator
266 
267  // data
268  Uint4 m_set_State[1];
269  int m_Center;
270  int m_Top;
271  int m_Bottom;
272  int m_Above;
273 };
274 
275 /* @} */
276 
277 
278 
279 
280 
281 ///////////////////////////////////////////////////////////
282 ///////////////////// inline methods //////////////////////
283 ///////////////////////////////////////////////////////////
284 inline
286 {
287  return ((m_set_State[0] & 0x3) != 0);
288 }
289 
290 inline
292 {
293  return IsSetCenter();
294 }
295 
296 inline
298 {
299  m_Center = 0;
300  m_set_State[0] &= ~0x3;
301 }
302 
303 inline
305 {
306  if (!CanGetCenter()) {
307  ThrowUnassigned(0);
308  }
309  return m_Center;
310 }
311 
312 inline
314 {
315  m_Center = value;
316  m_set_State[0] |= 0x3;
317 }
318 
319 inline
321 {
322 #ifdef _DEBUG
323  if (!IsSetCenter()) {
324  memset(&m_Center,UnassignedByte(),sizeof(m_Center));
325  }
326 #endif
327  m_set_State[0] |= 0x1;
328  return m_Center;
329 }
330 
331 inline
333 {
334  return ((m_set_State[0] & 0xc) != 0);
335 }
336 
337 inline
339 {
340  return IsSetTop();
341 }
342 
343 inline
345 {
346  m_Top = 0;
347  m_set_State[0] &= ~0xc;
348 }
349 
350 inline
352 {
353  if (!CanGetTop()) {
354  ThrowUnassigned(1);
355  }
356  return m_Top;
357 }
358 
359 inline
361 {
362  m_Top = value;
363  m_set_State[0] |= 0xc;
364 }
365 
366 inline
368 {
369 #ifdef _DEBUG
370  if (!IsSetTop()) {
371  memset(&m_Top,UnassignedByte(),sizeof(m_Top));
372  }
373 #endif
374  m_set_State[0] |= 0x4;
375  return m_Top;
376 }
377 
378 inline
380 {
381  return ((m_set_State[0] & 0x30) != 0);
382 }
383 
384 inline
386 {
387  return IsSetBottom();
388 }
389 
390 inline
392 {
393  m_Bottom = 0;
394  m_set_State[0] &= ~0x30;
395 }
396 
397 inline
399 {
400  if (!CanGetBottom()) {
401  ThrowUnassigned(2);
402  }
403  return m_Bottom;
404 }
405 
406 inline
408 {
409  m_Bottom = value;
410  m_set_State[0] |= 0x30;
411 }
412 
413 inline
415 {
416 #ifdef _DEBUG
417  if (!IsSetBottom()) {
418  memset(&m_Bottom,UnassignedByte(),sizeof(m_Bottom));
419  }
420 #endif
421  m_set_State[0] |= 0x10;
422  return m_Bottom;
423 }
424 
425 inline
427 {
428  return ((m_set_State[0] & 0xc0) != 0);
429 }
430 
431 inline
433 {
434  return IsSetAbove();
435 }
436 
437 inline
439 {
440  m_Above = 0;
441  m_set_State[0] &= ~0xc0;
442 }
443 
444 inline
446 {
447  if (!CanGetAbove()) {
448  ThrowUnassigned(3);
449  }
450  return m_Above;
451 }
452 
453 inline
455 {
456  m_Above = value;
457  m_set_State[0] |= 0xc0;
458 }
459 
460 inline
462 {
463 #ifdef _DEBUG
464  if (!IsSetAbove()) {
465  memset(&m_Above,UnassignedByte(),sizeof(m_Above));
466  }
467 #endif
468  m_set_State[0] |= 0x40;
469  return m_Above;
470 }
471 
472 ///////////////////////////////////////////////////////////
473 ////////////////// end of inline methods //////////////////
474 ///////////////////////////////////////////////////////////
475 
476 
477 
478 
479 
480 END_objects_SCOPE // namespace ncbi::objects::
481 
483 
484 
485 #endif // OBJECTS_PCSUBSTANCE_PC_STEREOTSHAPE_BASE_HPP
T-Shaped (TS-3) StereoCenters [Using IUPAC Stereogenic Center recommendations and terminology] [Note:...
Base class for all serializable objects.
Definition: serialbase.hpp:150
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
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
TBottom & SetBottom(void)
Assign a value to Bottom data member.
bool CanGetCenter(void) const
Check if it is safe to call GetCenter method.
TAbove & SetAbove(void)
Assign a value to Above data member.
bool IsSetAbove(void) const
Atom ID of Atom Above the Plane Note: Atom ID's must be greater than "0" Check if a value has been as...
bool CanGetTop(void) const
Check if it is safe to call GetTop method.
bool IsSetBottom(void) const
Atom ID of Atom In-Plane and at the Bottom Note: Atom ID's must be greater than "0" Check if a value ...
bool CanGetBottom(void) const
Check if it is safe to call GetBottom method.
bool IsSetTop(void) const
Atom ID of Atom In-Plane and at the Top Note: Atom ID's must be greater than "0" Check if a value has...
CPC_StereoTShape_Base(const CPC_StereoTShape_Base &)
void ResetAbove(void)
Reset Above data member.
TTop GetTop(void) const
Get the Top member data.
TCenter GetCenter(void) const
Get the Center member data.
TBottom GetBottom(void) const
Get the Bottom member data.
TTop & SetTop(void)
Assign a value to Top data member.
bool CanGetAbove(void) const
Check if it is safe to call GetAbove method.
CPC_StereoTShape_Base & operator=(const CPC_StereoTShape_Base &)
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...
void ResetTop(void)
Reset Top data member.
TCenter & SetCenter(void)
Assign a value to Center data member.
void ResetBottom(void)
Reset Bottom data member.
void ResetCenter(void)
Reset Center data member.
TAbove GetAbove(void) const
Get the Above member data.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sun Apr 21 03:43:43 2024 by modify_doxy.py rev. 669887