NCBI C++ ToolKit
ID2S_Bioseq_Info_.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 ID2S_Bioseq_Info_.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/seqsplit/seqsplit.asn">seqsplit.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqsplit/seqsplit.def">seqsplit.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_SEQSPLIT_ID2S_BIOSEQ_INFO_BASE_HPP
42 #define OBJECTS_SEQSPLIT_ID2S_BIOSEQ_INFO_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
47 
48 #ifndef BEGIN_objects_SCOPE
49 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
50 # define END_objects_SCOPE END_SCOPE(objects)
51 #endif
52 BEGIN_objects_SCOPE // namespace ncbi::objects::
53 
54 
55 // generated classes
56 
57 
58 /** @addtogroup dataspec_NCBI_Seq_split
59  *
60  * @{
61  */
62 
63 /////////////////////////////////////////////////////////////////////////////
64 ///
65 /// CID2S_Bioseq_Info_Base --
66 ///
67 
69 {
71 public:
72  // constructor
74  // destructor
75  virtual ~CID2S_Bioseq_Info_Base(void);
76 
77  // type info
79 
80  // types
81  typedef int TGap_count;
82  typedef bool TSeq_map_has_ref;
83 
84  // member index
85  enum class E_memberIndex {
86  e__allMandatory = 0,
87  e_gap_count,
88  e_seq_map_has_ref
89  };
91 
92  // getters
93  // setters
94 
95  /// Check if a value has been assigned to Gap_count data member.
96  ///
97  /// Data member Gap_count is optional;
98  /// its type is defined as 'typedef int TGap_count'
99  /// @return
100  /// - true, if a value has been assigned.
101  /// - false, otherwise.
102  bool IsSetGap_count(void) const;
103 
104  /// Check if it is safe to call GetGap_count method.
105  ///
106  /// @return
107  /// - true, if the data member is getatable.
108  /// - false, otherwise.
109  bool CanGetGap_count(void) const;
110 
111  /// Reset Gap_count data member.
112  void ResetGap_count(void);
113 
114  /// Get the Gap_count member data.
115  ///
116  /// @return
117  /// Copy of the member data.
118  TGap_count GetGap_count(void) const;
119 
120  /// Assign a value to Gap_count data member.
121  ///
122  /// @param value
123  /// Value to assign
124  void SetGap_count(TGap_count value);
125 
126  /// Assign a value to Gap_count data member.
127  ///
128  /// @return
129  /// Reference to the data value.
130  TGap_count& SetGap_count(void);
131 
132  /// Check if a value has been assigned to Seq_map_has_ref data member.
133  ///
134  /// Data member Seq_map_has_ref is optional;
135  /// its type is defined as 'typedef bool TSeq_map_has_ref'
136  /// @return
137  /// - true, if a value has been assigned.
138  /// - false, otherwise.
139  bool IsSetSeq_map_has_ref(void) const;
140 
141  /// Check if it is safe to call GetSeq_map_has_ref method.
142  ///
143  /// @return
144  /// - true, if the data member is getatable.
145  /// - false, otherwise.
146  bool CanGetSeq_map_has_ref(void) const;
147 
148  /// Reset Seq_map_has_ref data member.
149  void ResetSeq_map_has_ref(void);
150 
151  /// Get the Seq_map_has_ref member data.
152  ///
153  /// @return
154  /// Copy of the member data.
155  TSeq_map_has_ref GetSeq_map_has_ref(void) const;
156 
157  /// Assign a value to Seq_map_has_ref data member.
158  ///
159  /// @param value
160  /// Value to assign
161  void SetSeq_map_has_ref(TSeq_map_has_ref value);
162 
163  /// Assign a value to Seq_map_has_ref data member.
164  ///
165  /// @return
166  /// Reference to the data value.
167  TSeq_map_has_ref& SetSeq_map_has_ref(void);
168 
169  /// Reset the whole object
170  virtual void Reset(void);
171 
172 
173 private:
174  // Prohibit copy constructor and assignment operator
177 
178  // data
179  Uint4 m_set_State[1];
182 };
183 
184 /* @} */
185 
186 
187 
188 
189 
190 ///////////////////////////////////////////////////////////
191 ///////////////////// inline methods //////////////////////
192 ///////////////////////////////////////////////////////////
193 inline
195 {
196  return ((m_set_State[0] & 0x3) != 0);
197 }
198 
199 inline
201 {
202  return IsSetGap_count();
203 }
204 
205 inline
207 {
208  m_Gap_count = 0;
209  m_set_State[0] &= ~0x3;
210 }
211 
212 inline
214 {
215  if (!CanGetGap_count()) {
216  ThrowUnassigned(0);
217  }
218  return m_Gap_count;
219 }
220 
221 inline
223 {
224  m_Gap_count = value;
225  m_set_State[0] |= 0x3;
226 }
227 
228 inline
230 {
231 #ifdef _DEBUG
232  if (!IsSetGap_count()) {
233  memset(&m_Gap_count,UnassignedByte(),sizeof(m_Gap_count));
234  }
235 #endif
236  m_set_State[0] |= 0x1;
237  return m_Gap_count;
238 }
239 
240 inline
242 {
243  return ((m_set_State[0] & 0xc) != 0);
244 }
245 
246 inline
248 {
249  return IsSetSeq_map_has_ref();
250 }
251 
252 inline
254 {
255  m_Seq_map_has_ref = 0;
256  m_set_State[0] &= ~0xc;
257 }
258 
259 inline
261 {
262  if (!CanGetSeq_map_has_ref()) {
263  ThrowUnassigned(1);
264  }
265  return m_Seq_map_has_ref;
266 }
267 
268 inline
270 {
272  m_set_State[0] |= 0xc;
273 }
274 
275 inline
277 {
278 #ifdef _DEBUG
279  if (!IsSetSeq_map_has_ref()) {
281  }
282 #endif
283  m_set_State[0] |= 0x4;
284  return m_Seq_map_has_ref;
285 }
286 
287 ///////////////////////////////////////////////////////////
288 ////////////////// end of inline methods //////////////////
289 ///////////////////////////////////////////////////////////
290 
291 
292 
293 
294 
295 END_objects_SCOPE // namespace ncbi::objects::
296 
298 
299 
300 #endif // OBJECTS_SEQSPLIT_ID2S_BIOSEQ_INFO_BASE_HPP
CID2S_Bioseq_Info_Base –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
char value[7]
Definition: config.c:431
static char UnassignedByte(void)
Definition: serialbase.hpp:181
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_ID2_EXPORT
Definition: ncbi_export.h:552
bool IsSetGap_count(void) const
Check if a value has been assigned to Gap_count data member.
CID2S_Bioseq_Info_Base(const CID2S_Bioseq_Info_Base &)
void ResetGap_count(void)
Reset Gap_count data member.
TGap_count GetGap_count(void) const
Get the Gap_count member data.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
CID2S_Bioseq_Info_Base & operator=(const CID2S_Bioseq_Info_Base &)
TGap_count & SetGap_count(void)
Assign a value to Gap_count data member.
bool CanGetSeq_map_has_ref(void) const
Check if it is safe to call GetSeq_map_has_ref method.
void ResetSeq_map_has_ref(void)
Reset Seq_map_has_ref data member.
TSeq_map_has_ref GetSeq_map_has_ref(void) const
Get the Seq_map_has_ref member data.
bool CanGetGap_count(void) const
Check if it is safe to call GetGap_count method.
TSeq_map_has_ref & SetSeq_map_has_ref(void)
Assign a value to Seq_map_has_ref data member.
bool IsSetSeq_map_has_ref(void) const
Check if a value has been assigned to Seq_map_has_ref data member.
Modified on Fri Dec 01 04:47:51 2023 by modify_doxy.py rev. 669887