NCBI C++ ToolKit
FolderInfo_.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 FolderInfo_.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/gbproj/gbproj.asn">gbproj.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/gbproj/gbproj.def">gbproj.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_GBPROJ_FOLDERINFO_BASE_HPP
42 #define OBJECTS_GBPROJ_FOLDERINFO_BASE_HPP
43 
44 // extra headers
46 
47 // standard includes
48 #include <serial/serialbase.hpp>
49 
50 // generated includes
51 #include <list>
52 #include <string>
53 
55 
56 #ifndef BEGIN_objects_SCOPE
57 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
58 # define END_objects_SCOPE END_SCOPE(objects)
59 #endif
60 BEGIN_objects_SCOPE // namespace ncbi::objects::
61 
62 
63 // forward declarations
64 class CAnnotdesc;
65 class CDate;
66 
67 
68 // generated classes
69 
70 
71 /** @addtogroup dataspec_NCBI_GBProject
72  *
73  * @{
74  */
75 
76 /////////////////////////////////////////////////////////////////////////////
77 ///
78 /// CFolderInfo_Base --
79 ///
80 
82 {
84 public:
85  // constructor
86  CFolderInfo_Base(void);
87  // destructor
88  virtual ~CFolderInfo_Base(void);
89 
90  // type info
92 
93  // types
94  typedef string TTitle;
96  typedef string TComment;
97  typedef bool TOpen;
98  typedef list< CRef< CAnnotdesc > > TAnnot;
99 
100  // member index
101  enum class E_memberIndex {
102  e__allMandatory = 0,
103  e_title,
104  e_create_date,
105  e_comment,
106  e_open,
107  e_annot
108  };
110 
111  // getters
112  // setters
113 
114  /// Check if a value has been assigned to Title data member.
115  ///
116  /// Data member Title is mandatory;
117  /// its type is defined as 'typedef string TTitle'
118  /// @return
119  /// - true, if a value has been assigned.
120  /// - false, otherwise.
121  bool IsSetTitle(void) const;
122 
123  /// Check if it is safe to call GetTitle method.
124  ///
125  /// @return
126  /// - true, if the data member is getatable.
127  /// - false, otherwise.
128  bool CanGetTitle(void) const;
129 
130  /// Reset Title data member.
131  void ResetTitle(void);
132 
133  /// Get the Title member data.
134  ///
135  /// @return
136  /// Reference to the member data.
137  const TTitle& GetTitle(void) const;
138 
139  /// Assign a value to Title data member.
140  ///
141  /// @param value
142  /// Value to assign
143  void SetTitle(const TTitle& value);
144  void SetTitle(TTitle&& value);
145 
146  /// Assign a value to Title data member.
147  ///
148  /// @return
149  /// Reference to the data value.
150  TTitle& SetTitle(void);
151 
152  /// basic descriptors
153  /// Check if a value has been assigned to Create_date data member.
154  ///
155  /// Data member Create_date is mandatory;
156  /// its type is defined as 'typedef CDate TCreate_date'
157  /// @return
158  /// - true, if a value has been assigned.
159  /// - false, otherwise.
160  bool IsSetCreate_date(void) const;
161 
162  /// Check if it is safe to call GetCreate_date method.
163  ///
164  /// @return
165  /// - true, if the data member is getatable.
166  /// - false, otherwise.
167  bool CanGetCreate_date(void) const;
168 
169  /// Reset Create_date data member.
170  void ResetCreate_date(void);
171 
172  /// Get the Create_date member data.
173  ///
174  /// @return
175  /// Reference to the member data.
176  const TCreate_date& GetCreate_date(void) const;
177 
178  /// Assign a value to Create_date data member.
179  ///
180  /// @param value
181  /// Reference to value.
182  void SetCreate_date(TCreate_date& value);
183 
184  /// Assign a value to Create_date data member.
185  ///
186  /// @return
187  /// Reference to the data value.
188  TCreate_date& SetCreate_date(void);
189 
190  /// optional comments
191  /// Check if a value has been assigned to Comment data member.
192  ///
193  /// Data member Comment is optional;
194  /// its type is defined as 'typedef string TComment'
195  /// @return
196  /// - true, if a value has been assigned.
197  /// - false, otherwise.
198  bool IsSetComment(void) const;
199 
200  /// Check if it is safe to call GetComment method.
201  ///
202  /// @return
203  /// - true, if the data member is getatable.
204  /// - false, otherwise.
205  bool CanGetComment(void) const;
206 
207  /// Reset Comment data member.
208  void ResetComment(void);
209 
210  /// Get the Comment member data.
211  ///
212  /// @return
213  /// Reference to the member data.
214  const TComment& GetComment(void) const;
215 
216  /// Assign a value to Comment data member.
217  ///
218  /// @param value
219  /// Value to assign
220  void SetComment(const TComment& value);
221  void SetComment(TComment&& value);
222 
223  /// Assign a value to Comment data member.
224  ///
225  /// @return
226  /// Reference to the data value.
227  TComment& SetComment(void);
228 
229  /// "folder open" state
230  /// Check if a value has been assigned to Open data member.
231  ///
232  /// Data member Open is optional;
233  /// its type is defined as 'typedef bool TOpen'
234  /// @return
235  /// - true, if a value has been assigned.
236  /// - false, otherwise.
237  bool IsSetOpen(void) const;
238 
239  /// Check if it is safe to call GetOpen method.
240  ///
241  /// @return
242  /// - true, if the data member is getatable.
243  /// - false, otherwise.
244  bool CanGetOpen(void) const;
245 
246  /// Reset Open data member.
247  void ResetOpen(void);
248 
249  /// Get the Open member data.
250  ///
251  /// @return
252  /// Copy of the member data.
253  TOpen GetOpen(void) const;
254 
255  /// Assign a value to Open data member.
256  ///
257  /// @param value
258  /// Value to assign
259  void SetOpen(TOpen value);
260 
261  /// Assign a value to Open data member.
262  ///
263  /// @return
264  /// Reference to the data value.
265  TOpen& SetOpen(void);
266 
267  /// arbitrary annotations
268  /// Check if a value has been assigned to Annot data member.
269  ///
270  /// Data member Annot is optional;
271  /// its type is defined as 'typedef list< CRef< CAnnotdesc > > TAnnot'
272  /// @return
273  /// - true, if a value has been assigned.
274  /// - false, otherwise.
275  bool IsSetAnnot(void) const;
276 
277  /// Check if it is safe to call GetAnnot method.
278  ///
279  /// @return
280  /// - true, if the data member is getatable.
281  /// - false, otherwise.
282  bool CanGetAnnot(void) const;
283 
284  /// Reset Annot data member.
285  void ResetAnnot(void);
286 
287  /// Get the Annot member data.
288  ///
289  /// @return
290  /// Reference to the member data.
291  const TAnnot& GetAnnot(void) const;
292 
293  /// Assign a value to Annot data member.
294  ///
295  /// @return
296  /// Reference to the data value.
297  TAnnot& SetAnnot(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];
310  string m_Title;
312  string m_Comment;
313  bool m_Open;
314  list< CRef< CAnnotdesc > > m_Annot;
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 IsSetTitle();
336 }
337 
338 inline
340 {
341  if (!CanGetTitle()) {
342  ThrowUnassigned(0);
343  }
344  return m_Title;
345 }
346 
347 inline
349 {
350  m_Title = value;
351  m_set_State[0] |= 0x3;
352 }
353 
354 inline
356 {
357  m_Title = std::forward<CFolderInfo_Base::TTitle>(value);
358  m_set_State[0] |= 0x3;
359 }
360 
361 inline
363 {
364 #ifdef _DEBUG
365  if (!IsSetTitle()) {
367  }
368 #endif
369  m_set_State[0] |= 0x1;
370  return m_Title;
371 }
372 
373 inline
375 {
376  return m_Create_date.NotEmpty();
377 }
378 
379 inline
381 {
382  return true;
383 }
384 
385 inline
387 {
388  if ( !m_Create_date ) {
389  const_cast<CFolderInfo_Base*>(this)->ResetCreate_date();
390  }
391  return (*m_Create_date);
392 }
393 
394 inline
396 {
397  if ( !m_Create_date ) {
399  }
400  return (*m_Create_date);
401 }
402 
403 inline
405 {
406  return ((m_set_State[0] & 0x30) != 0);
407 }
408 
409 inline
411 {
412  return IsSetComment();
413 }
414 
415 inline
417 {
418  if (!CanGetComment()) {
419  ThrowUnassigned(2);
420  }
421  return m_Comment;
422 }
423 
424 inline
426 {
427  m_Comment = value;
428  m_set_State[0] |= 0x30;
429 }
430 
431 inline
433 {
434  m_Comment = std::forward<CFolderInfo_Base::TComment>(value);
435  m_set_State[0] |= 0x30;
436 }
437 
438 inline
440 {
441 #ifdef _DEBUG
442  if (!IsSetComment()) {
444  }
445 #endif
446  m_set_State[0] |= 0x10;
447  return m_Comment;
448 }
449 
450 inline
452 {
453  return ((m_set_State[0] & 0xc0) != 0);
454 }
455 
456 inline
458 {
459  return IsSetOpen();
460 }
461 
462 inline
464 {
465  m_Open = 0;
466  m_set_State[0] &= ~0xc0;
467 }
468 
469 inline
471 {
472  if (!CanGetOpen()) {
473  ThrowUnassigned(3);
474  }
475  return m_Open;
476 }
477 
478 inline
480 {
481  m_Open = value;
482  m_set_State[0] |= 0xc0;
483 }
484 
485 inline
487 {
488 #ifdef _DEBUG
489  if (!IsSetOpen()) {
490  memset(&m_Open,UnassignedByte(),sizeof(m_Open));
491  }
492 #endif
493  m_set_State[0] |= 0x40;
494  return m_Open;
495 }
496 
497 inline
499 {
500  return ((m_set_State[0] & 0x300) != 0);
501 }
502 
503 inline
505 {
506  return true;
507 }
508 
509 inline
511 {
512  return m_Annot;
513 }
514 
515 inline
517 {
518  m_set_State[0] |= 0x100;
519  return m_Annot;
520 }
521 
522 ///////////////////////////////////////////////////////////
523 ////////////////// end of inline methods //////////////////
524 ///////////////////////////////////////////////////////////
525 
526 
527 
528 
529 
530 END_objects_SCOPE // namespace ncbi::objects::
531 
533 
534 
535 #endif // OBJECTS_GBPROJ_FOLDERINFO_BASE_HPP
CAnnotdesc –.
Definition: Annotdesc.hpp:66
Definition: Date.hpp:53
CFolderInfo_Base –.
Definition: FolderInfo_.hpp:82
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
Defines to provide correct exporting from DLLs in Windows.
#define NCBI_GBPROJ_EXPORT
Definition: gbproj_export.h:69
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
static string UnassignedString(void)
Definition: serialbase.hpp:175
NCBI_XOBJUTIL_EXPORT string GetTitle(const CBioseq_Handle &hnd, TGetTitleFlags flags=0)
Definition: seqtitle.cpp:106
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
void ResetOpen(void)
Reset Open data member.
list< CRef< CAnnotdesc > > m_Annot
const TAnnot & GetAnnot(void) const
Get the Annot member data.
const TCreate_date & GetCreate_date(void) const
Get the Create_date member data.
TCreate_date & SetCreate_date(void)
Assign a value to Create_date data member.
const TComment & GetComment(void) const
Get the Comment member data.
bool IsSetOpen(void) const
"folder open" state Check if a value has been assigned to Open data member.
list< CRef< CAnnotdesc > > TAnnot
Definition: FolderInfo_.hpp:98
TOpen & SetOpen(void)
Assign a value to Open data member.
CFolderInfo_Base & operator=(const CFolderInfo_Base &)
CFolderInfo_Base(const CFolderInfo_Base &)
TAnnot & SetAnnot(void)
Assign a value to Annot data member.
TTitle & SetTitle(void)
Assign a value to Title data member.
bool CanGetCreate_date(void) const
Check if it is safe to call GetCreate_date method.
TComment & SetComment(void)
Assign a value to Comment data member.
bool IsSetCreate_date(void) const
basic descriptors Check if a value has been assigned to Create_date data member.
const TTitle & GetTitle(void) const
Get the Title member data.
bool IsSetTitle(void) const
Check if a value has been assigned to Title data member.
bool CanGetComment(void) const
Check if it is safe to call GetComment method.
CRef< TCreate_date > m_Create_date
bool CanGetTitle(void) const
Check if it is safe to call GetTitle method.
Tparent::CMemberIndex< E_memberIndex, 6 > TmemberIndex
TOpen GetOpen(void) const
Get the Open member data.
void ResetCreate_date(void)
Reset Create_date data member.
Definition: FolderInfo_.cpp:58
bool IsSetAnnot(void) const
arbitrary annotations Check if a value has been assigned to Annot data member.
Uint4 m_set_State[1]
bool CanGetOpen(void) const
Check if it is safe to call GetOpen method.
bool IsSetComment(void) const
optional comments Check if a value has been assigned to Comment data member.
CSerialObject Tparent
Definition: FolderInfo_.hpp:83
bool CanGetAnnot(void) const
Check if it is safe to call GetAnnot method.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
static void SetTitle(CRef< CSeq_entry > entry, string title)
Modified on Mon May 20 05:05:24 2024 by modify_doxy.py rev. 669887