NCBI C++ ToolKit
ExperimentSupport_.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 ExperimentSupport_.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/seqfeat/seqfeat.asn">seqfeat.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqfeat/seqfeat.def">seqfeat.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_SEQFEAT_EXPERIMENTSUPPORT_BASE_HPP
42 #define OBJECTS_SEQFEAT_EXPERIMENTSUPPORT_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
49 #include <string>
50 #include <objects/biblio/DOI.hpp>
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 // generated classes
64 
65 
66 /** @addtogroup dataspec_NCBI_Seqfeat
67  *
68  * @{
69  */
70 
71 /////////////////////////////////////////////////////////////////////////////
72 ///
73 /// CExperimentSupport_Base --
74 ///
75 
77 {
79 public:
80  // constructor
82  // destructor
83  virtual ~CExperimentSupport_Base(void);
84 
85  // type info
87 
88  // types
89  typedef int TCategory;
90  typedef string TExplanation;
91  typedef list< CPubMedId > TPmids;
92  typedef list< CDOI > TDois;
93 
94  // member index
95  enum class E_memberIndex {
96  e__allMandatory = 0,
97  e_category,
98  e_explanation,
99  e_pmids,
100  e_dois
101  };
103 
104  // getters
105  // setters
106 
107  /// Check if a value has been assigned to Category data member.
108  ///
109  /// Data member Category is optional;
110  /// its type is defined as 'typedef int TCategory'
111  /// @return
112  /// - true, if a value has been assigned.
113  /// - false, otherwise.
114  bool IsSetCategory(void) const;
115 
116  /// Check if it is safe to call GetCategory method.
117  ///
118  /// @return
119  /// - true, if the data member is getatable.
120  /// - false, otherwise.
121  bool CanGetCategory(void) const;
122 
123  /// Reset Category data member.
124  void ResetCategory(void);
125 
126  /// Get the Category member data.
127  ///
128  /// @return
129  /// Copy of the member data.
130  TCategory GetCategory(void) const;
131 
132  /// Assign a value to Category data member.
133  ///
134  /// @param value
135  /// Value to assign
136  void SetCategory(TCategory value);
137 
138  /// Assign a value to Category data member.
139  ///
140  /// @return
141  /// Reference to the data value.
142  TCategory& SetCategory(void);
143 
144  /// Check if a value has been assigned to Explanation data member.
145  ///
146  /// Data member Explanation is mandatory;
147  /// its type is defined as 'typedef string TExplanation'
148  /// @return
149  /// - true, if a value has been assigned.
150  /// - false, otherwise.
151  bool IsSetExplanation(void) const;
152 
153  /// Check if it is safe to call GetExplanation method.
154  ///
155  /// @return
156  /// - true, if the data member is getatable.
157  /// - false, otherwise.
158  bool CanGetExplanation(void) const;
159 
160  /// Reset Explanation data member.
161  void ResetExplanation(void);
162 
163  /// Get the Explanation member data.
164  ///
165  /// @return
166  /// Reference to the member data.
167  const TExplanation& GetExplanation(void) const;
168 
169  /// Assign a value to Explanation data member.
170  ///
171  /// @param value
172  /// Value to assign
173  void SetExplanation(const TExplanation& value);
174  void SetExplanation(TExplanation&& value);
175 
176  /// Assign a value to Explanation data member.
177  ///
178  /// @return
179  /// Reference to the data value.
180  TExplanation& SetExplanation(void);
181 
182  /// Check if a value has been assigned to Pmids data member.
183  ///
184  /// Data member Pmids is optional;
185  /// its type is defined as 'typedef list< CPubMedId > TPmids'
186  /// @return
187  /// - true, if a value has been assigned.
188  /// - false, otherwise.
189  bool IsSetPmids(void) const;
190 
191  /// Check if it is safe to call GetPmids method.
192  ///
193  /// @return
194  /// - true, if the data member is getatable.
195  /// - false, otherwise.
196  bool CanGetPmids(void) const;
197 
198  /// Reset Pmids data member.
199  void ResetPmids(void);
200 
201  /// Get the Pmids member data.
202  ///
203  /// @return
204  /// Reference to the member data.
205  const TPmids& GetPmids(void) const;
206 
207  /// Assign a value to Pmids data member.
208  ///
209  /// @return
210  /// Reference to the data value.
211  TPmids& SetPmids(void);
212 
213  /// Check if a value has been assigned to Dois data member.
214  ///
215  /// Data member Dois is optional;
216  /// its type is defined as 'typedef list< CDOI > TDois'
217  /// @return
218  /// - true, if a value has been assigned.
219  /// - false, otherwise.
220  bool IsSetDois(void) const;
221 
222  /// Check if it is safe to call GetDois method.
223  ///
224  /// @return
225  /// - true, if the data member is getatable.
226  /// - false, otherwise.
227  bool CanGetDois(void) const;
228 
229  /// Reset Dois data member.
230  void ResetDois(void);
231 
232  /// Get the Dois member data.
233  ///
234  /// @return
235  /// Reference to the member data.
236  const TDois& GetDois(void) const;
237 
238  /// Assign a value to Dois data member.
239  ///
240  /// @return
241  /// Reference to the data value.
242  TDois& SetDois(void);
243 
244  /// Reset the whole object
245  virtual void Reset(void);
246 
247 
248 private:
249  // Prohibit copy constructor and assignment operator
252 
253  // data
254  Uint4 m_set_State[1];
257  list< CPubMedId > m_Pmids;
258  list< CDOI > m_Dois;
259 };
260 
261 /* @} */
262 
263 
264 
265 
266 
267 ///////////////////////////////////////////////////////////
268 ///////////////////// inline methods //////////////////////
269 ///////////////////////////////////////////////////////////
270 inline
272 {
273  return ((m_set_State[0] & 0x3) != 0);
274 }
275 
276 inline
278 {
279  return IsSetCategory();
280 }
281 
282 inline
284 {
285  m_Category = (int)(0);
286  m_set_State[0] &= ~0x3;
287 }
288 
289 inline
291 {
292  if (!CanGetCategory()) {
293  ThrowUnassigned(0);
294  }
295  return m_Category;
296 }
297 
298 inline
300 {
301  m_Category = value;
302  m_set_State[0] |= 0x3;
303 }
304 
305 inline
307 {
308 #ifdef _DEBUG
309  if (!IsSetCategory()) {
310  memset(&m_Category,UnassignedByte(),sizeof(m_Category));
311  }
312 #endif
313  m_set_State[0] |= 0x1;
314  return m_Category;
315 }
316 
317 inline
319 {
320  return ((m_set_State[0] & 0xc) != 0);
321 }
322 
323 inline
325 {
326  return IsSetExplanation();
327 }
328 
329 inline
331 {
332  if (!CanGetExplanation()) {
333  ThrowUnassigned(1);
334  }
335  return m_Explanation;
336 }
337 
338 inline
340 {
342  m_set_State[0] |= 0xc;
343 }
344 
345 inline
347 {
348  m_Explanation = std::forward<CExperimentSupport_Base::TExplanation>(value);
349  m_set_State[0] |= 0xc;
350 }
351 
352 inline
354 {
355 #ifdef _DEBUG
356  if (!IsSetExplanation()) {
358  }
359 #endif
360  m_set_State[0] |= 0x4;
361  return m_Explanation;
362 }
363 
364 inline
366 {
367  return ((m_set_State[0] & 0x30) != 0);
368 }
369 
370 inline
372 {
373  return true;
374 }
375 
376 inline
378 {
379  return m_Pmids;
380 }
381 
382 inline
384 {
385  m_set_State[0] |= 0x10;
386  return m_Pmids;
387 }
388 
389 inline
391 {
392  return ((m_set_State[0] & 0xc0) != 0);
393 }
394 
395 inline
397 {
398  return true;
399 }
400 
401 inline
403 {
404  return m_Dois;
405 }
406 
407 inline
409 {
410  m_set_State[0] |= 0x40;
411  return m_Dois;
412 }
413 
414 ///////////////////////////////////////////////////////////
415 ////////////////// end of inline methods //////////////////
416 ///////////////////////////////////////////////////////////
417 
418 
419 
420 
421 
422 END_objects_SCOPE // namespace ncbi::objects::
423 
425 
426 
427 #endif // OBJECTS_SEQFEAT_EXPERIMENTSUPPORT_BASE_HPP
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CExperimentSupport_Base –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
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_SEQFEAT_EXPORT
Definition: ncbi_export.h:768
bool IsSetCategory(void) const
Check if a value has been assigned to Category data member.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
bool CanGetCategory(void) const
Check if it is safe to call GetCategory method.
TCategory GetCategory(void) const
Get the Category member data.
const TExplanation & GetExplanation(void) const
Get the Explanation member data.
const TPmids & GetPmids(void) const
Get the Pmids member data.
TCategory & SetCategory(void)
Assign a value to Category data member.
bool CanGetExplanation(void) const
Check if it is safe to call GetExplanation method.
bool IsSetExplanation(void) const
Check if a value has been assigned to Explanation data member.
bool CanGetDois(void) const
Check if it is safe to call GetDois method.
const TDois & GetDois(void) const
Get the Dois member data.
void ResetCategory(void)
Reset Category data member.
bool IsSetPmids(void) const
Check if a value has been assigned to Pmids data member.
TPmids & SetPmids(void)
Assign a value to Pmids data member.
CExperimentSupport_Base & operator=(const CExperimentSupport_Base &)
CExperimentSupport_Base(const CExperimentSupport_Base &)
TDois & SetDois(void)
Assign a value to Dois data member.
TExplanation & SetExplanation(void)
Assign a value to Explanation data member.
bool CanGetPmids(void) const
Check if it is safe to call GetPmids method.
bool IsSetDois(void) const
Check if a value has been assigned to Dois data member.
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Thu May 30 12:22:45 2024 by modify_doxy.py rev. 669887