NCBI C++ ToolKit
Cit_let_.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 Cit_let_.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/biblio/biblio.asn">biblio.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/biblio/biblio.def">biblio.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_BIBLIO_CIT_LET_BASE_HPP
42 #define OBJECTS_BIBLIO_CIT_LET_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
49 
51 
52 #ifndef BEGIN_objects_SCOPE
53 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
54 # define END_objects_SCOPE END_SCOPE(objects)
55 #endif
56 BEGIN_objects_SCOPE // namespace ncbi::objects::
57 
58 
59 // forward declarations
60 class CCit_book;
61 
62 
63 // generated classes
64 
65 
66 /** @addtogroup dataspec_NCBI_Biblio
67  *
68  * @{
69  */
70 
71 /////////////////////////////////////////////////////////////////////////////
72 /// letter, thesis, or manuscript
73 ///
74 /// CCit_let_Base --
75 ///
76 
78 {
80 public:
81  // constructor
82  CCit_let_Base(void);
83  // destructor
84  virtual ~CCit_let_Base(void);
85 
86  // type info
88 
89  enum EType {
90  eType_manuscript = 1,
91  eType_letter = 2,
92  eType_thesis = 3
93  };
94 
95  /// Access to EType's attributes (values, names) as defined in spec
96  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EType)(void);
97 
98  // types
99  typedef CCit_book TCit;
100  typedef string TMan_id;
101  typedef EType TType;
102 
103  // member index
104  enum class E_memberIndex {
105  e__allMandatory = 0,
106  e_cit,
107  e_man_id,
108  e_type
109  };
111 
112  // getters
113  // setters
114 
115  /// same fields as a book
116  /// Check if a value has been assigned to Cit data member.
117  ///
118  /// Data member Cit is mandatory;
119  /// its type is defined as 'typedef CCit_book TCit'
120  /// @return
121  /// - true, if a value has been assigned.
122  /// - false, otherwise.
123  bool IsSetCit(void) const;
124 
125  /// Check if it is safe to call GetCit method.
126  ///
127  /// @return
128  /// - true, if the data member is getatable.
129  /// - false, otherwise.
130  bool CanGetCit(void) const;
131 
132  /// Reset Cit data member.
133  void ResetCit(void);
134 
135  /// Get the Cit member data.
136  ///
137  /// @return
138  /// Reference to the member data.
139  const TCit& GetCit(void) const;
140 
141  /// Assign a value to Cit data member.
142  ///
143  /// @param value
144  /// Reference to value.
145  void SetCit(TCit& value);
146 
147  /// Assign a value to Cit data member.
148  ///
149  /// @return
150  /// Reference to the data value.
151  TCit& SetCit(void);
152 
153  /// Manuscript identifier
154  /// Check if a value has been assigned to Man_id data member.
155  ///
156  /// Data member Man_id is optional;
157  /// its type is defined as 'typedef string TMan_id'
158  /// @return
159  /// - true, if a value has been assigned.
160  /// - false, otherwise.
161  bool IsSetMan_id(void) const;
162 
163  /// Check if it is safe to call GetMan_id method.
164  ///
165  /// @return
166  /// - true, if the data member is getatable.
167  /// - false, otherwise.
168  bool CanGetMan_id(void) const;
169 
170  /// Reset Man_id data member.
171  void ResetMan_id(void);
172 
173  /// Get the Man_id member data.
174  ///
175  /// @return
176  /// Reference to the member data.
177  const TMan_id& GetMan_id(void) const;
178 
179  /// Assign a value to Man_id data member.
180  ///
181  /// @param value
182  /// Value to assign
183  void SetMan_id(const TMan_id& value);
184  void SetMan_id(TMan_id&& value);
185 
186  /// Assign a value to Man_id data member.
187  ///
188  /// @return
189  /// Reference to the data value.
190  TMan_id& SetMan_id(void);
191 
192  /// Check if a value has been assigned to Type data member.
193  ///
194  /// Data member Type is optional;
195  /// its type is defined as 'typedef EType TType'
196  /// @return
197  /// - true, if a value has been assigned.
198  /// - false, otherwise.
199  bool IsSetType(void) const;
200 
201  /// Check if it is safe to call GetType method.
202  ///
203  /// @return
204  /// - true, if the data member is getatable.
205  /// - false, otherwise.
206  bool CanGetType(void) const;
207 
208  /// Reset Type data member.
209  void ResetType(void);
210 
211  /// Get the Type member data.
212  ///
213  /// @return
214  /// Copy of the member data.
215  TType GetType(void) const;
216 
217  /// Assign a value to Type data member.
218  ///
219  /// @param value
220  /// Value to assign
221  void SetType(TType value);
222 
223  /// Assign a value to Type data member.
224  ///
225  /// @return
226  /// Reference to the data value.
227  TType& SetType(void);
228 
229  /// Reset the whole object
230  virtual void Reset(void);
231 
232 
233 private:
234  // Prohibit copy constructor and assignment operator
237 
238  // data
239  Uint4 m_set_State[1];
241  string m_Man_id;
243 };
244 
245 /* @} */
246 
247 
248 
249 
250 
251 ///////////////////////////////////////////////////////////
252 ///////////////////// inline methods //////////////////////
253 ///////////////////////////////////////////////////////////
254 inline
255 bool CCit_let_Base::IsSetCit(void) const
256 {
257  return m_Cit.NotEmpty();
258 }
259 
260 inline
261 bool CCit_let_Base::CanGetCit(void) const
262 {
263  return true;
264 }
265 
266 inline
268 {
269  if ( !m_Cit ) {
270  const_cast<CCit_let_Base*>(this)->ResetCit();
271  }
272  return (*m_Cit);
273 }
274 
275 inline
277 {
278  if ( !m_Cit ) {
279  ResetCit();
280  }
281  return (*m_Cit);
282 }
283 
284 inline
286 {
287  return ((m_set_State[0] & 0xc) != 0);
288 }
289 
290 inline
292 {
293  return IsSetMan_id();
294 }
295 
296 inline
298 {
299  if (!CanGetMan_id()) {
300  ThrowUnassigned(1);
301  }
302  return m_Man_id;
303 }
304 
305 inline
307 {
308  m_Man_id = value;
309  m_set_State[0] |= 0xc;
310 }
311 
312 inline
314 {
315  m_Man_id = std::forward<CCit_let_Base::TMan_id>(value);
316  m_set_State[0] |= 0xc;
317 }
318 
319 inline
321 {
322 #ifdef _DEBUG
323  if (!IsSetMan_id()) {
325  }
326 #endif
327  m_set_State[0] |= 0x4;
328  return m_Man_id;
329 }
330 
331 inline
332 bool CCit_let_Base::IsSetType(void) const
333 {
334  return ((m_set_State[0] & 0x30) != 0);
335 }
336 
337 inline
339 {
340  return IsSetType();
341 }
342 
343 inline
345 {
346  m_Type = (EType)(0);
347  m_set_State[0] &= ~0x30;
348 }
349 
350 inline
352 {
353  if (!CanGetType()) {
354  ThrowUnassigned(2);
355  }
356  return m_Type;
357 }
358 
359 inline
361 {
362  m_Type = value;
363  m_set_State[0] |= 0x30;
364 }
365 
366 inline
368 {
369 #ifdef _DEBUG
370  if (!IsSetType()) {
371  memset(&m_Type,UnassignedByte(),sizeof(m_Type));
372  }
373 #endif
374  m_set_State[0] |= 0x10;
375  return m_Type;
376 }
377 
378 ///////////////////////////////////////////////////////////
379 ////////////////// end of inline methods //////////////////
380 ///////////////////////////////////////////////////////////
381 
382 
383 
384 
385 
386 END_objects_SCOPE // namespace ncbi::objects::
387 
389 
390 
391 #endif // OBJECTS_BIBLIO_CIT_LET_BASE_HPP
letter, thesis, or manuscript
Definition: Cit_let_.hpp:78
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
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
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_BIBLIO_EXPORT
Definition: ncbi_export.h:312
TType & SetType(void)
Assign a value to Type data member.
Definition: Cit_let_.hpp:367
CCit_book TCit
Definition: Cit_let_.hpp:99
const TCit & GetCit(void) const
Get the Cit member data.
Definition: Cit_let_.hpp:267
CCit_let_Base & operator=(const CCit_let_Base &)
DECLARE_INTERNAL_TYPE_INFO()
string m_Man_id
Definition: Cit_let_.hpp:241
CRef< TCit > m_Cit
Definition: Cit_let_.hpp:240
bool CanGetType(void) const
Check if it is safe to call GetType method.
Definition: Cit_let_.hpp:338
CCit_let_Base(const CCit_let_Base &)
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
Definition: Cit_let_.hpp:110
Uint4 m_set_State[1]
Definition: Cit_let_.hpp:239
bool CanGetMan_id(void) const
Check if it is safe to call GetMan_id method.
Definition: Cit_let_.hpp:291
string TMan_id
Definition: Cit_let_.hpp:100
void ResetCit(void)
Reset Cit data member.
Definition: Cit_let_.cpp:61
TCit & SetCit(void)
Assign a value to Cit data member.
Definition: Cit_let_.hpp:276
bool CanGetCit(void) const
Check if it is safe to call GetCit method.
Definition: Cit_let_.hpp:261
CSerialObject Tparent
Definition: Cit_let_.hpp:79
TType GetType(void) const
Get the Type member data.
Definition: Cit_let_.hpp:351
bool IsSetCit(void) const
same fields as a book Check if a value has been assigned to Cit data member.
Definition: Cit_let_.hpp:255
TMan_id & SetMan_id(void)
Assign a value to Man_id data member.
Definition: Cit_let_.hpp:320
bool IsSetMan_id(void) const
Manuscript identifier Check if a value has been assigned to Man_id data member.
Definition: Cit_let_.hpp:285
const TMan_id & GetMan_id(void) const
Get the Man_id member data.
Definition: Cit_let_.hpp:297
bool IsSetType(void) const
Check if a value has been assigned to Type data member.
Definition: Cit_let_.hpp:332
void ResetType(void)
Reset Type data member.
Definition: Cit_let_.hpp:344
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sat Jul 13 13:41:17 2024 by modify_doxy.py rev. 669887