NCBI C++ ToolKit
T3Data_.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 T3Data_.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/taxon3/taxon3.asn">taxon3.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/taxon3/taxon3.def">taxon3.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_TAXON3_T3DATA_BASE_HPP
42 #define OBJECTS_TAXON3_T3DATA_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
49 #include <string>
50 
52 
53 #ifndef BEGIN_objects_SCOPE
54 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
55 # define END_objects_SCOPE END_SCOPE(objects)
56 #endif
57 BEGIN_objects_SCOPE // namespace ncbi::objects::
58 
59 
60 // forward declarations
61 class COrg_ref;
62 class CT3RefreshFlags;
63 class CT3StatusFlags;
64 
65 
66 // generated classes
67 
68 
69 /** @addtogroup dataspec_NCBI_Taxon3
70  *
71  * @{
72  */
73 
74 /////////////////////////////////////////////////////////////////////////////
75 ///
76 /// CT3Data_Base --
77 ///
78 
80 {
82 public:
83  // constructor
84  CT3Data_Base(void);
85  // destructor
86  virtual ~CT3Data_Base(void);
87 
88  // type info
90 
91  // types
92  typedef COrg_ref TOrg;
93  typedef list< string > TBlast_name_lineage;
94  typedef list< CRef< CT3StatusFlags > > TStatus;
96 
97  // member index
98  enum class E_memberIndex {
99  e__allMandatory = 0,
100  e_org,
101  e_blast_name_lineage,
102  e_status,
103  e_refresh
104  };
106 
107  // getters
108  // setters
109 
110  /// Check if a value has been assigned to Org data member.
111  ///
112  /// Data member Org is mandatory;
113  /// its type is defined as 'typedef COrg_ref TOrg'
114  /// @return
115  /// - true, if a value has been assigned.
116  /// - false, otherwise.
117  bool IsSetOrg(void) const;
118 
119  /// Check if it is safe to call GetOrg method.
120  ///
121  /// @return
122  /// - true, if the data member is getatable.
123  /// - false, otherwise.
124  bool CanGetOrg(void) const;
125 
126  /// Reset Org data member.
127  void ResetOrg(void);
128 
129  /// Get the Org member data.
130  ///
131  /// @return
132  /// Reference to the member data.
133  const TOrg& GetOrg(void) const;
134 
135  /// Assign a value to Org data member.
136  ///
137  /// @param value
138  /// Reference to value.
139  void SetOrg(TOrg& value);
140 
141  /// Assign a value to Org data member.
142  ///
143  /// @return
144  /// Reference to the data value.
145  TOrg& SetOrg(void);
146 
147  /// Check if a value has been assigned to Blast_name_lineage data member.
148  ///
149  /// Data member Blast_name_lineage is optional;
150  /// its type is defined as 'typedef list< string > TBlast_name_lineage'
151  /// @return
152  /// - true, if a value has been assigned.
153  /// - false, otherwise.
154  bool IsSetBlast_name_lineage(void) const;
155 
156  /// Check if it is safe to call GetBlast_name_lineage method.
157  ///
158  /// @return
159  /// - true, if the data member is getatable.
160  /// - false, otherwise.
161  bool CanGetBlast_name_lineage(void) const;
162 
163  /// Reset Blast_name_lineage data member.
164  void ResetBlast_name_lineage(void);
165 
166  /// Get the Blast_name_lineage member data.
167  ///
168  /// @return
169  /// Reference to the member data.
170  const TBlast_name_lineage& GetBlast_name_lineage(void) const;
171 
172  /// Assign a value to Blast_name_lineage data member.
173  ///
174  /// @return
175  /// Reference to the data value.
176  TBlast_name_lineage& SetBlast_name_lineage(void);
177 
178  /// Check if a value has been assigned to Status data member.
179  ///
180  /// Data member Status is optional;
181  /// its type is defined as 'typedef list< CRef< CT3StatusFlags > > TStatus'
182  /// @return
183  /// - true, if a value has been assigned.
184  /// - false, otherwise.
185  bool IsSetStatus(void) const;
186 
187  /// Check if it is safe to call GetStatus method.
188  ///
189  /// @return
190  /// - true, if the data member is getatable.
191  /// - false, otherwise.
192  bool CanGetStatus(void) const;
193 
194  /// Reset Status data member.
195  void ResetStatus(void);
196 
197  /// Get the Status member data.
198  ///
199  /// @return
200  /// Reference to the member data.
201  const TStatus& GetStatus(void) const;
202 
203  /// Assign a value to Status data member.
204  ///
205  /// @return
206  /// Reference to the data value.
207  TStatus& SetStatus(void);
208 
209  /// Check if a value has been assigned to Refresh data member.
210  ///
211  /// Data member Refresh is optional;
212  /// its type is defined as 'typedef CT3RefreshFlags TRefresh'
213  /// @return
214  /// - true, if a value has been assigned.
215  /// - false, otherwise.
216  bool IsSetRefresh(void) const;
217 
218  /// Check if it is safe to call GetRefresh method.
219  ///
220  /// @return
221  /// - true, if the data member is getatable.
222  /// - false, otherwise.
223  bool CanGetRefresh(void) const;
224 
225  /// Reset Refresh data member.
226  void ResetRefresh(void);
227 
228  /// Get the Refresh member data.
229  ///
230  /// @return
231  /// Reference to the member data.
232  const TRefresh& GetRefresh(void) const;
233 
234  /// Assign a value to Refresh data member.
235  ///
236  /// @param value
237  /// Reference to value.
238  void SetRefresh(TRefresh& value);
239 
240  /// Assign a value to Refresh data member.
241  ///
242  /// @return
243  /// Reference to the data value.
244  TRefresh& SetRefresh(void);
245 
246  /// Reset the whole object
247  virtual void Reset(void);
248 
249 
250 private:
251  // Prohibit copy constructor and assignment operator
254 
255  // data
256  Uint4 m_set_State[1];
258  list< string > m_Blast_name_lineage;
259  list< CRef< CT3StatusFlags > > m_Status;
261 };
262 
263 /* @} */
264 
265 
266 
267 
268 
269 ///////////////////////////////////////////////////////////
270 ///////////////////// inline methods //////////////////////
271 ///////////////////////////////////////////////////////////
272 inline
273 bool CT3Data_Base::IsSetOrg(void) const
274 {
275  return m_Org.NotEmpty();
276 }
277 
278 inline
279 bool CT3Data_Base::CanGetOrg(void) const
280 {
281  return true;
282 }
283 
284 inline
286 {
287  if ( !m_Org ) {
288  const_cast<CT3Data_Base*>(this)->ResetOrg();
289  }
290  return (*m_Org);
291 }
292 
293 inline
295 {
296  if ( !m_Org ) {
297  ResetOrg();
298  }
299  return (*m_Org);
300 }
301 
302 inline
304 {
305  return ((m_set_State[0] & 0xc) != 0);
306 }
307 
308 inline
310 {
311  return true;
312 }
313 
314 inline
316 {
317  return m_Blast_name_lineage;
318 }
319 
320 inline
322 {
323  m_set_State[0] |= 0x4;
324  return m_Blast_name_lineage;
325 }
326 
327 inline
329 {
330  return ((m_set_State[0] & 0x30) != 0);
331 }
332 
333 inline
335 {
336  return true;
337 }
338 
339 inline
341 {
342  return m_Status;
343 }
344 
345 inline
347 {
348  m_set_State[0] |= 0x10;
349  return m_Status;
350 }
351 
352 inline
354 {
355  return m_Refresh.NotEmpty();
356 }
357 
358 inline
360 {
361  return IsSetRefresh();
362 }
363 
364 inline
366 {
367  if (!CanGetRefresh()) {
368  ThrowUnassigned(3);
369  }
370  return (*m_Refresh);
371 }
372 
373 ///////////////////////////////////////////////////////////
374 ////////////////// end of inline methods //////////////////
375 ///////////////////////////////////////////////////////////
376 
377 
378 
379 
380 
381 END_objects_SCOPE // namespace ncbi::objects::
382 
384 
385 
386 #endif // OBJECTS_TAXON3_T3DATA_BASE_HPP
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
CT3Data_Base –.
Definition: T3Data_.hpp:80
CT3RefreshFlags –.
CT3StatusFlags –.
char value[7]
Definition: config.c:431
void ThrowUnassigned(TMemberIndex index) const
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_TAXON3_EXPORT
Definition: ncbi_export.h:865
bool IsSetStatus(void) const
Check if a value has been assigned to Status data member.
Definition: T3Data_.hpp:328
list< string > m_Blast_name_lineage
Definition: T3Data_.hpp:258
COrg_ref TOrg
Definition: T3Data_.hpp:92
CRef< TOrg > m_Org
Definition: T3Data_.hpp:257
CSerialObject Tparent
Definition: T3Data_.hpp:81
bool CanGetRefresh(void) const
Check if it is safe to call GetRefresh method.
Definition: T3Data_.hpp:359
const TBlast_name_lineage & GetBlast_name_lineage(void) const
Get the Blast_name_lineage member data.
Definition: T3Data_.hpp:315
bool CanGetStatus(void) const
Check if it is safe to call GetStatus method.
Definition: T3Data_.hpp:334
const TStatus & GetStatus(void) const
Get the Status member data.
Definition: T3Data_.hpp:340
bool IsSetBlast_name_lineage(void) const
Check if a value has been assigned to Blast_name_lineage data member.
Definition: T3Data_.hpp:303
list< CRef< CT3StatusFlags > > m_Status
Definition: T3Data_.hpp:259
bool IsSetOrg(void) const
Check if a value has been assigned to Org data member.
Definition: T3Data_.hpp:273
TOrg & SetOrg(void)
Assign a value to Org data member.
Definition: T3Data_.hpp:294
bool CanGetOrg(void) const
Check if it is safe to call GetOrg method.
Definition: T3Data_.hpp:279
void ResetOrg(void)
Reset Org data member.
Definition: T3Data_.cpp:53
list< CRef< CT3StatusFlags > > TStatus
Definition: T3Data_.hpp:94
list< string > TBlast_name_lineage
Definition: T3Data_.hpp:93
CT3Data_Base(const CT3Data_Base &)
const TRefresh & GetRefresh(void) const
Get the Refresh member data.
Definition: T3Data_.hpp:365
const TOrg & GetOrg(void) const
Get the Org member data.
Definition: T3Data_.hpp:285
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
Definition: T3Data_.hpp:105
DECLARE_INTERNAL_TYPE_INFO()
TStatus & SetStatus(void)
Assign a value to Status data member.
Definition: T3Data_.hpp:346
Uint4 m_set_State[1]
Definition: T3Data_.hpp:256
bool IsSetRefresh(void) const
Check if a value has been assigned to Refresh data member.
Definition: T3Data_.hpp:353
TBlast_name_lineage & SetBlast_name_lineage(void)
Assign a value to Blast_name_lineage data member.
Definition: T3Data_.hpp:321
CRef< TRefresh > m_Refresh
Definition: T3Data_.hpp:260
CT3RefreshFlags TRefresh
Definition: T3Data_.hpp:95
CT3Data_Base & operator=(const CT3Data_Base &)
bool CanGetBlast_name_lineage(void) const
Check if it is safe to call GetBlast_name_lineage method.
Definition: T3Data_.hpp:309
Modified on Thu Mar 28 17:12:21 2024 by modify_doxy.py rev. 669887