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

Go to the SVN repository for this file.

1 /* $Id: Pub.hpp 65305 2014-11-20 13:44:46Z bollin $
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,
73  ELabelType type = eContent,
74  TLabelFlags flags = 0,
75  ELabelVersion version = eLabel_DefaultVersion) const;
76 
77  bool GetLabel(string* label,
78  ELabelType type,
79  bool unique = false) const;
80 
81  bool GetLabel(string* label, TLabelFlags flags = 0,
82  ELabelVersion version = eLabel_DefaultVersion) const;
83 
84  // convenience functions to get author list from underlying pub
85  bool IsSetAuthors(void) const;
86  const CAuth_list& GetAuthors(void) const;
87 
89  typedef vector<TOneTitleRef> TOneTitleRefVec;
90 
91  /// This gets the titles on the CPub.
92  /// @param out_titles
93  /// Each title found will be appended to this.
94  /// Titles of plain strings will be given as
95  /// type CTitle::C_E::e_Name, and complex titles will be
96  /// a const reference to the title inside the CPub, so they
97  /// might change if the CPub is changed.
98  /// @param iMaxToGet
99  /// The maximum number of titles to append to out_title
100  void GetTitles(
101  TOneTitleRefVec & out_title,
102  size_t iMaxToGet = std::numeric_limits<std::size_t>::max() ) const;
103 
104  bool SameCitation(const CPub& other) const;
105 
106 protected:
107 
108  private:
109  // Prohibit copy constructor and assignment operator
110  CPub(const CPub& value);
111  CPub& operator=(const CPub& value);
112 
113  static TOneTitleRef xs_GetTitleFromPlainString(const string & sTitle);
114 
115  // append CTitle::C_E objects from in_title to out_title,
116  // (Don't append more than iMaxToGet objects)
117  static void xs_AppendTitles( TOneTitleRefVec & out_title,
118  size_t iMaxToGet,
119  const CTitle & in_title );
120 
121 };
122 
123 
124 
125 /////////////////// CPub inline methods
126 
127 // constructor
128 inline
130 {
131 }
132 
133 inline
134 bool CPub::GetLabel(string* label, ELabelType type, bool unique) const
135 {
136  return GetLabel(label, type, unique ? fLabel_Unique : 0);
137 }
138 
139 inline
140 bool CPub::GetLabel(string* label, TLabelFlags flags, ELabelVersion version)
141  const
142 {
143  return GetLabel(label, eContent, flags, version);
144 }
145 
146 
147 /////////////////// end of CPub inline methods
148 
149 
150 END_objects_SCOPE // namespace ncbi::objects::
151 
153 
154 
155 #endif // OBJECTS_PUB_PUB_HPP
156 /* Original file checksum: lines: 90, chars: 2283, CRC32: 573f38c8 */
CConstRef –.
Definition: ncbiobj.hpp:1159
CConstRef< CTitle::C_E > TOneTitleRef
Definition: Pub.hpp:88
const string version
version string
Definition: variables.hpp:66
Definition: Pub.hpp:55
Definition: Title.hpp:50
Both preliminary and traceback stages.
Definition: blast_def.h:332
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:101
Data storage class.
string GetLabel(const CSeq_id &id)
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
Append a unique tag [V1].
Basic citation GetLabel interface, suitable both for actual citation objects such as CCit_* and conta...
CPub_Base Tparent
Definition: Pub.hpp:57
CPub_Base –.
Definition: Pub_.hpp:86
T max(T x_, T y_)
vector< TOneTitleRef > TOneTitleRefVec
Definition: Pub.hpp:89
ELabelType
For compatibility with legacy code.
Definition: feature.hpp:84
CPub_Base & operator=(const CPub_Base &)
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1185
#define NCBI_PUB_EXPORT
Definition: ncbi_export.h:727
ELabelType
Definition: Pub.hpp:64
.hpp User-defined methods of the data storage class.
Definition: Auth_list.hpp:55
CPub(void)
Definition: Pub.hpp:129
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:98
"Mix-in" interfaces to implement GetLabel for CCit_* et al.
int TLabelFlags
binary OR of ELabelFlags
Modified on Tue Jul 07 15:20:16 2015 by modify_doxy.py rev. 426318