NCBI C++ ToolKit
RNA_qual_.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 RNA_qual_.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_RNA_QUAL_BASE_HPP
42 #define OBJECTS_SEQFEAT_RNA_QUAL_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
49 
51 
52 #ifndef BEGIN_objects_SCOPE
53 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
54 # define END_objects_SCOPE END_SCOPE(objects)
55 #endif
56 BEGIN_objects_SCOPE // namespace ncbi::objects::
57 
58 
59 // generated classes
60 
61 
62 /** @addtogroup dataspec_NCBI_RNA
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 /// Additional data values for RNA-gen,
69 ///
70 /// CRNA_qual_Base --
71 ///
72 
74 {
76 public:
77  // constructor
78  CRNA_qual_Base(void);
79  // destructor
80  virtual ~CRNA_qual_Base(void);
81 
82  // type info
84 
85  // types
86  typedef string TQual;
87  typedef string TVal;
88 
89  // member index
90  enum class E_memberIndex {
91  e__allMandatory = 0,
92  e_qual,
93  e_val
94  };
96 
97  // getters
98  // setters
99 
100  /// in a tag (qual), value (val) format
101  /// Check if a value has been assigned to Qual data member.
102  ///
103  /// Data member Qual is mandatory;
104  /// its type is defined as 'typedef string TQual'
105  /// @return
106  /// - true, if a value has been assigned.
107  /// - false, otherwise.
108  bool IsSetQual(void) const;
109 
110  /// Check if it is safe to call GetQual method.
111  ///
112  /// @return
113  /// - true, if the data member is getatable.
114  /// - false, otherwise.
115  bool CanGetQual(void) const;
116 
117  /// Reset Qual data member.
118  void ResetQual(void);
119 
120  /// Get the Qual member data.
121  ///
122  /// @return
123  /// Reference to the member data.
124  const TQual& GetQual(void) const;
125 
126  /// Assign a value to Qual data member.
127  ///
128  /// @param value
129  /// Value to assign
130  void SetQual(const TQual& value);
131  void SetQual(TQual&& value);
132 
133  /// Assign a value to Qual data member.
134  ///
135  /// @return
136  /// Reference to the data value.
137  TQual& SetQual(void);
138 
139  /// Check if a value has been assigned to Val data member.
140  ///
141  /// Data member Val is mandatory;
142  /// its type is defined as 'typedef string TVal'
143  /// @return
144  /// - true, if a value has been assigned.
145  /// - false, otherwise.
146  bool IsSetVal(void) const;
147 
148  /// Check if it is safe to call GetVal method.
149  ///
150  /// @return
151  /// - true, if the data member is getatable.
152  /// - false, otherwise.
153  bool CanGetVal(void) const;
154 
155  /// Reset Val data member.
156  void ResetVal(void);
157 
158  /// Get the Val member data.
159  ///
160  /// @return
161  /// Reference to the member data.
162  const TVal& GetVal(void) const;
163 
164  /// Assign a value to Val data member.
165  ///
166  /// @param value
167  /// Value to assign
168  void SetVal(const TVal& value);
169  void SetVal(TVal&& value);
170 
171  /// Assign a value to Val data member.
172  ///
173  /// @return
174  /// Reference to the data value.
175  TVal& SetVal(void);
176 
177  /// Reset the whole object
178  virtual void Reset(void);
179 
180 
181 private:
182  // Prohibit copy constructor and assignment operator
185 
186  // data
187  Uint4 m_set_State[1];
188  string m_Qual;
189  string m_Val;
190 };
191 
192 /* @} */
193 
194 
195 
196 
197 
198 ///////////////////////////////////////////////////////////
199 ///////////////////// inline methods //////////////////////
200 ///////////////////////////////////////////////////////////
201 inline
203 {
204  return ((m_set_State[0] & 0x3) != 0);
205 }
206 
207 inline
209 {
210  return IsSetQual();
211 }
212 
213 inline
215 {
216  if (!CanGetQual()) {
217  ThrowUnassigned(0);
218  }
219  return m_Qual;
220 }
221 
222 inline
224 {
225  m_Qual = value;
226  m_set_State[0] |= 0x3;
227 }
228 
229 inline
231 {
232  m_Qual = std::forward<CRNA_qual_Base::TQual>(value);
233  m_set_State[0] |= 0x3;
234 }
235 
236 inline
238 {
239 #ifdef _DEBUG
240  if (!IsSetQual()) {
242  }
243 #endif
244  m_set_State[0] |= 0x1;
245  return m_Qual;
246 }
247 
248 inline
249 bool CRNA_qual_Base::IsSetVal(void) const
250 {
251  return ((m_set_State[0] & 0xc) != 0);
252 }
253 
254 inline
256 {
257  return IsSetVal();
258 }
259 
260 inline
262 {
263  if (!CanGetVal()) {
264  ThrowUnassigned(1);
265  }
266  return m_Val;
267 }
268 
269 inline
271 {
272  m_Val = value;
273  m_set_State[0] |= 0xc;
274 }
275 
276 inline
278 {
279  m_Val = std::forward<CRNA_qual_Base::TVal>(value);
280  m_set_State[0] |= 0xc;
281 }
282 
283 inline
285 {
286 #ifdef _DEBUG
287  if (!IsSetVal()) {
289  }
290 #endif
291  m_set_State[0] |= 0x4;
292  return m_Val;
293 }
294 
295 ///////////////////////////////////////////////////////////
296 ////////////////// end of inline methods //////////////////
297 ///////////////////////////////////////////////////////////
298 
299 
300 
301 
302 
303 END_objects_SCOPE // namespace ncbi::objects::
304 
306 
307 
308 #endif // OBJECTS_SEQFEAT_RNA_QUAL_BASE_HPP
Additional data values for RNA-gen,.
Definition: RNA_qual_.hpp:74
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_SEQFEAT_EXPORT
Definition: ncbi_export.h:768
TQual & SetQual(void)
Assign a value to Qual data member.
Definition: RNA_qual_.hpp:237
Uint4 m_set_State[1]
Definition: RNA_qual_.hpp:187
CSerialObject Tparent
Definition: RNA_qual_.hpp:75
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
Definition: RNA_qual_.hpp:95
TVal & SetVal(void)
Assign a value to Val data member.
Definition: RNA_qual_.hpp:284
bool CanGetQual(void) const
Check if it is safe to call GetQual method.
Definition: RNA_qual_.hpp:208
bool CanGetVal(void) const
Check if it is safe to call GetVal method.
Definition: RNA_qual_.hpp:255
const TQual & GetQual(void) const
Get the Qual member data.
Definition: RNA_qual_.hpp:214
CRNA_qual_Base & operator=(const CRNA_qual_Base &)
bool IsSetVal(void) const
Check if a value has been assigned to Val data member.
Definition: RNA_qual_.hpp:249
bool IsSetQual(void) const
in a tag (qual), value (val) format Check if a value has been assigned to Qual data member.
Definition: RNA_qual_.hpp:202
DECLARE_INTERNAL_TYPE_INFO()
const TVal & GetVal(void) const
Get the Val member data.
Definition: RNA_qual_.hpp:261
CRNA_qual_Base(const CRNA_qual_Base &)
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Mon Jun 24 05:25:43 2024 by modify_doxy.py rev. 669887