NCBI C++ ToolKit
MSModHit_.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 MSModHit_.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/omssa/omssa.asn">omssa.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/omssa/omssa.def">omssa.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_OMSSA_MSMODHIT_BASE_HPP
42 #define OBJECTS_OMSSA_MSMODHIT_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <objects/omssa/MSMod.hpp>
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_OMSSA
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 /// modifications to a hit peptide
69 ///
70 /// CMSModHit_Base --
71 ///
72 
74 {
76 public:
77  // constructor
78  CMSModHit_Base(void);
79  // destructor
80  virtual ~CMSModHit_Base(void);
81 
82  // type info
84 
85  // types
86  typedef int TSite;
87  typedef int TModtype;
88 
89  // member index
90  enum class E_memberIndex {
91  e__allMandatory = 0,
92  e_site,
93  e_modtype
94  };
96 
97  // getters
98  // setters
99 
100  /// the position in the peptide
101  /// Check if a value has been assigned to Site data member.
102  ///
103  /// Data member Site is mandatory;
104  /// its type is defined as 'typedef int TSite'
105  /// @return
106  /// - true, if a value has been assigned.
107  /// - false, otherwise.
108  bool IsSetSite(void) const;
109 
110  /// Check if it is safe to call GetSite method.
111  ///
112  /// @return
113  /// - true, if the data member is getatable.
114  /// - false, otherwise.
115  bool CanGetSite(void) const;
116 
117  /// Reset Site data member.
118  void ResetSite(void);
119 
120  /// Get the Site member data.
121  ///
122  /// @return
123  /// Copy of the member data.
124  TSite GetSite(void) const;
125 
126  /// Assign a value to Site data member.
127  ///
128  /// @param value
129  /// Value to assign
130  void SetSite(TSite value);
131 
132  /// Assign a value to Site data member.
133  ///
134  /// @return
135  /// Reference to the data value.
136  TSite& SetSite(void);
137 
138  /// the type of modification
139  /// Check if a value has been assigned to Modtype data member.
140  ///
141  /// Data member Modtype is mandatory;
142  /// its type is defined as 'typedef int TModtype'
143  /// @return
144  /// - true, if a value has been assigned.
145  /// - false, otherwise.
146  bool IsSetModtype(void) const;
147 
148  /// Check if it is safe to call GetModtype method.
149  ///
150  /// @return
151  /// - true, if the data member is getatable.
152  /// - false, otherwise.
153  bool CanGetModtype(void) const;
154 
155  /// Reset Modtype data member.
156  void ResetModtype(void);
157 
158  /// Get the Modtype member data.
159  ///
160  /// @return
161  /// Copy of the member data.
162  TModtype GetModtype(void) const;
163 
164  /// Assign a value to Modtype data member.
165  ///
166  /// @param value
167  /// Value to assign
168  void SetModtype(TModtype value);
169 
170  /// Assign a value to Modtype data member.
171  ///
172  /// @return
173  /// Reference to the data value.
174  TModtype& SetModtype(void);
175 
176  /// Reset the whole object
177  virtual void Reset(void);
178 
179 
180 private:
181  // Prohibit copy constructor and assignment operator
184 
185  // data
186  Uint4 m_set_State[1];
187  int m_Site;
189 };
190 
191 /* @} */
192 
193 
194 
195 
196 
197 ///////////////////////////////////////////////////////////
198 ///////////////////// inline methods //////////////////////
199 ///////////////////////////////////////////////////////////
200 inline
202 {
203  return ((m_set_State[0] & 0x3) != 0);
204 }
205 
206 inline
208 {
209  return IsSetSite();
210 }
211 
212 inline
214 {
215  m_Site = 0;
216  m_set_State[0] &= ~0x3;
217 }
218 
219 inline
221 {
222  if (!CanGetSite()) {
223  ThrowUnassigned(0);
224  }
225  return m_Site;
226 }
227 
228 inline
230 {
231  m_Site = value;
232  m_set_State[0] |= 0x3;
233 }
234 
235 inline
237 {
238 #ifdef _DEBUG
239  if (!IsSetSite()) {
240  memset(&m_Site,UnassignedByte(),sizeof(m_Site));
241  }
242 #endif
243  m_set_State[0] |= 0x1;
244  return m_Site;
245 }
246 
247 inline
249 {
250  return ((m_set_State[0] & 0xc) != 0);
251 }
252 
253 inline
255 {
256  return IsSetModtype();
257 }
258 
259 inline
261 {
262  m_Modtype = (int)(0);
263  m_set_State[0] &= ~0xc;
264 }
265 
266 inline
268 {
269  if (!CanGetModtype()) {
270  ThrowUnassigned(1);
271  }
272  return m_Modtype;
273 }
274 
275 inline
277 {
278  m_Modtype = value;
279  m_set_State[0] |= 0xc;
280 }
281 
282 inline
284 {
285 #ifdef _DEBUG
286  if (!IsSetModtype()) {
287  memset(&m_Modtype,UnassignedByte(),sizeof(m_Modtype));
288  }
289 #endif
290  m_set_State[0] |= 0x4;
291  return m_Modtype;
292 }
293 
294 ///////////////////////////////////////////////////////////
295 ////////////////// end of inline methods //////////////////
296 ///////////////////////////////////////////////////////////
297 
298 
299 
300 
301 
302 END_objects_SCOPE // namespace ncbi::objects::
303 
305 
306 
307 #endif // OBJECTS_OMSSA_MSMODHIT_BASE_HPP
modifications to a hit peptide
Definition: MSModHit_.hpp:74
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_OMSSA_EXPORT
Definition: ncbi_export.h:672
CMSModHit_Base(const CMSModHit_Base &)
void ResetSite(void)
Reset Site data member.
Definition: MSModHit_.hpp:213
TModtype GetModtype(void) const
Get the Modtype member data.
Definition: MSModHit_.hpp:267
TSite & SetSite(void)
Assign a value to Site data member.
Definition: MSModHit_.hpp:236
void ResetModtype(void)
Reset Modtype data member.
Definition: MSModHit_.hpp:260
CSerialObject Tparent
Definition: MSModHit_.hpp:75
DECLARE_INTERNAL_TYPE_INFO()
bool CanGetSite(void) const
Check if it is safe to call GetSite method.
Definition: MSModHit_.hpp:207
Uint4 m_set_State[1]
Definition: MSModHit_.hpp:186
TSite GetSite(void) const
Get the Site member data.
Definition: MSModHit_.hpp:220
CMSModHit_Base & operator=(const CMSModHit_Base &)
bool IsSetModtype(void) const
the type of modification Check if a value has been assigned to Modtype data member.
Definition: MSModHit_.hpp:248
TModtype & SetModtype(void)
Assign a value to Modtype data member.
Definition: MSModHit_.hpp:283
bool CanGetModtype(void) const
Check if it is safe to call GetModtype method.
Definition: MSModHit_.hpp:254
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
Definition: MSModHit_.hpp:95
bool IsSetSite(void) const
the position in the peptide Check if a value has been assigned to Site data member.
Definition: MSModHit_.hpp:201
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
Modified on Tue Dec 05 02:17:45 2023 by modify_doxy.py rev. 669887