NCBI C++ ToolKit
ProjectDescr_.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 ProjectDescr_.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_PROJECTDESCR_BASE_HPP
42 #define OBJECTS_GBPROJ_PROJECTDESCR_BASE_HPP
43 
44 // extra headers
46 
47 // standard includes
48 #include <serial/serialbase.hpp>
49 
50 // generated includes
51 #include <string>
52 
54 
55 #ifndef BEGIN_objects_SCOPE
56 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
57 # define END_objects_SCOPE END_SCOPE(objects)
58 #endif
59 BEGIN_objects_SCOPE // namespace ncbi::objects::
60 
61 
62 // forward declarations
63 class CDate;
64 
65 
66 // generated classes
67 
68 
69 /** @addtogroup dataspec_NCBI_GBProject
70  *
71  * @{
72  */
73 
74 /////////////////////////////////////////////////////////////////////////////
75 ///
76 /// CProjectDescr_Base --
77 ///
78 
80 {
82 public:
83  // constructor
84  CProjectDescr_Base(void);
85  // destructor
86  virtual ~CProjectDescr_Base(void);
87 
88  // type info
90 
91  // types
92  typedef string TTitle;
95  typedef string TComment;
96 
97  // member index
98  enum class E_memberIndex {
99  e__allMandatory = 0,
100  e_title,
101  e_create_date,
102  e_modified_date,
103  e_comment
104  };
106 
107  // getters
108  // setters
109 
110  /// user-defined title for the workspace
111  /// Check if a value has been assigned to Title data member.
112  ///
113  /// Data member Title is mandatory;
114  /// its type is defined as 'typedef string TTitle'
115  /// @return
116  /// - true, if a value has been assigned.
117  /// - false, otherwise.
118  bool IsSetTitle(void) const;
119 
120  /// Check if it is safe to call GetTitle method.
121  ///
122  /// @return
123  /// - true, if the data member is getatable.
124  /// - false, otherwise.
125  bool CanGetTitle(void) const;
126 
127  /// Reset Title data member.
128  void ResetTitle(void);
129 
130  /// Get the Title member data.
131  ///
132  /// @return
133  /// Reference to the member data.
134  const TTitle& GetTitle(void) const;
135 
136  /// Assign a value to Title data member.
137  ///
138  /// @param value
139  /// Value to assign
140  void SetTitle(const TTitle& value);
141  void SetTitle(TTitle&& value);
142 
143  /// Assign a value to Title data member.
144  ///
145  /// @return
146  /// Reference to the data value.
147  TTitle& SetTitle(void);
148 
149  /// basic (required) descriptors
150  /// Check if a value has been assigned to Create_date data member.
151  ///
152  /// Data member Create_date is mandatory;
153  /// its type is defined as 'typedef CDate TCreate_date'
154  /// @return
155  /// - true, if a value has been assigned.
156  /// - false, otherwise.
157  bool IsSetCreate_date(void) const;
158 
159  /// Check if it is safe to call GetCreate_date method.
160  ///
161  /// @return
162  /// - true, if the data member is getatable.
163  /// - false, otherwise.
164  bool CanGetCreate_date(void) const;
165 
166  /// Reset Create_date data member.
167  void ResetCreate_date(void);
168 
169  /// Get the Create_date member data.
170  ///
171  /// @return
172  /// Reference to the member data.
173  const TCreate_date& GetCreate_date(void) const;
174 
175  /// Assign a value to Create_date data member.
176  ///
177  /// @param value
178  /// Reference to value.
179  void SetCreate_date(TCreate_date& value);
180 
181  /// Assign a value to Create_date data member.
182  ///
183  /// @return
184  /// Reference to the data value.
185  TCreate_date& SetCreate_date(void);
186 
187  /// Check if a value has been assigned to Modified_date data member.
188  ///
189  /// Data member Modified_date is optional;
190  /// its type is defined as 'typedef CDate TModified_date'
191  /// @return
192  /// - true, if a value has been assigned.
193  /// - false, otherwise.
194  bool IsSetModified_date(void) const;
195 
196  /// Check if it is safe to call GetModified_date method.
197  ///
198  /// @return
199  /// - true, if the data member is getatable.
200  /// - false, otherwise.
201  bool CanGetModified_date(void) const;
202 
203  /// Reset Modified_date data member.
204  void ResetModified_date(void);
205 
206  /// Get the Modified_date member data.
207  ///
208  /// @return
209  /// Reference to the member data.
210  const TModified_date& GetModified_date(void) const;
211 
212  /// Assign a value to Modified_date data member.
213  ///
214  /// @param value
215  /// Reference to value.
216  void SetModified_date(TModified_date& value);
217 
218  /// Assign a value to Modified_date data member.
219  ///
220  /// @return
221  /// Reference to the data value.
222  TModified_date& SetModified_date(void);
223 
224  /// optional descriptors
225  /// Check if a value has been assigned to Comment data member.
226  ///
227  /// Data member Comment is optional;
228  /// its type is defined as 'typedef string TComment'
229  /// @return
230  /// - true, if a value has been assigned.
231  /// - false, otherwise.
232  bool IsSetComment(void) const;
233 
234  /// Check if it is safe to call GetComment method.
235  ///
236  /// @return
237  /// - true, if the data member is getatable.
238  /// - false, otherwise.
239  bool CanGetComment(void) const;
240 
241  /// Reset Comment data member.
242  void ResetComment(void);
243 
244  /// Get the Comment member data.
245  ///
246  /// @return
247  /// Reference to the member data.
248  const TComment& GetComment(void) const;
249 
250  /// Assign a value to Comment data member.
251  ///
252  /// @param value
253  /// Value to assign
254  void SetComment(const TComment& value);
255  void SetComment(TComment&& value);
256 
257  /// Assign a value to Comment data member.
258  ///
259  /// @return
260  /// Reference to the data value.
261  TComment& SetComment(void);
262 
263  /// Reset the whole object
264  virtual void Reset(void);
265 
266 
267 private:
268  // Prohibit copy constructor and assignment operator
271 
272  // data
273  Uint4 m_set_State[1];
274  string m_Title;
277  string m_Comment;
278 };
279 
280 /* @} */
281 
282 
283 
284 
285 
286 ///////////////////////////////////////////////////////////
287 ///////////////////// inline methods //////////////////////
288 ///////////////////////////////////////////////////////////
289 inline
291 {
292  return ((m_set_State[0] & 0x3) != 0);
293 }
294 
295 inline
297 {
298  return IsSetTitle();
299 }
300 
301 inline
303 {
304  if (!CanGetTitle()) {
305  ThrowUnassigned(0);
306  }
307  return m_Title;
308 }
309 
310 inline
312 {
313  m_Title = value;
314  m_set_State[0] |= 0x3;
315 }
316 
317 inline
319 {
320  m_Title = std::forward<CProjectDescr_Base::TTitle>(value);
321  m_set_State[0] |= 0x3;
322 }
323 
324 inline
326 {
327 #ifdef _DEBUG
328  if (!IsSetTitle()) {
330  }
331 #endif
332  m_set_State[0] |= 0x1;
333  return m_Title;
334 }
335 
336 inline
338 {
339  return m_Create_date.NotEmpty();
340 }
341 
342 inline
344 {
345  return true;
346 }
347 
348 inline
350 {
351  if ( !m_Create_date ) {
352  const_cast<CProjectDescr_Base*>(this)->ResetCreate_date();
353  }
354  return (*m_Create_date);
355 }
356 
357 inline
359 {
360  if ( !m_Create_date ) {
362  }
363  return (*m_Create_date);
364 }
365 
366 inline
368 {
369  return m_Modified_date.NotEmpty();
370 }
371 
372 inline
374 {
375  return IsSetModified_date();
376 }
377 
378 inline
380 {
381  if (!CanGetModified_date()) {
382  ThrowUnassigned(2);
383  }
384  return (*m_Modified_date);
385 }
386 
387 inline
389 {
390  return ((m_set_State[0] & 0xc0) != 0);
391 }
392 
393 inline
395 {
396  return IsSetComment();
397 }
398 
399 inline
401 {
402  if (!CanGetComment()) {
403  ThrowUnassigned(3);
404  }
405  return m_Comment;
406 }
407 
408 inline
410 {
411  m_Comment = value;
412  m_set_State[0] |= 0xc0;
413 }
414 
415 inline
417 {
418  m_Comment = std::forward<CProjectDescr_Base::TComment>(value);
419  m_set_State[0] |= 0xc0;
420 }
421 
422 inline
424 {
425 #ifdef _DEBUG
426  if (!IsSetComment()) {
428  }
429 #endif
430  m_set_State[0] |= 0x40;
431  return m_Comment;
432 }
433 
434 ///////////////////////////////////////////////////////////
435 ////////////////// end of inline methods //////////////////
436 ///////////////////////////////////////////////////////////
437 
438 
439 
440 
441 
442 END_objects_SCOPE // namespace ncbi::objects::
443 
445 
446 
447 #endif // OBJECTS_GBPROJ_PROJECTDESCR_BASE_HPP
Definition: Date.hpp:53
CProjectDescr_Base –.
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
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
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
const TCreate_date & GetCreate_date(void) const
Get the Create_date member data.
bool IsSetModified_date(void) const
Check if a value has been assigned to Modified_date data member.
bool CanGetTitle(void) const
Check if it is safe to call GetTitle method.
CSerialObject Tparent
TTitle & SetTitle(void)
Assign a value to Title data member.
const TTitle & GetTitle(void) const
Get the Title member data.
TComment & SetComment(void)
Assign a value to Comment data member.
bool IsSetComment(void) const
optional descriptors Check if a value has been assigned to Comment data member.
CProjectDescr_Base(const CProjectDescr_Base &)
bool IsSetTitle(void) const
user-defined title for the workspace Check if a value has been assigned to Title data member.
bool CanGetCreate_date(void) const
Check if it is safe to call GetCreate_date method.
const TModified_date & GetModified_date(void) const
Get the Modified_date member data.
TCreate_date & SetCreate_date(void)
Assign a value to Create_date data member.
CRef< TModified_date > m_Modified_date
CRef< TCreate_date > m_Create_date
bool CanGetComment(void) const
Check if it is safe to call GetComment method.
const TComment & GetComment(void) const
Get the Comment member data.
bool CanGetModified_date(void) const
Check if it is safe to call GetModified_date method.
CProjectDescr_Base & operator=(const CProjectDescr_Base &)
bool IsSetCreate_date(void) const
basic (required) descriptors Check if a value has been assigned to Create_date data member.
void ResetCreate_date(void)
Reset Create_date data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
static void SetTitle(CRef< CSeq_entry > entry, string title)
Modified on Sat Jun 29 13:57:29 2024 by modify_doxy.py rev. 669887