NCBI C++ ToolKit
Inputfile_.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 Inputfile_.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/algo/ms/formats/pepxml/pepXML.xsd">pepXML.xsd</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/algo/ms/formats/pepxml/pepXML.def">pepXML.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 ALGO_MS_FORMATS_PEPXML_INPUTFILE_BASE_HPP
42 #define ALGO_MS_FORMATS_PEPXML_INPUTFILE_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_pepXML
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///
69 /// CInputfile_Base --
70 ///
71 
73 {
75 public:
76  // constructor
77  CInputfile_Base(void);
78  // destructor
79  virtual ~CInputfile_Base(void);
80 
81  // type info
83 
84  /////////////////////////////////////////////////////////////////////////////
85  ///
86  /// C_Attlist --
87  ///
88 
90  {
92  public:
93  // constructor
94  C_Attlist(void);
95  // destructor
96  ~C_Attlist(void);
97 
98  // type info
100 
101  // types
102  typedef string TName;
103 
104  // member index
105  enum class E_memberIndex {
106  e__allMandatory = 0,
107  e_name
108  };
110 
111  // getters
112  // setters
113 
114  /// Check if a value has been assigned to Name data member.
115  ///
116  /// Data member Name is mandatory;
117  /// its type is defined as 'typedef string TName'
118  /// @return
119  /// - true, if a value has been assigned.
120  /// - false, otherwise.
121  bool IsSetName(void) const;
122 
123  /// Check if it is safe to call GetName method.
124  ///
125  /// @return
126  /// - true, if the data member is getatable.
127  /// - false, otherwise.
128  bool CanGetName(void) const;
129 
130  /// Reset Name data member.
131  void ResetName(void);
132 
133  /// Get the Name member data.
134  ///
135  /// @return
136  /// Reference to the member data.
137  const TName& GetName(void) const;
138 
139  /// Assign a value to Name data member.
140  ///
141  /// @param value
142  /// Value to assign
143  void SetName(const TName& value);
144  void SetName(TName&& value);
145 
146  /// Assign a value to Name data member.
147  ///
148  /// @return
149  /// Reference to the data value.
150  TName& SetName(void);
151 
152  /// Reset the whole object
153  void Reset(void);
154 
155 
156  private:
157  // Prohibit copy constructor and assignment operator
160 
161  // data
162  Uint4 m_set_State[1];
163  string m_Name;
164  };
165  // types
167 
168  // member index
169  enum class E_memberIndex {
170  e__allMandatory = 0,
171  e_Attlist,
172  e_inputfile
173  };
175 
176  // getters
177  // setters
178 
179  /// Check if a value has been assigned to Attlist data member.
180  ///
181  /// Data member Attlist is mandatory;
182  /// its type is defined as 'typedef C_Attlist TAttlist'
183  /// @return
184  /// - true, if a value has been assigned.
185  /// - false, otherwise.
186  bool IsSetAttlist(void) const;
187 
188  /// Check if it is safe to call GetAttlist method.
189  ///
190  /// @return
191  /// - true, if the data member is getatable.
192  /// - false, otherwise.
193  bool CanGetAttlist(void) const;
194 
195  /// Reset Attlist data member.
196  void ResetAttlist(void);
197 
198  /// Get the Attlist member data.
199  ///
200  /// @return
201  /// Reference to the member data.
202  const TAttlist& GetAttlist(void) const;
203 
204  /// Assign a value to Attlist data member.
205  ///
206  /// @param value
207  /// Reference to value.
208  void SetAttlist(TAttlist& value);
209 
210  /// Assign a value to Attlist data member.
211  ///
212  /// @return
213  /// Reference to the data value.
214  TAttlist& SetAttlist(void);
215 
216  /// Check if a value has been assigned to Inputfile data member.
217  ///
218  /// Data member Inputfile is mandatory
219  /// @return
220  /// - true, if a value has been assigned.
221  /// - false, otherwise.
222  bool IsSetInputfile(void) const;
223 
224  /// Check if value of Inputfile member is getatable.
225  ///
226  /// @return
227  /// - false; the data member of type 'NULL' has no value.
228  bool CanGetInputfile(void) const;
229 
230  /// Reset Inputfile data member.
231  void ResetInputfile(void);
232 
233  /// Set NULL data member (assign 'NULL' value to Inputfile data member).
234  void SetInputfile(void);
235 
236  /// Reset the whole object
237  virtual void Reset(void);
238 
239 
240 private:
241  // Prohibit copy constructor and assignment operator
244 
245  // data
246  Uint4 m_set_State[1];
248 };
249 
250 /* @} */
251 
252 
253 
254 
255 
256 ///////////////////////////////////////////////////////////
257 ///////////////////// inline methods //////////////////////
258 ///////////////////////////////////////////////////////////
259 inline
261 {
262  return ((m_set_State[0] & 0x3) != 0);
263 }
264 
265 inline
267 {
268  return IsSetName();
269 }
270 
271 inline
273 {
274  if (!CanGetName()) {
275  ThrowUnassigned(0);
276  }
277  return m_Name;
278 }
279 
280 inline
282 {
283  m_Name = value;
284  m_set_State[0] |= 0x3;
285 }
286 
287 inline
289 {
290  m_Name = std::forward<CInputfile_Base::C_Attlist::TName>(value);
291  m_set_State[0] |= 0x3;
292 }
293 
294 inline
296 {
297 #ifdef _DEBUG
298  if (!IsSetName()) {
299  m_Name = UnassignedString();
300  }
301 #endif
302  m_set_State[0] |= 0x1;
303  return m_Name;
304 }
305 
306 inline
308 {
309  return m_Attlist.NotEmpty();
310 }
311 
312 inline
314 {
315  return true;
316 }
317 
318 inline
320 {
321  if ( !m_Attlist ) {
322  const_cast<CInputfile_Base*>(this)->ResetAttlist();
323  }
324  return (*m_Attlist);
325 }
326 
327 inline
329 {
330  if ( !m_Attlist ) {
331  ResetAttlist();
332  }
333  SetInputfile();
334  return (*m_Attlist);
335 }
336 
337 inline
339 {
340  return ((m_set_State[0] & 0xc) != 0);
341 }
342 
343 inline
345 {
346  return false;
347 }
348 
349 inline
351 {
352  m_set_State[0] &= ~0xc;
353 }
354 
355 inline
357 {
358  m_set_State[0] |= 0xc;
359 }
360 
361 ///////////////////////////////////////////////////////////
362 ////////////////// end of inline methods //////////////////
363 ///////////////////////////////////////////////////////////
364 
365 
366 
367 
368 
369 END_objects_SCOPE // namespace ncbi::objects::
370 
372 
373 
374 #endif // ALGO_MS_FORMATS_PEPXML_INPUTFILE_BASE_HPP
CInputfile_Base –.
Definition: Inputfile_.hpp:73
CRef –.
Definition: ncbiobj.hpp:618
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_PEPXML_EXPORT
Definition: ncbi_export.h:696
CInputfile_Base(const CInputfile_Base &)
const TName & GetName(void) const
Get the Name member data.
Definition: Inputfile_.hpp:272
void ResetAttlist(void)
Reset Attlist data member.
Definition: Inputfile_.cpp:84
Uint4 m_set_State[1]
Definition: Inputfile_.hpp:246
C_Attlist & operator=(const C_Attlist &)
void SetInputfile(void)
Set NULL data member (assign 'NULL' value to Inputfile data member).
Definition: Inputfile_.hpp:356
Tparent::CMemberIndex< E_memberIndex, 2 > TmemberIndex
Definition: Inputfile_.hpp:109
CRef< TAttlist > m_Attlist
Definition: Inputfile_.hpp:247
bool IsSetName(void) const
Check if a value has been assigned to Name data member.
Definition: Inputfile_.hpp:260
CInputfile_Base & operator=(const CInputfile_Base &)
void ResetInputfile(void)
Reset Inputfile data member.
Definition: Inputfile_.hpp:350
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
Definition: Inputfile_.hpp:174
TAttlist & SetAttlist(void)
Assign a value to Attlist data member.
Definition: Inputfile_.hpp:328
bool CanGetName(void) const
Check if it is safe to call GetName method.
Definition: Inputfile_.hpp:266
TName & SetName(void)
Assign a value to Name data member.
Definition: Inputfile_.hpp:295
const TAttlist & GetAttlist(void) const
Get the Attlist member data.
Definition: Inputfile_.hpp:319
bool IsSetInputfile(void) const
Check if a value has been assigned to Inputfile data member.
Definition: Inputfile_.hpp:338
CSerialObject Tparent
Definition: Inputfile_.hpp:74
C_Attlist TAttlist
Definition: Inputfile_.hpp:166
C_Attlist(const C_Attlist &)
bool CanGetInputfile(void) const
Check if value of Inputfile member is getatable.
Definition: Inputfile_.hpp:344
bool CanGetAttlist(void) const
Check if it is safe to call GetAttlist method.
Definition: Inputfile_.hpp:313
bool IsSetAttlist(void) const
Check if a value has been assigned to Attlist data member.
Definition: Inputfile_.hpp:307
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed Apr 24 14:20:03 2024 by modify_doxy.py rev. 669887