NCBI C++ ToolKit
VariantExpression_.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 VariantExpression_.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/varrep/varrep.asn">varrep.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/varrep/varrep.def">varrep.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_VARREP_VARIANTEXPRESSION_BASE_HPP
42 #define OBJECTS_VARREP_VARIANTEXPRESSION_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 // forward declarations
60 class CSequenceVariant;
61 
62 
63 // generated classes
64 
65 
66 /** @addtogroup dataspec_NCBI_VariationIRep
67  *
68  * @{
69  */
70 
71 /////////////////////////////////////////////////////////////////////////////
72 ///EXPORTS VariantExpression, SimpleVariant;
73 ///
74 /// CVariantExpression_Base --
75 ///
76 
78 {
80 public:
81  // constructor
83  // destructor
84  virtual ~CVariantExpression_Base(void);
85 
86  // type info
88 
89  // types
90  typedef string TInput_expr;
91  typedef string TReference_id;
93 
94  // member index
95  enum class E_memberIndex {
96  e__allMandatory = 0,
100  };
102 
103  // getters
104  // setters
105 
106  /// contains the input expression to be parsed
107  /// Check if a value has been assigned to Input_expr data member.
108  ///
109  /// Data member Input_expr is mandatory;
110  /// its type is defined as 'typedef string TInput_expr'
111  /// @return
112  /// - true, if a value has been assigned.
113  /// - false, otherwise.
114  bool IsSetInput_expr(void) const;
115 
116  /// Check if it is safe to call GetInput_expr method.
117  ///
118  /// @return
119  /// - true, if the data member is getatable.
120  /// - false, otherwise.
121  bool CanGetInput_expr(void) const;
122 
123  /// Reset Input_expr data member.
124  void ResetInput_expr(void);
125 
126  /// Get the Input_expr member data.
127  ///
128  /// @return
129  /// Reference to the member data.
130  const TInput_expr& GetInput_expr(void) const;
131 
132  /// Assign a value to Input_expr data member.
133  ///
134  /// @param value
135  /// Value to assign
136  void SetInput_expr(const TInput_expr& value);
138 
139  /// Assign a value to Input_expr data member.
140  ///
141  /// @return
142  /// Reference to the data value.
143  TInput_expr& SetInput_expr(void);
144 
145  /// contains the accession id or other identifier for the reference sequence
146  /// Check if a value has been assigned to Reference_id data member.
147  ///
148  /// Data member Reference_id is mandatory;
149  /// its type is defined as 'typedef string TReference_id'
150  /// @return
151  /// - true, if a value has been assigned.
152  /// - false, otherwise.
153  bool IsSetReference_id(void) const;
154 
155  /// Check if it is safe to call GetReference_id method.
156  ///
157  /// @return
158  /// - true, if the data member is getatable.
159  /// - false, otherwise.
160  bool CanGetReference_id(void) const;
161 
162  /// Reset Reference_id data member.
163  void ResetReference_id(void);
164 
165  /// Get the Reference_id member data.
166  ///
167  /// @return
168  /// Reference to the member data.
169  const TReference_id& GetReference_id(void) const;
170 
171  /// Assign a value to Reference_id data member.
172  ///
173  /// @param value
174  /// Value to assign
175  void SetReference_id(const TReference_id& value);
177 
178  /// Assign a value to Reference_id data member.
179  ///
180  /// @return
181  /// Reference to the data value.
183 
184  /// Check if a value has been assigned to Sequence_variant data member.
185  ///
186  /// Data member Sequence_variant is mandatory;
187  /// its type is defined as 'typedef CSequenceVariant TSequence_variant'
188  /// @return
189  /// - true, if a value has been assigned.
190  /// - false, otherwise.
191  bool IsSetSequence_variant(void) const;
192 
193  /// Check if it is safe to call GetSequence_variant method.
194  ///
195  /// @return
196  /// - true, if the data member is getatable.
197  /// - false, otherwise.
198  bool CanGetSequence_variant(void) const;
199 
200  /// Reset Sequence_variant data member.
201  void ResetSequence_variant(void);
202 
203  /// Get the Sequence_variant member data.
204  ///
205  /// @return
206  /// Reference to the member data.
207  const TSequence_variant& GetSequence_variant(void) const;
208 
209  /// Assign a value to Sequence_variant data member.
210  ///
211  /// @param value
212  /// Reference to value.
214 
215  /// Assign a value to Sequence_variant data member.
216  ///
217  /// @return
218  /// Reference to the data value.
220 
221  /// Reset the whole object
222  virtual void Reset(void);
223 
224 
225 private:
226  // Prohibit copy constructor and assignment operator
229 
230  // data
232  string m_Input_expr;
235 };
236 
237 /* @} */
238 
239 
240 
241 
242 
243 ///////////////////////////////////////////////////////////
244 ///////////////////// inline methods //////////////////////
245 ///////////////////////////////////////////////////////////
246 inline
248 {
249  return ((m_set_State[0] & 0x3) != 0);
250 }
251 
252 inline
254 {
255  return IsSetInput_expr();
256 }
257 
258 inline
260 {
261  if (!CanGetInput_expr()) {
262  ThrowUnassigned(0);
263  }
264  return m_Input_expr;
265 }
266 
267 inline
269 {
271  m_set_State[0] |= 0x3;
272 }
273 
274 inline
276 {
277  m_Input_expr = std::forward<CVariantExpression_Base::TInput_expr>(value);
278  m_set_State[0] |= 0x3;
279 }
280 
281 inline
283 {
284 #ifdef _DEBUG
285  if (!IsSetInput_expr()) {
287  }
288 #endif
289  m_set_State[0] |= 0x1;
290  return m_Input_expr;
291 }
292 
293 inline
295 {
296  return ((m_set_State[0] & 0xc) != 0);
297 }
298 
299 inline
301 {
302  return IsSetReference_id();
303 }
304 
305 inline
307 {
308  if (!CanGetReference_id()) {
309  ThrowUnassigned(1);
310  }
311  return m_Reference_id;
312 }
313 
314 inline
316 {
318  m_set_State[0] |= 0xc;
319 }
320 
321 inline
323 {
324  m_Reference_id = std::forward<CVariantExpression_Base::TReference_id>(value);
325  m_set_State[0] |= 0xc;
326 }
327 
328 inline
330 {
331 #ifdef _DEBUG
332  if (!IsSetReference_id()) {
334  }
335 #endif
336  m_set_State[0] |= 0x4;
337  return m_Reference_id;
338 }
339 
340 inline
342 {
343  return m_Sequence_variant.NotEmpty();
344 }
345 
346 inline
348 {
349  return true;
350 }
351 
352 inline
354 {
355  if ( !m_Sequence_variant ) {
356  const_cast<CVariantExpression_Base*>(this)->ResetSequence_variant();
357  }
358  return (*m_Sequence_variant);
359 }
360 
361 inline
363 {
364  if ( !m_Sequence_variant ) {
366  }
367  return (*m_Sequence_variant);
368 }
369 
370 ///////////////////////////////////////////////////////////
371 ////////////////// end of inline methods //////////////////
372 ///////////////////////////////////////////////////////////
373 
374 
375 
376 
377 
378 END_objects_SCOPE // namespace ncbi::objects::
379 
381 
382 
383 #endif // OBJECTS_VARREP_VARIANTEXPRESSION_BASE_HPP
CRef –.
Definition: ncbiobj.hpp:618
CSequenceVariant –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
EXPORTS VariantExpression, SimpleVariant;.
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
CVariantExpression_Base & operator=(const CVariantExpression_Base &)
const TSequence_variant & GetSequence_variant(void) const
Get the Sequence_variant member data.
bool CanGetInput_expr(void) const
Check if it is safe to call GetInput_expr method.
virtual void Reset(void)
Reset the whole object.
CSequenceVariant TSequence_variant
TSequence_variant & SetSequence_variant(void)
Assign a value to Sequence_variant data member.
void ResetSequence_variant(void)
Reset Sequence_variant data member.
void ResetInput_expr(void)
Reset Input_expr data member.
const TInput_expr & GetInput_expr(void) const
Get the Input_expr member data.
void ResetReference_id(void)
Reset Reference_id data member.
CVariantExpression_Base(const CVariantExpression_Base &)
const TReference_id & GetReference_id(void) const
Get the Reference_id member data.
TInput_expr & SetInput_expr(void)
Assign a value to Input_expr data member.
CRef< TSequence_variant > m_Sequence_variant
bool IsSetSequence_variant(void) const
Check if a value has been assigned to Sequence_variant data member.
bool CanGetSequence_variant(void) const
Check if it is safe to call GetSequence_variant method.
bool IsSetInput_expr(void) const
contains the input expression to be parsed Check if a value has been assigned to Input_expr data memb...
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
TReference_id & SetReference_id(void)
Assign a value to Reference_id data member.
virtual ~CVariantExpression_Base(void)
bool IsSetReference_id(void) const
contains the accession id or other identifier for the reference sequence Check if a value has been as...
bool CanGetReference_id(void) const
Check if it is safe to call GetReference_id method.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sat May 25 14:21:52 2024 by modify_doxy.py rev. 669887