NCBI C++ ToolKit
ID2_Request_Get_Seq_id_.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 ID2_Request_Get_Seq_id_.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/id2/id2.asn">id2.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/id2/id2.def">id2.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_ID2_ID2_REQUEST_GET_SEQ_ID_BASE_HPP
42 #define OBJECTS_ID2_ID2_REQUEST_GET_SEQ_ID_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 // forward declarations
56 class CID2_Seq_id;
57 
58 
59 // generated classes
60 
61 
62 /** @addtogroup dataspec_NCBI_ID2Access
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 /// Requested sequence ID, can be any string or Seq-id.
69 /// This request will be replied with one or more ID2-Reply-Get-Seq-id.
70 ///
71 /// CID2_Request_Get_Seq_id_Base --
72 ///
73 
75 {
77 public:
78  // constructor
80  // destructor
81  virtual ~CID2_Request_Get_Seq_id_Base(void);
82 
83  // type info
85 
86  enum ESeq_id_type {
87  eSeq_id_type_any = 0, ///< return any qualified Seq-id
88  eSeq_id_type_gi = 1, ///< gi is preferred
89  eSeq_id_type_text = 2, ///< text Seq-id (accession etc) is preferred
90  eSeq_id_type_general = 4, ///< general Seq-id is preferred
91  eSeq_id_type_all = 127, ///< return all qualified Seq-ids of the sequence
92  eSeq_id_type_label = 128, ///< return a sequence string label as string in general id with db "LABEL"
93  eSeq_id_type_taxid = 256, ///< return a sequence taxonomy ID as integer in general id with db "TAXID"
94  eSeq_id_type_hash = 512, ///< return a sequence hash as integer in general id with db "HASH"
95  eSeq_id_type_seq_length = 1024, ///< return a sequence Seq-inst.length as int in general id with db "Seq-inst.length"
96  eSeq_id_type_seq_mol = 2048 ///< return a sequence Seq-inst.mol as int in general id with db "Seq-inst.mol"
97  };
98 
99  /// Access to ESeq_id_type's attributes (values, names) as defined in spec
100  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(ESeq_id_type)(void);
101 
102  // types
104  typedef int TSeq_id_type;
105 
106  // member index
107  enum class E_memberIndex {
108  e__allMandatory = 0,
109  e_seq_id,
110  e_seq_id_type
111  };
113 
114  // getters
115  // setters
116 
117  /// Check if a value has been assigned to Seq_id data member.
118  ///
119  /// Data member Seq_id is mandatory;
120  /// its type is defined as 'typedef CID2_Seq_id TSeq_id'
121  /// @return
122  /// - true, if a value has been assigned.
123  /// - false, otherwise.
124  bool IsSetSeq_id(void) const;
125 
126  /// Check if it is safe to call GetSeq_id method.
127  ///
128  /// @return
129  /// - true, if the data member is getatable.
130  /// - false, otherwise.
131  bool CanGetSeq_id(void) const;
132 
133  /// Reset Seq_id data member.
134  void ResetSeq_id(void);
135 
136  /// Get the Seq_id member data.
137  ///
138  /// @return
139  /// Reference to the member data.
140  const TSeq_id& GetSeq_id(void) const;
141 
142  /// Assign a value to Seq_id data member.
143  ///
144  /// @param value
145  /// Reference to value.
146  void SetSeq_id(TSeq_id& value);
147 
148  /// Assign a value to Seq_id data member.
149  ///
150  /// @return
151  /// Reference to the data value.
152  TSeq_id& SetSeq_id(void);
153 
154  /// Check if a value has been assigned to Seq_id_type data member.
155  ///
156  /// Data member Seq_id_type is optional with default eSeq_id_type_any;
157  /// its type is defined as 'typedef int TSeq_id_type'
158  /// @return
159  /// - true, if a value has been assigned.
160  /// - false, otherwise.
161  bool IsSetSeq_id_type(void) const;
162 
163  /// Check if it is safe to call GetSeq_id_type method.
164  ///
165  /// @return
166  /// - true, if the data member is getatable.
167  /// - false, otherwise.
168  bool CanGetSeq_id_type(void) const;
169 
170  /// Reset Seq_id_type data member.
171  void ResetSeq_id_type(void);
172 
173  /// Assign default value to Seq_id_type data member.
174  void SetDefaultSeq_id_type(void);
175 
176  /// Get the Seq_id_type member data.
177  ///
178  /// @return
179  /// Copy of the member data.
180  TSeq_id_type GetSeq_id_type(void) const;
181 
182  /// Assign a value to Seq_id_type data member.
183  ///
184  /// @param value
185  /// Value to assign
186  void SetSeq_id_type(TSeq_id_type value);
187 
188  /// Assign a value to Seq_id_type data member.
189  ///
190  /// @return
191  /// Reference to the data value.
192  TSeq_id_type& SetSeq_id_type(void);
193 
194  /// Reset the whole object
195  virtual void Reset(void);
196 
197 
198 private:
199  // Prohibit copy constructor and assignment operator
202 
203  // data
204  Uint4 m_set_State[1];
207 };
208 
209 /* @} */
210 
211 
212 
213 
214 
215 ///////////////////////////////////////////////////////////
216 ///////////////////// inline methods //////////////////////
217 ///////////////////////////////////////////////////////////
218 inline
220 {
221  return m_Seq_id.NotEmpty();
222 }
223 
224 inline
226 {
227  return true;
228 }
229 
230 inline
232 {
233  if ( !m_Seq_id ) {
234  const_cast<CID2_Request_Get_Seq_id_Base*>(this)->ResetSeq_id();
235  }
236  return (*m_Seq_id);
237 }
238 
239 inline
241 {
242  if ( !m_Seq_id ) {
243  ResetSeq_id();
244  }
245  return (*m_Seq_id);
246 }
247 
248 inline
250 {
251  return ((m_set_State[0] & 0xc) != 0);
252 }
253 
254 inline
256 {
257  return true;
258 }
259 
260 inline
262 {
264  m_set_State[0] &= ~0xc;
265 }
266 
267 inline
269 {
271 }
272 
273 inline
275 {
276  return m_Seq_id_type;
277 }
278 
279 inline
281 {
283  m_set_State[0] |= 0xc;
284 }
285 
286 inline
288 {
289 #ifdef _DEBUG
290  if (!IsSetSeq_id_type()) {
291  memset(&m_Seq_id_type,UnassignedByte(),sizeof(m_Seq_id_type));
292  }
293 #endif
294  m_set_State[0] |= 0x4;
295  return m_Seq_id_type;
296 }
297 
298 ///////////////////////////////////////////////////////////
299 ////////////////// end of inline methods //////////////////
300 ///////////////////////////////////////////////////////////
301 
302 
303 
304 
305 
306 END_objects_SCOPE // namespace ncbi::objects::
307 
309 
310 
311 #endif // OBJECTS_ID2_ID2_REQUEST_GET_SEQ_ID_BASE_HPP
Requested sequence ID, can be any string or Seq-id.
CID2_Seq_id –.
Definition: ID2_Seq_id.hpp:66
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
static char UnassignedByte(void)
Definition: serialbase.hpp:181
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
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 IsSetSeq_id_type(void) const
Check if a value has been assigned to Seq_id_type data member.
CID2_Request_Get_Seq_id_Base(const CID2_Request_Get_Seq_id_Base &)
void SetDefaultSeq_id_type(void)
Assign default value to Seq_id_type data member.
bool CanGetSeq_id(void) const
Check if it is safe to call GetSeq_id method.
TSeq_id_type GetSeq_id_type(void) const
Get the Seq_id_type member data.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
TSeq_id & SetSeq_id(void)
Assign a value to Seq_id data member.
TSeq_id_type & SetSeq_id_type(void)
Assign a value to Seq_id_type data member.
CID2_Request_Get_Seq_id_Base & operator=(const CID2_Request_Get_Seq_id_Base &)
bool IsSetSeq_id(void) const
Check if a value has been assigned to Seq_id data member.
bool CanGetSeq_id_type(void) const
Check if it is safe to call GetSeq_id_type method.
void ResetSeq_id_type(void)
Reset Seq_id_type data member.
const TSeq_id & GetSeq_id(void) const
Get the Seq_id member data.
void ResetSeq_id(void)
Reset Seq_id data member.
@ eSeq_id_type_any
return any qualified Seq-id
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Thu Jul 11 17:53:47 2024 by modify_doxy.py rev. 669887