NCBI C++ ToolKit
Chiral_center_.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 Chiral_center_.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/mmdb1/mmdb1.asn">mmdb1.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/mmdb1/mmdb1.def">mmdb1.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_MMDB1_CHIRAL_CENTER_BASE_HPP
42 #define OBJECTS_MMDB1_CHIRAL_CENTER_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
49 
51 
52 #ifndef BEGIN_objects_SCOPE
53 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
54 # define END_objects_SCOPE END_SCOPE(objects)
55 #endif
56 BEGIN_objects_SCOPE // namespace ncbi::objects::
57 
58 
59 // generated classes
60 
61 
62 /** @addtogroup dataspec_MMDB_Chemical_graph
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 /// Chiral centers are atoms with tetrahedral geometry. Chirality is defined
69 /// by a chiral volume involving the chiral center and 3 other atoms bonded to
70 /// it. For any coordinates assigned to atoms c, n1, n2, and n3, the vector
71 /// triple product (n1-c) dot ( (n2-c) cross (n3-c) ) must have the indicated
72 /// sign. The calculation assumes an orthogonal right-handed coordinate system
73 /// as is used for MMDB model structures.
74 /// Chirality is defined for standard residues in the MMDB dictionary, but is
75 /// not assigned automatically for PDB-derived nonstandard residues. If assigned
76 /// for nonstandard residues, the source of chirality information is described
77 /// by a citation within the residue description.
78 ///
79 /// CChiral_center_Base --
80 ///
81 
83 {
85 public:
86  // constructor
87  CChiral_center_Base(void);
88  // destructor
89  virtual ~CChiral_center_Base(void);
90 
91  // type info
93 
94  enum ESign {
95  eSign_positive = 1,
96  eSign_negative = 2
97  };
98 
99  /// Access to ESign's attributes (values, names) as defined in spec
100  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(ESign)(void);
101 
102  // types
103  typedef CAtom_id TC;
104  typedef CAtom_id TN1;
105  typedef CAtom_id TN2;
106  typedef CAtom_id TN3;
107  typedef ESign TSign;
108 
109  // member index
110  enum class E_memberIndex {
111  e__allMandatory = 0,
112  e_c,
113  e_n1,
114  e_n2,
115  e_n3,
116  e_sign
117  };
119 
120  // getters
121  // setters
122 
123  /// Check if a value has been assigned to C data member.
124  ///
125  /// Data member C is mandatory;
126  /// its type is defined as 'typedef CAtom_id TC'
127  /// @return
128  /// - true, if a value has been assigned.
129  /// - false, otherwise.
130  bool IsSetC(void) const;
131 
132  /// Check if it is safe to call GetC method.
133  ///
134  /// @return
135  /// - true, if the data member is getatable.
136  /// - false, otherwise.
137  bool CanGetC(void) const;
138 
139  /// Reset C data member.
140  void ResetC(void);
141 
142  /// Get the C member data.
143  ///
144  /// @return
145  /// Reference to the member data.
146  const TC& GetC(void) const;
147 
148  /// Assign a value to C data member.
149  ///
150  /// @param value
151  /// Value to assign
152  void SetC(const TC& value);
153 
154  /// Assign a value to C data member.
155  ///
156  /// @return
157  /// Reference to the data value.
158  TC& SetC(void);
159 
160  /// Check if a value has been assigned to N1 data member.
161  ///
162  /// Data member N1 is mandatory;
163  /// its type is defined as 'typedef CAtom_id TN1'
164  /// @return
165  /// - true, if a value has been assigned.
166  /// - false, otherwise.
167  bool IsSetN1(void) const;
168 
169  /// Check if it is safe to call GetN1 method.
170  ///
171  /// @return
172  /// - true, if the data member is getatable.
173  /// - false, otherwise.
174  bool CanGetN1(void) const;
175 
176  /// Reset N1 data member.
177  void ResetN1(void);
178 
179  /// Get the N1 member data.
180  ///
181  /// @return
182  /// Reference to the member data.
183  const TN1& GetN1(void) const;
184 
185  /// Assign a value to N1 data member.
186  ///
187  /// @param value
188  /// Value to assign
189  void SetN1(const TN1& value);
190 
191  /// Assign a value to N1 data member.
192  ///
193  /// @return
194  /// Reference to the data value.
195  TN1& SetN1(void);
196 
197  /// Check if a value has been assigned to N2 data member.
198  ///
199  /// Data member N2 is mandatory;
200  /// its type is defined as 'typedef CAtom_id TN2'
201  /// @return
202  /// - true, if a value has been assigned.
203  /// - false, otherwise.
204  bool IsSetN2(void) const;
205 
206  /// Check if it is safe to call GetN2 method.
207  ///
208  /// @return
209  /// - true, if the data member is getatable.
210  /// - false, otherwise.
211  bool CanGetN2(void) const;
212 
213  /// Reset N2 data member.
214  void ResetN2(void);
215 
216  /// Get the N2 member data.
217  ///
218  /// @return
219  /// Reference to the member data.
220  const TN2& GetN2(void) const;
221 
222  /// Assign a value to N2 data member.
223  ///
224  /// @param value
225  /// Value to assign
226  void SetN2(const TN2& value);
227 
228  /// Assign a value to N2 data member.
229  ///
230  /// @return
231  /// Reference to the data value.
232  TN2& SetN2(void);
233 
234  /// Check if a value has been assigned to N3 data member.
235  ///
236  /// Data member N3 is mandatory;
237  /// its type is defined as 'typedef CAtom_id TN3'
238  /// @return
239  /// - true, if a value has been assigned.
240  /// - false, otherwise.
241  bool IsSetN3(void) const;
242 
243  /// Check if it is safe to call GetN3 method.
244  ///
245  /// @return
246  /// - true, if the data member is getatable.
247  /// - false, otherwise.
248  bool CanGetN3(void) const;
249 
250  /// Reset N3 data member.
251  void ResetN3(void);
252 
253  /// Get the N3 member data.
254  ///
255  /// @return
256  /// Reference to the member data.
257  const TN3& GetN3(void) const;
258 
259  /// Assign a value to N3 data member.
260  ///
261  /// @param value
262  /// Value to assign
263  void SetN3(const TN3& value);
264 
265  /// Assign a value to N3 data member.
266  ///
267  /// @return
268  /// Reference to the data value.
269  TN3& SetN3(void);
270 
271  /// Check if a value has been assigned to Sign data member.
272  ///
273  /// Data member Sign is mandatory;
274  /// its type is defined as 'typedef ESign TSign'
275  /// @return
276  /// - true, if a value has been assigned.
277  /// - false, otherwise.
278  bool IsSetSign(void) const;
279 
280  /// Check if it is safe to call GetSign method.
281  ///
282  /// @return
283  /// - true, if the data member is getatable.
284  /// - false, otherwise.
285  bool CanGetSign(void) const;
286 
287  /// Reset Sign data member.
288  void ResetSign(void);
289 
290  /// Get the Sign member data.
291  ///
292  /// @return
293  /// Copy of the member data.
294  TSign GetSign(void) const;
295 
296  /// Assign a value to Sign data member.
297  ///
298  /// @param value
299  /// Value to assign
300  void SetSign(TSign value);
301 
302  /// Assign a value to Sign data member.
303  ///
304  /// @return
305  /// Reference to the data value.
306  TSign& SetSign(void);
307 
308  /// Reset the whole object
309  virtual void Reset(void);
310 
311 
312 private:
313  // Prohibit copy constructor and assignment operator
316 
317  // data
318  Uint4 m_set_State[1];
324 };
325 
326 /* @} */
327 
328 
329 
330 
331 
332 ///////////////////////////////////////////////////////////
333 ///////////////////// inline methods //////////////////////
334 ///////////////////////////////////////////////////////////
335 inline
337 {
338  return ((m_set_State[0] & 0x3) != 0);
339 }
340 
341 inline
343 {
344  return IsSetC();
345 }
346 
347 inline
349 {
350  m_C = CAtom_id(0);
351  m_set_State[0] &= ~0x3;
352 }
353 
354 inline
356 {
357  if (!CanGetC()) {
358  ThrowUnassigned(0);
359  }
360  return m_C;
361 }
362 
363 inline
365 {
366  m_C = value;
367  m_set_State[0] |= 0x3;
368 }
369 
370 inline
372 {
373  m_set_State[0] |= 0x1;
374  return m_C;
375 }
376 
377 inline
379 {
380  return ((m_set_State[0] & 0xc) != 0);
381 }
382 
383 inline
385 {
386  return IsSetN1();
387 }
388 
389 inline
391 {
392  m_N1 = CAtom_id(0);
393  m_set_State[0] &= ~0xc;
394 }
395 
396 inline
398 {
399  if (!CanGetN1()) {
400  ThrowUnassigned(1);
401  }
402  return m_N1;
403 }
404 
405 inline
407 {
408  m_N1 = value;
409  m_set_State[0] |= 0xc;
410 }
411 
412 inline
414 {
415  m_set_State[0] |= 0x4;
416  return m_N1;
417 }
418 
419 inline
421 {
422  return ((m_set_State[0] & 0x30) != 0);
423 }
424 
425 inline
427 {
428  return IsSetN2();
429 }
430 
431 inline
433 {
434  m_N2 = CAtom_id(0);
435  m_set_State[0] &= ~0x30;
436 }
437 
438 inline
440 {
441  if (!CanGetN2()) {
442  ThrowUnassigned(2);
443  }
444  return m_N2;
445 }
446 
447 inline
449 {
450  m_N2 = value;
451  m_set_State[0] |= 0x30;
452 }
453 
454 inline
456 {
457  m_set_State[0] |= 0x10;
458  return m_N2;
459 }
460 
461 inline
463 {
464  return ((m_set_State[0] & 0xc0) != 0);
465 }
466 
467 inline
469 {
470  return IsSetN3();
471 }
472 
473 inline
475 {
476  m_N3 = CAtom_id(0);
477  m_set_State[0] &= ~0xc0;
478 }
479 
480 inline
482 {
483  if (!CanGetN3()) {
484  ThrowUnassigned(3);
485  }
486  return m_N3;
487 }
488 
489 inline
491 {
492  m_N3 = value;
493  m_set_State[0] |= 0xc0;
494 }
495 
496 inline
498 {
499  m_set_State[0] |= 0x40;
500  return m_N3;
501 }
502 
503 inline
505 {
506  return ((m_set_State[0] & 0x300) != 0);
507 }
508 
509 inline
511 {
512  return IsSetSign();
513 }
514 
515 inline
517 {
518  m_Sign = (ESign)(0);
519  m_set_State[0] &= ~0x300;
520 }
521 
522 inline
524 {
525  if (!CanGetSign()) {
526  ThrowUnassigned(4);
527  }
528  return m_Sign;
529 }
530 
531 inline
533 {
534  m_Sign = value;
535  m_set_State[0] |= 0x300;
536 }
537 
538 inline
540 {
541 #ifdef _DEBUG
542  if (!IsSetSign()) {
543  memset(&m_Sign,UnassignedByte(),sizeof(m_Sign));
544  }
545 #endif
546  m_set_State[0] |= 0x100;
547  return m_Sign;
548 }
549 
550 ///////////////////////////////////////////////////////////
551 ////////////////// end of inline methods //////////////////
552 ///////////////////////////////////////////////////////////
553 
554 
555 
556 
557 
558 END_objects_SCOPE // namespace ncbi::objects::
559 
561 
562 
563 #endif // OBJECTS_MMDB1_CHIRAL_CENTER_BASE_HPP
User-defined methods of the data storage class.
CAtom_id –.
Definition: Atom_id.hpp:66
Chiral centers are atoms with tetrahedral geometry.
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_MMDB1_EXPORT
Definition: ncbi_export.h:624
void ResetC(void)
Reset C data member.
CChiral_center_Base & operator=(const CChiral_center_Base &)
bool IsSetC(void) const
Check if a value has been assigned to C data member.
bool IsSetN2(void) const
Check if a value has been assigned to N2 data member.
CChiral_center_Base(const CChiral_center_Base &)
TSign GetSign(void) const
Get the Sign member data.
TC & SetC(void)
Assign a value to C data member.
CSerialObject Tparent
Tparent::CMemberIndex< E_memberIndex, 6 > TmemberIndex
bool CanGetN3(void) const
Check if it is safe to call GetN3 method.
void ResetN3(void)
Reset N3 data member.
bool CanGetN2(void) const
Check if it is safe to call GetN2 method.
bool IsSetSign(void) const
Check if a value has been assigned to Sign data member.
TN2 & SetN2(void)
Assign a value to N2 data member.
const TN1 & GetN1(void) const
Get the N1 member data.
const TN3 & GetN3(void) const
Get the N3 member data.
TN3 & SetN3(void)
Assign a value to N3 data member.
void ResetN1(void)
Reset N1 data member.
bool CanGetN1(void) const
Check if it is safe to call GetN1 method.
void ResetSign(void)
Reset Sign data member.
bool CanGetSign(void) const
Check if it is safe to call GetSign method.
bool IsSetN3(void) const
Check if a value has been assigned to N3 data member.
bool IsSetN1(void) const
Check if a value has been assigned to N1 data member.
TN1 & SetN1(void)
Assign a value to N1 data member.
bool CanGetC(void) const
Check if it is safe to call GetC method.
const TC & GetC(void) const
Get the C member data.
TSign & SetSign(void)
Assign a value to Sign data member.
void ResetN2(void)
Reset N2 data member.
const TN2 & GetN2(void) const
Get the N2 member data.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:58:20 2024 by modify_doxy.py rev. 669887