NCBI C++ ToolKit
GBAltSeqData_.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 GBAltSeqData_.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/gbseq/gbseq.asn">gbseq.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/gbseq/gbseq.def">gbseq.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_GBSEQ_GBALTSEQDATA_BASE_HPP
42 #define OBJECTS_GBSEQ_GBALTSEQDATA_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 CGBAltSeqItem;
62 
63 
64 // generated classes
65 
66 
67 /** @addtogroup dataspec_NCBI_GBSeq
68  *
69  * @{
70  */
71 
72 /////////////////////////////////////////////////////////////////////////////
73 ///
74 /// CGBAltSeqData_Base --
75 ///
76 
78 {
80 public:
81  // constructor
82  CGBAltSeqData_Base(void);
83  // destructor
84  virtual ~CGBAltSeqData_Base(void);
85 
86  // type info
88 
89  // types
90  typedef string TName;
91  typedef list< CRef< CGBAltSeqItem > > TItems;
92 
93  // member index
94  enum class E_memberIndex {
95  e__allMandatory = 0,
96  e_name,
97  e_items
98  };
100 
101  // getters
102  // setters
103 
104  /// e.g., contig, wgs, scaffold, cage, genome
105  /// Check if a value has been assigned to Name data member.
106  ///
107  /// Data member Name is mandatory;
108  /// its type is defined as 'typedef string TName'
109  /// @return
110  /// - true, if a value has been assigned.
111  /// - false, otherwise.
112  bool IsSetName(void) const;
113 
114  /// Check if it is safe to call GetName method.
115  ///
116  /// @return
117  /// - true, if the data member is getatable.
118  /// - false, otherwise.
119  bool CanGetName(void) const;
120 
121  /// Reset Name data member.
122  void ResetName(void);
123 
124  /// Get the Name member data.
125  ///
126  /// @return
127  /// Reference to the member data.
128  const TName& GetName(void) const;
129 
130  /// Assign a value to Name data member.
131  ///
132  /// @param value
133  /// Value to assign
134  void SetName(const TName& value);
135  void SetName(TName&& value);
136 
137  /// Assign a value to Name data member.
138  ///
139  /// @return
140  /// Reference to the data value.
141  TName& SetName(void);
142 
143  /// Check if a value has been assigned to Items data member.
144  ///
145  /// Data member Items is optional;
146  /// its type is defined as 'typedef list< CRef< CGBAltSeqItem > > TItems'
147  /// @return
148  /// - true, if a value has been assigned.
149  /// - false, otherwise.
150  bool IsSetItems(void) const;
151 
152  /// Check if it is safe to call GetItems method.
153  ///
154  /// @return
155  /// - true, if the data member is getatable.
156  /// - false, otherwise.
157  bool CanGetItems(void) const;
158 
159  /// Reset Items data member.
160  void ResetItems(void);
161 
162  /// Get the Items member data.
163  ///
164  /// @return
165  /// Reference to the member data.
166  const TItems& GetItems(void) const;
167 
168  /// Assign a value to Items data member.
169  ///
170  /// @return
171  /// Reference to the data value.
172  TItems& SetItems(void);
173 
174  /// Reset the whole object
175  virtual void Reset(void);
176 
177 
178 private:
179  // Prohibit copy constructor and assignment operator
182 
183  // data
184  Uint4 m_set_State[1];
185  string m_Name;
186  list< CRef< CGBAltSeqItem > > m_Items;
187 };
188 
189 /* @} */
190 
191 
192 
193 
194 
195 ///////////////////////////////////////////////////////////
196 ///////////////////// inline methods //////////////////////
197 ///////////////////////////////////////////////////////////
198 inline
200 {
201  return ((m_set_State[0] & 0x3) != 0);
202 }
203 
204 inline
206 {
207  return IsSetName();
208 }
209 
210 inline
212 {
213  if (!CanGetName()) {
214  ThrowUnassigned(0);
215  }
216  return m_Name;
217 }
218 
219 inline
221 {
222  m_Name = value;
223  m_set_State[0] |= 0x3;
224 }
225 
226 inline
228 {
229  m_Name = std::forward<CGBAltSeqData_Base::TName>(value);
230  m_set_State[0] |= 0x3;
231 }
232 
233 inline
235 {
236 #ifdef _DEBUG
237  if (!IsSetName()) {
239  }
240 #endif
241  m_set_State[0] |= 0x1;
242  return m_Name;
243 }
244 
245 inline
247 {
248  return ((m_set_State[0] & 0xc) != 0);
249 }
250 
251 inline
253 {
254  return true;
255 }
256 
257 inline
259 {
260  return m_Items;
261 }
262 
263 inline
265 {
266  m_set_State[0] |= 0x4;
267  return m_Items;
268 }
269 
270 ///////////////////////////////////////////////////////////
271 ////////////////// end of inline methods //////////////////
272 ///////////////////////////////////////////////////////////
273 
274 
275 
276 
277 
278 END_objects_SCOPE // namespace ncbi::objects::
279 
281 
282 
283 #endif // OBJECTS_GBSEQ_GBALTSEQDATA_BASE_HPP
CGBAltSeqData_Base –.
CGBAltSeqItem –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
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_GBSEQ_EXPORT
Definition: ncbi_export.h:504
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
bool IsSetName(void) const
e.g., contig, wgs, scaffold, cage, genome Check if a value has been assigned to Name data member.
CSerialObject Tparent
list< CRef< CGBAltSeqItem > > TItems
TName & SetName(void)
Assign a value to Name data member.
CGBAltSeqData_Base(const CGBAltSeqData_Base &)
TItems & SetItems(void)
Assign a value to Items data member.
const TItems & GetItems(void) const
Get the Items member data.
bool IsSetItems(void) const
Check if a value has been assigned to Items data member.
bool CanGetName(void) const
Check if it is safe to call GetName method.
const TName & GetName(void) const
Get the Name member data.
bool CanGetItems(void) const
Check if it is safe to call GetItems method.
list< CRef< CGBAltSeqItem > > m_Items
CGBAltSeqData_Base & operator=(const CGBAltSeqData_Base &)
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sat Jun 29 13:52:05 2024 by modify_doxy.py rev. 669887