NCBI C++ ToolKit
PDB_seq_id_.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 PDB_seq_id_.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/seqloc/seqloc.asn">seqloc.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqloc/seqloc.def">seqloc.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_SEQLOC_PDB_SEQ_ID_BASE_HPP
42 #define OBJECTS_SEQLOC_PDB_SEQ_ID_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
50 
52 
53 #ifndef BEGIN_objects_SCOPE
54 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
55 # define END_objects_SCOPE END_SCOPE(objects)
56 #endif
57 BEGIN_objects_SCOPE // namespace ncbi::objects::
58 
59 
60 // forward declarations
61 class CDate;
62 
63 
64 // generated classes
65 
66 
67 /** @addtogroup dataspec_NCBI_Seqloc
68  *
69  * @{
70  */
71 
72 /////////////////////////////////////////////////////////////////////////////
73 ///
74 ///
75 /// CPDB_seq_id_Base --
76 ///
77 
79 {
81 public:
82  // constructor
83  CPDB_seq_id_Base(void);
84  // destructor
85  virtual ~CPDB_seq_id_Base(void);
86 
87  // type info
89 
90  // types
91  typedef CPDB_mol_id TMol;
92  typedef int TChain;
93  typedef CDate TRel;
94  typedef string TChain_id;
95 
96  // member index
97  enum class E_memberIndex {
98  e__allMandatory = 0,
99  e_mol,
100  e_chain,
101  e_rel,
102  e_chain_id
103  };
105 
106  // getters
107  // setters
108 
109  /// the molecule name
110  /// Check if a value has been assigned to Mol data member.
111  ///
112  /// Data member Mol is mandatory;
113  /// its type is defined as 'typedef CPDB_mol_id TMol'
114  /// @return
115  /// - true, if a value has been assigned.
116  /// - false, otherwise.
117  bool IsSetMol(void) const;
118 
119  /// Check if it is safe to call GetMol method.
120  ///
121  /// @return
122  /// - true, if the data member is getatable.
123  /// - false, otherwise.
124  bool CanGetMol(void) const;
125 
126  /// Reset Mol data member.
127  void ResetMol(void);
128 
129  /// Get the Mol member data.
130  ///
131  /// @return
132  /// Reference to the member data.
133  const TMol& GetMol(void) const;
134 
135  /// Assign a value to Mol data member.
136  ///
137  /// @param value
138  /// Value to assign
139  void SetMol(const TMol& value);
140 
141  /// Assign a value to Mol data member.
142  ///
143  /// @return
144  /// Reference to the data value.
145  TMol& SetMol(void);
146 
147  /// Deprecated: 'chain' can't support multiple character
148  /// PDB chain identifiers (introduced in 2015).
149  /// 'chain-id' stores chain identifiers of any length.
150  /// Check if a value has been assigned to Chain data member.
151  ///
152  /// Data member Chain is optional with default 32;
153  /// its type is defined as 'typedef int TChain'
154  /// @return
155  /// - true, if a value has been assigned.
156  /// - false, otherwise.
157  bool IsSetChain(void) const;
158 
159  /// Check if it is safe to call GetChain method.
160  ///
161  /// @return
162  /// - true, if the data member is getatable.
163  /// - false, otherwise.
164  bool CanGetChain(void) const;
165 
166  /// Reset Chain data member.
167  void ResetChain(void);
168 
169  /// Assign default value to Chain data member.
170  void SetDefaultChain(void);
171 
172  /// Get the Chain member data.
173  ///
174  /// @return
175  /// Copy of the member data.
176  TChain GetChain(void) const;
177 
178  /// Assign a value to Chain data member.
179  ///
180  /// @param value
181  /// Value to assign
182  void SetChain(TChain value);
183 
184  /// Assign a value to Chain data member.
185  ///
186  /// @return
187  /// Reference to the data value.
188  TChain& SetChain(void);
189 
190  /// release date, month and year
191  /// Check if a value has been assigned to Rel data member.
192  ///
193  /// Data member Rel is optional;
194  /// its type is defined as 'typedef CDate TRel'
195  /// @return
196  /// - true, if a value has been assigned.
197  /// - false, otherwise.
198  bool IsSetRel(void) const;
199 
200  /// Check if it is safe to call GetRel method.
201  ///
202  /// @return
203  /// - true, if the data member is getatable.
204  /// - false, otherwise.
205  bool CanGetRel(void) const;
206 
207  /// Reset Rel data member.
208  void ResetRel(void);
209 
210  /// Get the Rel member data.
211  ///
212  /// @return
213  /// Reference to the member data.
214  const TRel& GetRel(void) const;
215 
216  /// Assign a value to Rel data member.
217  ///
218  /// @param value
219  /// Reference to value.
220  void SetRel(TRel& value);
221 
222  /// Assign a value to Rel data member.
223  ///
224  /// @return
225  /// Reference to the data value.
226  TRel& SetRel(void);
227 
228  /// chain identifier; length-independent generalization of 'chain'
229  /// Check if a value has been assigned to Chain_id data member.
230  ///
231  /// Data member Chain_id is optional;
232  /// its type is defined as 'typedef string TChain_id'
233  /// @return
234  /// - true, if a value has been assigned.
235  /// - false, otherwise.
236  bool IsSetChain_id(void) const;
237 
238  /// Check if it is safe to call GetChain_id method.
239  ///
240  /// @return
241  /// - true, if the data member is getatable.
242  /// - false, otherwise.
243  bool CanGetChain_id(void) const;
244 
245  /// Reset Chain_id data member.
246  void ResetChain_id(void);
247 
248  /// Get the Chain_id member data.
249  ///
250  /// @return
251  /// Reference to the member data.
252  const TChain_id& GetChain_id(void) const;
253 
254  /// Assign a value to Chain_id data member.
255  ///
256  /// @param value
257  /// Value to assign
258  void SetChain_id(const TChain_id& value);
259  void SetChain_id(TChain_id&& value);
260 
261  /// Assign a value to Chain_id data member.
262  ///
263  /// @return
264  /// Reference to the data value.
265  TChain_id& SetChain_id(void);
266 
267  /// Reset the whole object
268  virtual void Reset(void);
269 
270 
271 private:
272  // Prohibit copy constructor and assignment operator
275 
276  // data
277  Uint4 m_set_State[1];
279  int m_Chain;
281  string m_Chain_id;
282 };
283 
284 /* @} */
285 
286 
287 
288 
289 
290 ///////////////////////////////////////////////////////////
291 ///////////////////// inline methods //////////////////////
292 ///////////////////////////////////////////////////////////
293 inline
295 {
296  return ((m_set_State[0] & 0x3) != 0);
297 }
298 
299 inline
301 {
302  return IsSetMol();
303 }
304 
305 inline
307 {
308  if (!CanGetMol()) {
309  ThrowUnassigned(0);
310  }
311  return m_Mol;
312 }
313 
314 inline
316 {
317  m_Mol = value;
318  m_set_State[0] |= 0x3;
319 }
320 
321 inline
323 {
324  m_set_State[0] |= 0x1;
325  return m_Mol;
326 }
327 
328 inline
330 {
331  return ((m_set_State[0] & 0xc) != 0);
332 }
333 
334 inline
336 {
337  return true;
338 }
339 
340 inline
342 {
343  m_Chain = 32;
344  m_set_State[0] &= ~0xc;
345 }
346 
347 inline
349 {
350  ResetChain();
351 }
352 
353 inline
355 {
356  return m_Chain;
357 }
358 
359 inline
361 {
362  m_Chain = value;
363  m_set_State[0] |= 0xc;
364 }
365 
366 inline
368 {
369 #ifdef _DEBUG
370  if (!IsSetChain()) {
371  memset(&m_Chain,UnassignedByte(),sizeof(m_Chain));
372  }
373 #endif
374  m_set_State[0] |= 0x4;
375  return m_Chain;
376 }
377 
378 inline
380 {
381  return m_Rel.NotEmpty();
382 }
383 
384 inline
386 {
387  return IsSetRel();
388 }
389 
390 inline
392 {
393  if (!CanGetRel()) {
394  ThrowUnassigned(2);
395  }
396  return (*m_Rel);
397 }
398 
399 inline
401 {
402  return ((m_set_State[0] & 0xc0) != 0);
403 }
404 
405 inline
407 {
408  return IsSetChain_id();
409 }
410 
411 inline
413 {
414  if (!CanGetChain_id()) {
415  ThrowUnassigned(3);
416  }
417  return m_Chain_id;
418 }
419 
420 inline
422 {
423  m_Chain_id = value;
424  m_set_State[0] |= 0xc0;
425 }
426 
427 inline
429 {
430  m_Chain_id = std::forward<CPDB_seq_id_Base::TChain_id>(value);
431  m_set_State[0] |= 0xc0;
432 }
433 
434 inline
436 {
437 #ifdef _DEBUG
438  if (!IsSetChain_id()) {
440  }
441 #endif
442  m_set_State[0] |= 0x40;
443  return m_Chain_id;
444 }
445 
446 ///////////////////////////////////////////////////////////
447 ////////////////// end of inline methods //////////////////
448 ///////////////////////////////////////////////////////////
449 
450 
451 
452 
453 
454 END_objects_SCOPE // namespace ncbi::objects::
455 
457 
458 
459 #endif // OBJECTS_SEQLOC_PDB_SEQ_ID_BASE_HPP
User-defined methods of the data storage class.
Definition: Date.hpp:53
CPDB_mol_id –.
Definition: PDB_mol_id.hpp:66
CPDB_seq_id_Base –.
Definition: PDB_seq_id_.hpp:79
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
static string UnassignedString(void)
Definition: serialbase.hpp:175
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_SEQLOC_EXPORT
Definition: ncbi_export.h:776
TChain GetChain(void) const
Get the Chain member data.
bool IsSetChain_id(void) const
chain identifier; length-independent generalization of 'chain' Check if a value has been assigned to ...
bool IsSetChain(void) const
Deprecated: 'chain' can't support multiple character PDB chain identifiers (introduced in 2015).
TMol & SetMol(void)
Assign a value to Mol data member.
CPDB_seq_id_Base & operator=(const CPDB_seq_id_Base &)
bool CanGetChain_id(void) const
Check if it is safe to call GetChain_id method.
TChain_id & SetChain_id(void)
Assign a value to Chain_id data member.
void SetDefaultChain(void)
Assign default value to Chain data member.
TChain & SetChain(void)
Assign a value to Chain data member.
bool CanGetMol(void) const
Check if it is safe to call GetMol method.
Uint4 m_set_State[1]
bool IsSetRel(void) const
release date, month and year Check if a value has been assigned to Rel data member.
const TMol & GetMol(void) const
Get the Mol member data.
bool CanGetRel(void) const
Check if it is safe to call GetRel method.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
bool IsSetMol(void) const
the molecule name Check if a value has been assigned to Mol data member.
CSerialObject Tparent
Definition: PDB_seq_id_.hpp:80
CPDB_seq_id_Base(const CPDB_seq_id_Base &)
CPDB_mol_id TMol
Definition: PDB_seq_id_.hpp:91
const TChain_id & GetChain_id(void) const
Get the Chain_id member data.
void ResetChain(void)
Reset Chain data member.
CPDB_mol_id m_Mol
CRef< TRel > m_Rel
const TRel & GetRel(void) const
Get the Rel member data.
bool CanGetChain(void) const
Check if it is safe to call GetChain method.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Mon May 13 04:35:44 2024 by modify_doxy.py rev. 669887