NCBI C++ ToolKit
Pub.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: Pub.hpp 95832 2022-01-04 15:26:51Z stakhovv $
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  * Author: .......
27  *
28  * File Description:
29  * .......
30  *
31  * Remark:
32  * This code was originally generated by application DATATOOL
33  * using specifications from the ASN data definition file
34  * 'pub.asn'.
35  */
36 
37 #ifndef OBJECTS_PUB_PUB_HPP
38 #define OBJECTS_PUB_PUB_HPP
39 
40 
41 // generated includes
42 #include <objects/pub/Pub_.hpp>
43 
45 #include <objects/biblio/Title.hpp>
46 
47 // generated classes
48 
50 
51 BEGIN_objects_SCOPE // namespace ncbi::objects::
52 
53 class CAuth_list;
54 
56 {
57  typedef CPub_Base Tparent;
58 public:
59  // constructor
60  CPub(void);
61  // destructor
62  ~CPub(void);
63 
64  enum ELabelType {
68 
69  /// Concatenate a label for this pub to label. If flags contains
70  /// fCitLabel_Unique, add a unique tag to the end of the
71  /// concatenated label.
72  bool GetLabel(string* label,
74  TLabelFlags flags = 0,
75  ELabelVersion version = eLabel_DefaultVersion) const;
76 
77  bool GetLabel(string* label,
79  bool unique = false) const;
80 
81  bool GetLabel(string* label, TLabelFlags flags = 0,
82  ELabelVersion version = eLabel_DefaultVersion) const override;
83 
84  // convenience functions to get author list from underlying pub
85  bool IsSetAuthors(void) const;
86  const CAuth_list& GetAuthors(void) const;
87  CAuth_list& SetAuthors(void);
88 
90  typedef vector<TOneTitleRef> TOneTitleRefVec;
91 
92  /// This gets the titles on the CPub.
93  /// @param out_titles
94  /// Each title found will be appended to this.
95  /// Titles of plain strings will be given as
96  /// type CTitle::C_E::e_Name, and complex titles will be
97  /// a const reference to the title inside the CPub, so they
98  /// might change if the CPub is changed.
99  /// @param iMaxToGet
100  /// The maximum number of titles to append to out_title
101  void GetTitles(
102  TOneTitleRefVec & out_title,
103  size_t iMaxToGet = std::numeric_limits<std::size_t>::max() ) const;
104 
105  bool SameCitation(const CPub& other) const;
106 
107 protected:
108 
109 private:
110  // Prohibit copy constructor and assignment operator
111  CPub(const CPub& value);
113 
114  static TOneTitleRef xs_GetTitleFromPlainString(const string & sTitle);
115 
116  // append CTitle::C_E objects from in_title to out_title,
117  // (Don't append more than iMaxToGet objects)
118  static void xs_AppendTitles( TOneTitleRefVec & out_title,
119  size_t iMaxToGet,
120  const CTitle & in_title );
121 
122 };
123 
124 
125 
126 /////////////////// CPub inline methods
127 
128 // constructor
129 inline
131 {
132 }
133 
134 inline
135 bool CPub::GetLabel(string* label, ELabelType type, bool unique) const
136 {
137  return GetLabel(label, type, unique ? fLabel_Unique : 0);
138 }
139 
140 inline
142  const
143 {
144  return GetLabel(label, eContent, flags, version);
145 }
146 
147 
148 /////////////////// end of CPub inline methods
149 
150 
151 END_objects_SCOPE // namespace ncbi::objects::
152 
154 
155 
156 #endif // OBJECTS_PUB_PUB_HPP
157 /* Original file checksum: lines: 90, chars: 2283, CRC32: 573f38c8 */
Data storage class.
@ eBoth
Both preliminary and traceback stages.
Definition: blast_def.h:332
"Mix-in" interfaces to implement GetLabel for CCit_* et al.
@Auth_list.hpp User-defined methods of the data storage class.
Definition: Auth_list.hpp:57
CConstRef –.
Definition: ncbiobj.hpp:1266
CPub_Base –.
Definition: Pub_.hpp:87
Definition: Pub.hpp:56
CPub(void)
Definition: Pub.hpp:130
vector< TOneTitleRef > TOneTitleRefVec
Definition: Pub.hpp:90
ELabelType
Definition: Pub.hpp:64
@ eContent
Definition: Pub.hpp:66
@ eType
Definition: Pub.hpp:65
bool GetLabel(string *label, ELabelType type=eContent, TLabelFlags flags=0, ELabelVersion version=eLabel_DefaultVersion) const
Concatenate a label for this pub to label.
Definition: Pub.cpp:76
CPub_Base Tparent
Definition: Pub.hpp:57
CPub & operator=(const CPub &value)
CPub(const CPub &value)
CConstRef< CTitle::C_E > TOneTitleRef
Definition: Pub.hpp:89
Definition: Title.hpp:51
Basic citation GetLabel interface, suitable both for actual citation objects such as CCit_* and conta...
int TLabelFlags
binary OR of ELabelFlags
@ fLabel_Unique
Append a unique tag [V1].
static uch flags
string GetLabel(const CSeq_id &id)
ELabelType
For compatibility with legacy code.
Definition: feature.hpp:85
@ eContent
Definition: feature.hpp:87
#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_PUB_EXPORT
Definition: ncbi_export.h:720
static const char label[]
static int version
Definition: mdb_load.c:29
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
T max(T x_, T y_)
Definition: type.c:6
Modified on Tue May 21 10:56:11 2024 by modify_doxy.py rev. 669887