NCBI C++ ToolKit
Pubmed_entry_.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 Pubmed_entry_.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/pubmed/pubmed.asn">pubmed.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/pubmed/pubmed.def">pubmed.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_PUBMED_PUBMED_ENTRY_BASE_HPP
42 #define OBJECTS_PUBMED_PUBMED_ENTRY_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 CMedline_entry;
63 class CPubmed_url;
64 
65 
66 // generated classes
67 
68 
69 /** @addtogroup dataspec_NCBI_PubMed
70  *
71  * @{
72  */
73 
74 /////////////////////////////////////////////////////////////////////////////
75 /// a PubMed entry
76 /// PUBMED records must include the PubMedId
77 ///
78 /// CPubmed_entry_Base --
79 ///
80 
82 {
84 public:
85  // constructor
86  CPubmed_entry_Base(void);
87  // destructor
88  virtual ~CPubmed_entry_Base(void);
89 
90  // type info
92 
93  // types
94  typedef CPubMedId TPmid;
96  typedef string TPublisher;
97  typedef list< CRef< CPubmed_url > > TUrls;
98  typedef string TPubid;
99 
100  // member index
101  enum class E_memberIndex {
102  e__allMandatory = 0,
103  e_pmid,
104  e_medent,
105  e_publisher,
106  e_urls,
107  e_pubid
108  };
110 
111  // getters
112  // setters
113 
114  /// Check if a value has been assigned to Pmid data member.
115  ///
116  /// Data member Pmid is mandatory;
117  /// its type is defined as 'typedef CPubMedId TPmid'
118  /// @return
119  /// - true, if a value has been assigned.
120  /// - false, otherwise.
121  bool IsSetPmid(void) const;
122 
123  /// Check if it is safe to call GetPmid method.
124  ///
125  /// @return
126  /// - true, if the data member is getatable.
127  /// - false, otherwise.
128  bool CanGetPmid(void) const;
129 
130  /// Reset Pmid data member.
131  void ResetPmid(void);
132 
133  /// Get the Pmid member data.
134  ///
135  /// @return
136  /// Reference to the member data.
137  const TPmid& GetPmid(void) const;
138 
139  /// Assign a value to Pmid data member.
140  ///
141  /// @param value
142  /// Value to assign
143  void SetPmid(const TPmid& value);
144 
145  /// Assign a value to Pmid data member.
146  ///
147  /// @return
148  /// Reference to the data value.
149  TPmid& SetPmid(void);
150 
151  /// Medline entry information
152  /// Check if a value has been assigned to Medent data member.
153  ///
154  /// Data member Medent is optional;
155  /// its type is defined as 'typedef CMedline_entry TMedent'
156  /// @return
157  /// - true, if a value has been assigned.
158  /// - false, otherwise.
159  bool IsSetMedent(void) const;
160 
161  /// Check if it is safe to call GetMedent method.
162  ///
163  /// @return
164  /// - true, if the data member is getatable.
165  /// - false, otherwise.
166  bool CanGetMedent(void) const;
167 
168  /// Reset Medent data member.
169  void ResetMedent(void);
170 
171  /// Get the Medent member data.
172  ///
173  /// @return
174  /// Reference to the member data.
175  const TMedent& GetMedent(void) const;
176 
177  /// Assign a value to Medent data member.
178  ///
179  /// @param value
180  /// Reference to value.
181  void SetMedent(TMedent& value);
182 
183  /// Assign a value to Medent data member.
184  ///
185  /// @return
186  /// Reference to the data value.
187  TMedent& SetMedent(void);
188 
189  /// Publisher name
190  /// Check if a value has been assigned to Publisher data member.
191  ///
192  /// Data member Publisher is optional;
193  /// its type is defined as 'typedef string TPublisher'
194  /// @return
195  /// - true, if a value has been assigned.
196  /// - false, otherwise.
197  bool IsSetPublisher(void) const;
198 
199  /// Check if it is safe to call GetPublisher method.
200  ///
201  /// @return
202  /// - true, if the data member is getatable.
203  /// - false, otherwise.
204  bool CanGetPublisher(void) const;
205 
206  /// Reset Publisher data member.
207  void ResetPublisher(void);
208 
209  /// Get the Publisher member data.
210  ///
211  /// @return
212  /// Reference to the member data.
213  const TPublisher& GetPublisher(void) const;
214 
215  /// Assign a value to Publisher data member.
216  ///
217  /// @param value
218  /// Value to assign
219  void SetPublisher(const TPublisher& value);
220  void SetPublisher(TPublisher&& value);
221 
222  /// Assign a value to Publisher data member.
223  ///
224  /// @return
225  /// Reference to the data value.
226  TPublisher& SetPublisher(void);
227 
228  /// List of URL to publisher cite
229  /// Check if a value has been assigned to Urls data member.
230  ///
231  /// Data member Urls is optional;
232  /// its type is defined as 'typedef list< CRef< CPubmed_url > > TUrls'
233  /// @return
234  /// - true, if a value has been assigned.
235  /// - false, otherwise.
236  bool IsSetUrls(void) const;
237 
238  /// Check if it is safe to call GetUrls method.
239  ///
240  /// @return
241  /// - true, if the data member is getatable.
242  /// - false, otherwise.
243  bool CanGetUrls(void) const;
244 
245  /// Reset Urls data member.
246  void ResetUrls(void);
247 
248  /// Get the Urls member data.
249  ///
250  /// @return
251  /// Reference to the member data.
252  const TUrls& GetUrls(void) const;
253 
254  /// Assign a value to Urls data member.
255  ///
256  /// @return
257  /// Reference to the data value.
258  TUrls& SetUrls(void);
259 
260  /// Publisher's article identifier
261  /// Check if a value has been assigned to Pubid data member.
262  ///
263  /// Data member Pubid is optional;
264  /// its type is defined as 'typedef string TPubid'
265  /// @return
266  /// - true, if a value has been assigned.
267  /// - false, otherwise.
268  bool IsSetPubid(void) const;
269 
270  /// Check if it is safe to call GetPubid method.
271  ///
272  /// @return
273  /// - true, if the data member is getatable.
274  /// - false, otherwise.
275  bool CanGetPubid(void) const;
276 
277  /// Reset Pubid data member.
278  void ResetPubid(void);
279 
280  /// Get the Pubid member data.
281  ///
282  /// @return
283  /// Reference to the member data.
284  const TPubid& GetPubid(void) const;
285 
286  /// Assign a value to Pubid data member.
287  ///
288  /// @param value
289  /// Value to assign
290  void SetPubid(const TPubid& value);
291  void SetPubid(TPubid&& value);
292 
293  /// Assign a value to Pubid data member.
294  ///
295  /// @return
296  /// Reference to the data value.
297  TPubid& SetPubid(void);
298 
299  /// Reset the whole object
300  virtual void Reset(void);
301 
302 
303 private:
304  // Prohibit copy constructor and assignment operator
307 
308  // data
309  Uint4 m_set_State[1];
312  string m_Publisher;
313  list< CRef< CPubmed_url > > m_Urls;
314  string m_Pubid;
315 };
316 
317 /* @} */
318 
319 
320 
321 
322 
323 ///////////////////////////////////////////////////////////
324 ///////////////////// inline methods //////////////////////
325 ///////////////////////////////////////////////////////////
326 inline
328 {
329  return ((m_set_State[0] & 0x3) != 0);
330 }
331 
332 inline
334 {
335  return IsSetPmid();
336 }
337 
338 inline
340 {
341  m_Pmid = CPubMedId(0);
342  m_set_State[0] &= ~0x3;
343 }
344 
345 inline
347 {
348  if (!CanGetPmid()) {
349  ThrowUnassigned(0);
350  }
351  return m_Pmid;
352 }
353 
354 inline
356 {
357  m_Pmid = value;
358  m_set_State[0] |= 0x3;
359 }
360 
361 inline
363 {
364  m_set_State[0] |= 0x1;
365  return m_Pmid;
366 }
367 
368 inline
370 {
371  return m_Medent.NotEmpty();
372 }
373 
374 inline
376 {
377  return IsSetMedent();
378 }
379 
380 inline
382 {
383  if (!CanGetMedent()) {
384  ThrowUnassigned(1);
385  }
386  return (*m_Medent);
387 }
388 
389 inline
391 {
392  return ((m_set_State[0] & 0x30) != 0);
393 }
394 
395 inline
397 {
398  return IsSetPublisher();
399 }
400 
401 inline
403 {
404  if (!CanGetPublisher()) {
405  ThrowUnassigned(2);
406  }
407  return m_Publisher;
408 }
409 
410 inline
412 {
413  m_Publisher = value;
414  m_set_State[0] |= 0x30;
415 }
416 
417 inline
419 {
420  m_Publisher = std::forward<CPubmed_entry_Base::TPublisher>(value);
421  m_set_State[0] |= 0x30;
422 }
423 
424 inline
426 {
427 #ifdef _DEBUG
428  if (!IsSetPublisher()) {
430  }
431 #endif
432  m_set_State[0] |= 0x10;
433  return m_Publisher;
434 }
435 
436 inline
438 {
439  return ((m_set_State[0] & 0xc0) != 0);
440 }
441 
442 inline
444 {
445  return true;
446 }
447 
448 inline
450 {
451  return m_Urls;
452 }
453 
454 inline
456 {
457  m_set_State[0] |= 0x40;
458  return m_Urls;
459 }
460 
461 inline
463 {
464  return ((m_set_State[0] & 0x300) != 0);
465 }
466 
467 inline
469 {
470  return IsSetPubid();
471 }
472 
473 inline
475 {
476  if (!CanGetPubid()) {
477  ThrowUnassigned(4);
478  }
479  return m_Pubid;
480 }
481 
482 inline
484 {
485  m_Pubid = value;
486  m_set_State[0] |= 0x300;
487 }
488 
489 inline
491 {
492  m_Pubid = std::forward<CPubmed_entry_Base::TPubid>(value);
493  m_set_State[0] |= 0x300;
494 }
495 
496 inline
498 {
499 #ifdef _DEBUG
500  if (!IsSetPubid()) {
502  }
503 #endif
504  m_set_State[0] |= 0x100;
505  return m_Pubid;
506 }
507 
508 ///////////////////////////////////////////////////////////
509 ////////////////// end of inline methods //////////////////
510 ///////////////////////////////////////////////////////////
511 
512 
513 
514 
515 
516 END_objects_SCOPE // namespace ncbi::objects::
517 
519 
520 
521 #endif // OBJECTS_PUBMED_PUBMED_ENTRY_BASE_HPP
User-defined methods of the data storage class.
a PubMed entry PUBMED records must include the PubMedId
CPubmed_url –.
Definition: Pubmed_url.hpp:66
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
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_PUBMED_EXPORT
Definition: ncbi_export.h:712
bool IsSetPubid(void) const
Publisher's article identifier Check if a value has been assigned to Pubid data member.
bool CanGetPublisher(void) const
Check if it is safe to call GetPublisher method.
list< CRef< CPubmed_url > > TUrls
bool IsSetMedent(void) const
Medline entry information Check if a value has been assigned to Medent data member.
TPubid & SetPubid(void)
Assign a value to Pubid data member.
const TMedent & GetMedent(void) const
Get the Medent member data.
TUrls & SetUrls(void)
Assign a value to Urls data member.
bool IsSetPublisher(void) const
Publisher name Check if a value has been assigned to Publisher data member.
CPubmed_entry_Base & operator=(const CPubmed_entry_Base &)
CMedline_entry TMedent
const TUrls & GetUrls(void) const
Get the Urls member data.
bool CanGetPmid(void) const
Check if it is safe to call GetPmid method.
list< CRef< CPubmed_url > > m_Urls
bool CanGetMedent(void) const
Check if it is safe to call GetMedent method.
void ResetPmid(void)
Reset Pmid data member.
bool CanGetPubid(void) const
Check if it is safe to call GetPubid method.
const TPublisher & GetPublisher(void) const
Get the Publisher member data.
Tparent::CMemberIndex< E_memberIndex, 6 > TmemberIndex
bool IsSetPmid(void) const
Check if a value has been assigned to Pmid data member.
CSerialObject Tparent
bool CanGetUrls(void) const
Check if it is safe to call GetUrls method.
const TPmid & GetPmid(void) const
Get the Pmid member data.
CPubmed_entry_Base(const CPubmed_entry_Base &)
const TPubid & GetPubid(void) const
Get the Pubid member data.
TPublisher & SetPublisher(void)
Assign a value to Publisher data member.
TPmid & SetPmid(void)
Assign a value to Pmid data member.
CRef< TMedent > m_Medent
bool IsSetUrls(void) const
List of URL to publisher cite Check if a value has been assigned to Urls data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sat Jun 15 11:55:04 2024 by modify_doxy.py rev. 669887