NCBI C++ ToolKit
Imp_feat_.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 Imp_feat_.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_IMP_FEAT_BASE_HPP
42 #define OBJECTS_SEQFEAT_IMP_FEAT_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_Seqfeat
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///*** Import ***********************************************
69 ///*
70 ///* Features imported from other databases
71 ///*
72 ///
73 /// CImp_feat_Base --
74 ///
75 
77 {
79 public:
80  // constructor
81  CImp_feat_Base(void);
82  // destructor
83  virtual ~CImp_feat_Base(void);
84 
85  // type info
87 
88  // types
89  typedef string TKey;
90  typedef string TLoc;
91  typedef string TDescr;
92 
93  // member index
94  enum class E_memberIndex {
95  e__allMandatory = 0,
96  e_key,
97  e_loc,
98  e_descr
99  };
101 
102  // getters
103  // setters
104 
105  /// Check if a value has been assigned to Key data member.
106  ///
107  /// Data member Key is mandatory;
108  /// its type is defined as 'typedef string TKey'
109  /// @return
110  /// - true, if a value has been assigned.
111  /// - false, otherwise.
112  bool IsSetKey(void) const;
113 
114  /// Check if it is safe to call GetKey method.
115  ///
116  /// @return
117  /// - true, if the data member is getatable.
118  /// - false, otherwise.
119  bool CanGetKey(void) const;
120 
121  /// Reset Key data member.
122  void ResetKey(void);
123 
124  /// Get the Key member data.
125  ///
126  /// @return
127  /// Reference to the member data.
128  const TKey& GetKey(void) const;
129 
130  /// Assign a value to Key data member.
131  ///
132  /// @param value
133  /// Value to assign
134  void SetKey(const TKey& value);
135  void SetKey(TKey&& value);
136 
137  /// Assign a value to Key data member.
138  ///
139  /// @return
140  /// Reference to the data value.
141  TKey& SetKey(void);
142 
143  /// original location string
144  /// Check if a value has been assigned to Loc data member.
145  ///
146  /// Data member Loc is optional;
147  /// its type is defined as 'typedef string TLoc'
148  /// @return
149  /// - true, if a value has been assigned.
150  /// - false, otherwise.
151  bool IsSetLoc(void) const;
152 
153  /// Check if it is safe to call GetLoc method.
154  ///
155  /// @return
156  /// - true, if the data member is getatable.
157  /// - false, otherwise.
158  bool CanGetLoc(void) const;
159 
160  /// Reset Loc data member.
161  void ResetLoc(void);
162 
163  /// Get the Loc member data.
164  ///
165  /// @return
166  /// Reference to the member data.
167  const TLoc& GetLoc(void) const;
168 
169  /// Assign a value to Loc data member.
170  ///
171  /// @param value
172  /// Value to assign
173  void SetLoc(const TLoc& value);
174  void SetLoc(TLoc&& value);
175 
176  /// Assign a value to Loc data member.
177  ///
178  /// @return
179  /// Reference to the data value.
180  TLoc& SetLoc(void);
181 
182  /// text description
183  /// Check if a value has been assigned to Descr data member.
184  ///
185  /// Data member Descr is optional;
186  /// its type is defined as 'typedef string TDescr'
187  /// @return
188  /// - true, if a value has been assigned.
189  /// - false, otherwise.
190  bool IsSetDescr(void) const;
191 
192  /// Check if it is safe to call GetDescr method.
193  ///
194  /// @return
195  /// - true, if the data member is getatable.
196  /// - false, otherwise.
197  bool CanGetDescr(void) const;
198 
199  /// Reset Descr data member.
200  void ResetDescr(void);
201 
202  /// Get the Descr member data.
203  ///
204  /// @return
205  /// Reference to the member data.
206  const TDescr& GetDescr(void) const;
207 
208  /// Assign a value to Descr data member.
209  ///
210  /// @param value
211  /// Value to assign
212  void SetDescr(const TDescr& value);
213  void SetDescr(TDescr&& value);
214 
215  /// Assign a value to Descr data member.
216  ///
217  /// @return
218  /// Reference to the data value.
219  TDescr& SetDescr(void);
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
231  Uint4 m_set_State[1];
232  string m_Key;
233  string m_Loc;
234  string m_Descr;
235 };
236 
237 /* @} */
238 
239 
240 
241 
242 
243 ///////////////////////////////////////////////////////////
244 ///////////////////// inline methods //////////////////////
245 ///////////////////////////////////////////////////////////
246 inline
247 bool CImp_feat_Base::IsSetKey(void) const
248 {
249  return ((m_set_State[0] & 0x3) != 0);
250 }
251 
252 inline
254 {
255  return IsSetKey();
256 }
257 
258 inline
260 {
261  if (!CanGetKey()) {
262  ThrowUnassigned(0);
263  }
264  return m_Key;
265 }
266 
267 inline
269 {
270  m_Key = value;
271  m_set_State[0] |= 0x3;
272 }
273 
274 inline
276 {
277  m_Key = std::forward<CImp_feat_Base::TKey>(value);
278  m_set_State[0] |= 0x3;
279 }
280 
281 inline
283 {
284 #ifdef _DEBUG
285  if (!IsSetKey()) {
287  }
288 #endif
289  m_set_State[0] |= 0x1;
290  return m_Key;
291 }
292 
293 inline
294 bool CImp_feat_Base::IsSetLoc(void) const
295 {
296  return ((m_set_State[0] & 0xc) != 0);
297 }
298 
299 inline
301 {
302  return IsSetLoc();
303 }
304 
305 inline
307 {
308  if (!CanGetLoc()) {
309  ThrowUnassigned(1);
310  }
311  return m_Loc;
312 }
313 
314 inline
316 {
317  m_Loc = value;
318  m_set_State[0] |= 0xc;
319 }
320 
321 inline
323 {
324  m_Loc = std::forward<CImp_feat_Base::TLoc>(value);
325  m_set_State[0] |= 0xc;
326 }
327 
328 inline
330 {
331 #ifdef _DEBUG
332  if (!IsSetLoc()) {
334  }
335 #endif
336  m_set_State[0] |= 0x4;
337  return m_Loc;
338 }
339 
340 inline
342 {
343  return ((m_set_State[0] & 0x30) != 0);
344 }
345 
346 inline
348 {
349  return IsSetDescr();
350 }
351 
352 inline
354 {
355  if (!CanGetDescr()) {
356  ThrowUnassigned(2);
357  }
358  return m_Descr;
359 }
360 
361 inline
363 {
364  m_Descr = value;
365  m_set_State[0] |= 0x30;
366 }
367 
368 inline
370 {
371  m_Descr = std::forward<CImp_feat_Base::TDescr>(value);
372  m_set_State[0] |= 0x30;
373 }
374 
375 inline
377 {
378 #ifdef _DEBUG
379  if (!IsSetDescr()) {
381  }
382 #endif
383  m_set_State[0] |= 0x10;
384  return m_Descr;
385 }
386 
387 ///////////////////////////////////////////////////////////
388 ////////////////// end of inline methods //////////////////
389 ///////////////////////////////////////////////////////////
390 
391 
392 
393 
394 
395 END_objects_SCOPE // namespace ncbi::objects::
396 
398 
399 
400 #endif // OBJECTS_SEQFEAT_IMP_FEAT_BASE_HPP
*** Import *********************************************** * * Features imported from other databases...
Definition: Imp_feat_.hpp:77
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
const TKey & GetKey(void) const
Get the Key member data.
Definition: Imp_feat_.hpp:259
bool IsSetLoc(void) const
original location string Check if a value has been assigned to Loc data member.
Definition: Imp_feat_.hpp:294
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
Definition: Imp_feat_.hpp:100
bool IsSetDescr(void) const
text description Check if a value has been assigned to Descr data member.
Definition: Imp_feat_.hpp:341
bool IsSetKey(void) const
Check if a value has been assigned to Key data member.
Definition: Imp_feat_.hpp:247
CImp_feat_Base(const CImp_feat_Base &)
DECLARE_INTERNAL_TYPE_INFO()
const TDescr & GetDescr(void) const
Get the Descr member data.
Definition: Imp_feat_.hpp:353
TKey & SetKey(void)
Assign a value to Key data member.
Definition: Imp_feat_.hpp:282
CSerialObject Tparent
Definition: Imp_feat_.hpp:78
bool CanGetDescr(void) const
Check if it is safe to call GetDescr method.
Definition: Imp_feat_.hpp:347
TLoc & SetLoc(void)
Assign a value to Loc data member.
Definition: Imp_feat_.hpp:329
bool CanGetKey(void) const
Check if it is safe to call GetKey method.
Definition: Imp_feat_.hpp:253
TDescr & SetDescr(void)
Assign a value to Descr data member.
Definition: Imp_feat_.hpp:376
CImp_feat_Base & operator=(const CImp_feat_Base &)
const TLoc & GetLoc(void) const
Get the Loc member data.
Definition: Imp_feat_.hpp:306
Uint4 m_set_State[1]
Definition: Imp_feat_.hpp:231
bool CanGetLoc(void) const
Check if it is safe to call GetLoc method.
Definition: Imp_feat_.hpp:300
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
int GetLoc(const string &acc, const string &pat, CSeq_loc &loc, CScope &scope)
Modified on Wed Apr 17 13:10:40 2024 by modify_doxy.py rev. 669887