NCBI C++ ToolKit
Residue_graph_.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 Residue_graph_.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_RESIDUE_GRAPH_BASE_HPP
42 #define OBJECTS_MMDB1_RESIDUE_GRAPH_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
49 #include <string>
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 CAtom;
63 class CBiomol_descr;
64 class CChiral_center;
66 
67 
68 // generated classes
69 
70 
71 /** @addtogroup dataspec_MMDB_Chemical_graph
72  *
73  * @{
74  */
75 
76 /////////////////////////////////////////////////////////////////////////////
77 /// Residue graphs define atomic formulae, connectivity, chirality, and names.
78 /// For standard residue graphs from the MMDB dictionary the PDB-assigned
79 /// residue-type code appears as the name within the residue graph description,
80 /// and the full trivial name of the residue as a comment within that
81 /// description. For any nonstandard residue graphs provided with an MMDB
82 /// biostruc the PDB-assigned residue-type code similarly appears as the name
83 /// within the description, and any information provided on PDB HET records as
84 /// a pdb-comment within that description.
85 /// Note that nonstandard residue graphs for a PDB-derived biostruc may be
86 /// incomplete. Current PDB format cannot represent connectivity for groups
87 /// which are disordered, and for which no coordinates are given. In these
88 /// cases the residue graph defined in MMDB represents only the subgraph that
89 /// could be identified from available ATOM, HETATM and CONECT records.
90 ///
91 /// CResidue_graph_Base --
92 ///
93 
95 {
97 public:
98  // constructor
99  CResidue_graph_Base(void);
100  // destructor
101  virtual ~CResidue_graph_Base(void);
102 
103  // type info
105 
107  eResidue_type_deoxyribonucleotide = 1,
108  eResidue_type_ribonucleotide = 2,
109  eResidue_type_amino_acid = 3,
110  eResidue_type_other = 255
111  };
112 
113  /// Access to EResidue_type's attributes (values, names) as defined in spec
114  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EResidue_type)(void);
115 
116  // types
118  typedef list< CRef< CBiomol_descr > > TDescr;
119  typedef int TResidue_type;
120  typedef list< string > TIupac_code;
121  typedef list< CRef< CAtom > > TAtoms;
122  typedef list< CRef< CIntra_residue_bond > > TBonds;
123  typedef list< CRef< CChiral_center > > TChiral_centers;
124 
125  // member index
126  enum class E_memberIndex {
127  e__allMandatory = 0,
128  e_id,
129  e_descr,
130  e_residue_type,
131  e_iupac_code,
132  e_atoms,
133  e_bonds,
134  e_chiral_centers
135  };
137 
138  // getters
139  // setters
140 
141  /// Check if a value has been assigned to Id data member.
142  ///
143  /// Data member Id is mandatory;
144  /// its type is defined as 'typedef CResidue_graph_id TId'
145  /// @return
146  /// - true, if a value has been assigned.
147  /// - false, otherwise.
148  bool IsSetId(void) const;
149 
150  /// Check if it is safe to call GetId method.
151  ///
152  /// @return
153  /// - true, if the data member is getatable.
154  /// - false, otherwise.
155  bool CanGetId(void) const;
156 
157  /// Reset Id data member.
158  void ResetId(void);
159 
160  /// Get the Id member data.
161  ///
162  /// @return
163  /// Reference to the member data.
164  const TId& GetId(void) const;
165 
166  /// Assign a value to Id data member.
167  ///
168  /// @param value
169  /// Value to assign
170  void SetId(const TId& value);
171 
172  /// Assign a value to Id data member.
173  ///
174  /// @return
175  /// Reference to the data value.
176  TId& SetId(void);
177 
178  /// Check if a value has been assigned to Descr data member.
179  ///
180  /// Data member Descr is optional;
181  /// its type is defined as 'typedef list< CRef< CBiomol_descr > > TDescr'
182  /// @return
183  /// - true, if a value has been assigned.
184  /// - false, otherwise.
185  bool IsSetDescr(void) const;
186 
187  /// Check if it is safe to call GetDescr method.
188  ///
189  /// @return
190  /// - true, if the data member is getatable.
191  /// - false, otherwise.
192  bool CanGetDescr(void) const;
193 
194  /// Reset Descr data member.
195  void ResetDescr(void);
196 
197  /// Get the Descr member data.
198  ///
199  /// @return
200  /// Reference to the member data.
201  const TDescr& GetDescr(void) const;
202 
203  /// Assign a value to Descr data member.
204  ///
205  /// @return
206  /// Reference to the data value.
207  TDescr& SetDescr(void);
208 
209  /// Check if a value has been assigned to Residue_type data member.
210  ///
211  /// Data member Residue_type is optional;
212  /// its type is defined as 'typedef int TResidue_type'
213  /// @return
214  /// - true, if a value has been assigned.
215  /// - false, otherwise.
216  bool IsSetResidue_type(void) const;
217 
218  /// Check if it is safe to call GetResidue_type method.
219  ///
220  /// @return
221  /// - true, if the data member is getatable.
222  /// - false, otherwise.
223  bool CanGetResidue_type(void) const;
224 
225  /// Reset Residue_type data member.
226  void ResetResidue_type(void);
227 
228  /// Get the Residue_type member data.
229  ///
230  /// @return
231  /// Copy of the member data.
232  TResidue_type GetResidue_type(void) const;
233 
234  /// Assign a value to Residue_type data member.
235  ///
236  /// @param value
237  /// Value to assign
238  void SetResidue_type(TResidue_type value);
239 
240  /// Assign a value to Residue_type data member.
241  ///
242  /// @return
243  /// Reference to the data value.
244  TResidue_type& SetResidue_type(void);
245 
246  /// Check if a value has been assigned to Iupac_code data member.
247  ///
248  /// Data member Iupac_code is optional;
249  /// its type is defined as 'typedef list< string > TIupac_code'
250  /// @return
251  /// - true, if a value has been assigned.
252  /// - false, otherwise.
253  bool IsSetIupac_code(void) const;
254 
255  /// Check if it is safe to call GetIupac_code method.
256  ///
257  /// @return
258  /// - true, if the data member is getatable.
259  /// - false, otherwise.
260  bool CanGetIupac_code(void) const;
261 
262  /// Reset Iupac_code data member.
263  void ResetIupac_code(void);
264 
265  /// Get the Iupac_code member data.
266  ///
267  /// @return
268  /// Reference to the member data.
269  const TIupac_code& GetIupac_code(void) const;
270 
271  /// Assign a value to Iupac_code data member.
272  ///
273  /// @return
274  /// Reference to the data value.
275  TIupac_code& SetIupac_code(void);
276 
277  /// Check if a value has been assigned to Atoms data member.
278  ///
279  /// Data member Atoms is mandatory;
280  /// its type is defined as 'typedef list< CRef< CAtom > > TAtoms'
281  /// @return
282  /// - true, if a value has been assigned.
283  /// - false, otherwise.
284  bool IsSetAtoms(void) const;
285 
286  /// Check if it is safe to call GetAtoms method.
287  ///
288  /// @return
289  /// - true, if the data member is getatable.
290  /// - false, otherwise.
291  bool CanGetAtoms(void) const;
292 
293  /// Reset Atoms data member.
294  void ResetAtoms(void);
295 
296  /// Get the Atoms member data.
297  ///
298  /// @return
299  /// Reference to the member data.
300  const TAtoms& GetAtoms(void) const;
301 
302  /// Assign a value to Atoms data member.
303  ///
304  /// @return
305  /// Reference to the data value.
306  TAtoms& SetAtoms(void);
307 
308  /// Check if a value has been assigned to Bonds data member.
309  ///
310  /// Data member Bonds is mandatory;
311  /// its type is defined as 'typedef list< CRef< CIntra_residue_bond > > TBonds'
312  /// @return
313  /// - true, if a value has been assigned.
314  /// - false, otherwise.
315  bool IsSetBonds(void) const;
316 
317  /// Check if it is safe to call GetBonds method.
318  ///
319  /// @return
320  /// - true, if the data member is getatable.
321  /// - false, otherwise.
322  bool CanGetBonds(void) const;
323 
324  /// Reset Bonds data member.
325  void ResetBonds(void);
326 
327  /// Get the Bonds member data.
328  ///
329  /// @return
330  /// Reference to the member data.
331  const TBonds& GetBonds(void) const;
332 
333  /// Assign a value to Bonds data member.
334  ///
335  /// @return
336  /// Reference to the data value.
337  TBonds& SetBonds(void);
338 
339  /// Check if a value has been assigned to Chiral_centers data member.
340  ///
341  /// Data member Chiral_centers is optional;
342  /// its type is defined as 'typedef list< CRef< CChiral_center > > TChiral_centers'
343  /// @return
344  /// - true, if a value has been assigned.
345  /// - false, otherwise.
346  bool IsSetChiral_centers(void) const;
347 
348  /// Check if it is safe to call GetChiral_centers method.
349  ///
350  /// @return
351  /// - true, if the data member is getatable.
352  /// - false, otherwise.
353  bool CanGetChiral_centers(void) const;
354 
355  /// Reset Chiral_centers data member.
356  void ResetChiral_centers(void);
357 
358  /// Get the Chiral_centers member data.
359  ///
360  /// @return
361  /// Reference to the member data.
362  const TChiral_centers& GetChiral_centers(void) const;
363 
364  /// Assign a value to Chiral_centers data member.
365  ///
366  /// @return
367  /// Reference to the data value.
368  TChiral_centers& SetChiral_centers(void);
369 
370  /// Reset the whole object
371  virtual void Reset(void);
372 
373 
374 private:
375  // Prohibit copy constructor and assignment operator
378 
379  // data
380  Uint4 m_set_State[1];
382  list< CRef< CBiomol_descr > > m_Descr;
384  list< string > m_Iupac_code;
385  list< CRef< CAtom > > m_Atoms;
386  list< CRef< CIntra_residue_bond > > m_Bonds;
387  list< CRef< CChiral_center > > m_Chiral_centers;
388 };
389 
390 /* @} */
391 
392 
393 
394 
395 
396 ///////////////////////////////////////////////////////////
397 ///////////////////// inline methods //////////////////////
398 ///////////////////////////////////////////////////////////
399 inline
401 {
402  return ((m_set_State[0] & 0x3) != 0);
403 }
404 
405 inline
407 {
408  return IsSetId();
409 }
410 
411 inline
413 {
414  m_Id = CResidue_graph_id(0);
415  m_set_State[0] &= ~0x3;
416 }
417 
418 inline
420 {
421  if (!CanGetId()) {
422  ThrowUnassigned(0);
423  }
424  return m_Id;
425 }
426 
427 inline
429 {
430  m_Id = value;
431  m_set_State[0] |= 0x3;
432 }
433 
434 inline
436 {
437  m_set_State[0] |= 0x1;
438  return m_Id;
439 }
440 
441 inline
443 {
444  return ((m_set_State[0] & 0xc) != 0);
445 }
446 
447 inline
449 {
450  return true;
451 }
452 
453 inline
455 {
456  return m_Descr;
457 }
458 
459 inline
461 {
462  m_set_State[0] |= 0x4;
463  return m_Descr;
464 }
465 
466 inline
468 {
469  return ((m_set_State[0] & 0x30) != 0);
470 }
471 
472 inline
474 {
475  return IsSetResidue_type();
476 }
477 
478 inline
480 {
482  m_set_State[0] &= ~0x30;
483 }
484 
485 inline
487 {
488  if (!CanGetResidue_type()) {
489  ThrowUnassigned(2);
490  }
491  return m_Residue_type;
492 }
493 
494 inline
496 {
498  m_set_State[0] |= 0x30;
499 }
500 
501 inline
503 {
504 #ifdef _DEBUG
505  if (!IsSetResidue_type()) {
506  memset(&m_Residue_type,UnassignedByte(),sizeof(m_Residue_type));
507  }
508 #endif
509  m_set_State[0] |= 0x10;
510  return m_Residue_type;
511 }
512 
513 inline
515 {
516  return ((m_set_State[0] & 0xc0) != 0);
517 }
518 
519 inline
521 {
522  return true;
523 }
524 
525 inline
527 {
528  return m_Iupac_code;
529 }
530 
531 inline
533 {
534  m_set_State[0] |= 0x40;
535  return m_Iupac_code;
536 }
537 
538 inline
540 {
541  return ((m_set_State[0] & 0x300) != 0);
542 }
543 
544 inline
546 {
547  return true;
548 }
549 
550 inline
552 {
553  return m_Atoms;
554 }
555 
556 inline
558 {
559  m_set_State[0] |= 0x100;
560  return m_Atoms;
561 }
562 
563 inline
565 {
566  return ((m_set_State[0] & 0xc00) != 0);
567 }
568 
569 inline
571 {
572  return true;
573 }
574 
575 inline
577 {
578  return m_Bonds;
579 }
580 
581 inline
583 {
584  m_set_State[0] |= 0x400;
585  return m_Bonds;
586 }
587 
588 inline
590 {
591  return ((m_set_State[0] & 0x3000) != 0);
592 }
593 
594 inline
596 {
597  return true;
598 }
599 
600 inline
602 {
603  return m_Chiral_centers;
604 }
605 
606 inline
608 {
609  m_set_State[0] |= 0x1000;
610  return m_Chiral_centers;
611 }
612 
613 ///////////////////////////////////////////////////////////
614 ////////////////// end of inline methods //////////////////
615 ///////////////////////////////////////////////////////////
616 
617 
618 
619 
620 
621 END_objects_SCOPE // namespace ncbi::objects::
622 
624 
625 
626 #endif // OBJECTS_MMDB1_RESIDUE_GRAPH_BASE_HPP
User-defined methods of the data storage class.
CAtom –.
Definition: Atom.hpp:66
CBiomol_descr –.
CChiral_center –.
CIntra_residue_bond –.
Residue graphs define atomic formulae, connectivity, chirality, and names.
CResidue_graph_id –.
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
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
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
CResidue_graph_Base & operator=(const CResidue_graph_Base &)
TResidue_type GetResidue_type(void) const
Get the Residue_type member data.
list< CRef< CAtom > > m_Atoms
TChiral_centers & SetChiral_centers(void)
Assign a value to Chiral_centers data member.
const TChiral_centers & GetChiral_centers(void) const
Get the Chiral_centers member data.
void ResetResidue_type(void)
Reset Residue_type data member.
bool IsSetAtoms(void) const
Check if a value has been assigned to Atoms data member.
list< CRef< CAtom > > TAtoms
bool IsSetChiral_centers(void) const
Check if a value has been assigned to Chiral_centers data member.
CResidue_graph_id TId
const TDescr & GetDescr(void) const
Get the Descr member data.
void ResetId(void)
Reset Id data member.
list< CRef< CBiomol_descr > > TDescr
TBonds & SetBonds(void)
Assign a value to Bonds data member.
list< CRef< CChiral_center > > TChiral_centers
bool IsSetDescr(void) const
Check if a value has been assigned to Descr data member.
CResidue_graph_Base(const CResidue_graph_Base &)
const TIupac_code & GetIupac_code(void) const
Get the Iupac_code member data.
TAtoms & SetAtoms(void)
Assign a value to Atoms data member.
bool IsSetId(void) const
Check if a value has been assigned to Id data member.
list< CRef< CChiral_center > > m_Chiral_centers
bool IsSetResidue_type(void) const
Check if a value has been assigned to Residue_type data member.
CResidue_graph_id m_Id
bool IsSetBonds(void) const
Check if a value has been assigned to Bonds data member.
bool CanGetBonds(void) const
Check if it is safe to call GetBonds method.
bool CanGetChiral_centers(void) const
Check if it is safe to call GetChiral_centers method.
TId & SetId(void)
Assign a value to Id data member.
bool CanGetIupac_code(void) const
Check if it is safe to call GetIupac_code method.
TIupac_code & SetIupac_code(void)
Assign a value to Iupac_code data member.
bool CanGetId(void) const
Check if it is safe to call GetId method.
list< CRef< CIntra_residue_bond > > m_Bonds
const TBonds & GetBonds(void) const
Get the Bonds member data.
bool CanGetDescr(void) const
Check if it is safe to call GetDescr method.
bool IsSetIupac_code(void) const
Check if a value has been assigned to Iupac_code data member.
bool CanGetAtoms(void) const
Check if it is safe to call GetAtoms method.
Tparent::CMemberIndex< E_memberIndex, 8 > TmemberIndex
list< CRef< CIntra_residue_bond > > TBonds
TDescr & SetDescr(void)
Assign a value to Descr data member.
list< string > TIupac_code
bool CanGetResidue_type(void) const
Check if it is safe to call GetResidue_type method.
list< CRef< CBiomol_descr > > m_Descr
const TId & GetId(void) const
Get the Id member data.
list< string > m_Iupac_code
const TAtoms & GetAtoms(void) const
Get the Atoms member data.
CSerialObject Tparent
TResidue_type & SetResidue_type(void)
Assign a value to Residue_type data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed Sep 04 15:03:18 2024 by modify_doxy.py rev. 669887