NCBI C++ ToolKit
Int_graph_.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 Int_graph_.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/seqres/seqres.asn">seqres.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqres/seqres.def">seqres.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_SEQRES_INT_GRAPH_BASE_HPP
42 #define OBJECTS_SEQRES_INT_GRAPH_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <vector>
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_Seqres
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///
69 /// CInt_graph_Base --
70 ///
71 
73 {
75 public:
76  // constructor
77  CInt_graph_Base(void);
78  // destructor
79  virtual ~CInt_graph_Base(void);
80 
81  // type info
83 
84  // types
85  typedef int TMax;
86  typedef int TMin;
87  typedef int TAxis;
88  typedef vector< int > TValues;
89 
90  // member index
91  enum class E_memberIndex {
92  e__allMandatory = 0,
93  e_max,
94  e_min,
95  e_axis,
96  e_values
97  };
99 
100  // getters
101  // setters
102 
103  /// Check if a value has been assigned to Max data member.
104  ///
105  /// Data member Max is mandatory;
106  /// its type is defined as 'typedef int TMax'
107  /// @return
108  /// - true, if a value has been assigned.
109  /// - false, otherwise.
110  bool IsSetMax(void) const;
111 
112  /// Check if it is safe to call GetMax method.
113  ///
114  /// @return
115  /// - true, if the data member is getatable.
116  /// - false, otherwise.
117  bool CanGetMax(void) const;
118 
119  /// Reset Max data member.
120  void ResetMax(void);
121 
122  /// Get the Max member data.
123  ///
124  /// @return
125  /// Copy of the member data.
126  TMax GetMax(void) const;
127 
128  /// Assign a value to Max data member.
129  ///
130  /// @param value
131  /// Value to assign
132  void SetMax(TMax value);
133 
134  /// Assign a value to Max data member.
135  ///
136  /// @return
137  /// Reference to the data value.
138  TMax& SetMax(void);
139 
140  /// Check if a value has been assigned to Min data member.
141  ///
142  /// Data member Min is mandatory;
143  /// its type is defined as 'typedef int TMin'
144  /// @return
145  /// - true, if a value has been assigned.
146  /// - false, otherwise.
147  bool IsSetMin(void) const;
148 
149  /// Check if it is safe to call GetMin method.
150  ///
151  /// @return
152  /// - true, if the data member is getatable.
153  /// - false, otherwise.
154  bool CanGetMin(void) const;
155 
156  /// Reset Min data member.
157  void ResetMin(void);
158 
159  /// Get the Min member data.
160  ///
161  /// @return
162  /// Copy of the member data.
163  TMin GetMin(void) const;
164 
165  /// Assign a value to Min data member.
166  ///
167  /// @param value
168  /// Value to assign
169  void SetMin(TMin value);
170 
171  /// Assign a value to Min data member.
172  ///
173  /// @return
174  /// Reference to the data value.
175  TMin& SetMin(void);
176 
177  /// Check if a value has been assigned to Axis data member.
178  ///
179  /// Data member Axis is mandatory;
180  /// its type is defined as 'typedef int TAxis'
181  /// @return
182  /// - true, if a value has been assigned.
183  /// - false, otherwise.
184  bool IsSetAxis(void) const;
185 
186  /// Check if it is safe to call GetAxis method.
187  ///
188  /// @return
189  /// - true, if the data member is getatable.
190  /// - false, otherwise.
191  bool CanGetAxis(void) const;
192 
193  /// Reset Axis data member.
194  void ResetAxis(void);
195 
196  /// Get the Axis member data.
197  ///
198  /// @return
199  /// Copy of the member data.
200  TAxis GetAxis(void) const;
201 
202  /// Assign a value to Axis data member.
203  ///
204  /// @param value
205  /// Value to assign
206  void SetAxis(TAxis value);
207 
208  /// Assign a value to Axis data member.
209  ///
210  /// @return
211  /// Reference to the data value.
212  TAxis& SetAxis(void);
213 
214  /// Check if a value has been assigned to Values data member.
215  ///
216  /// Data member Values is mandatory;
217  /// its type is defined as 'typedef vector< int > TValues'
218  /// @return
219  /// - true, if a value has been assigned.
220  /// - false, otherwise.
221  bool IsSetValues(void) const;
222 
223  /// Check if it is safe to call GetValues method.
224  ///
225  /// @return
226  /// - true, if the data member is getatable.
227  /// - false, otherwise.
228  bool CanGetValues(void) const;
229 
230  /// Reset Values data member.
231  void ResetValues(void);
232 
233  /// Get the Values member data.
234  ///
235  /// @return
236  /// Reference to the member data.
237  const TValues& GetValues(void) const;
238 
239  /// Assign a value to Values data member.
240  ///
241  /// @return
242  /// Reference to the data value.
243  TValues& SetValues(void);
244 
245  /// Reset the whole object
246  virtual void Reset(void);
247 
248 
249 private:
250  // Prohibit copy constructor and assignment operator
253 
254  // data
255  Uint4 m_set_State[1];
256  int m_Max;
257  int m_Min;
258  int m_Axis;
259  vector< int > m_Values;
260 };
261 
262 /* @} */
263 
264 
265 
266 
267 
268 ///////////////////////////////////////////////////////////
269 ///////////////////// inline methods //////////////////////
270 ///////////////////////////////////////////////////////////
271 inline
273 {
274  return ((m_set_State[0] & 0x3) != 0);
275 }
276 
277 inline
279 {
280  return IsSetMax();
281 }
282 
283 inline
285 {
286  m_Max = 0;
287  m_set_State[0] &= ~0x3;
288 }
289 
290 inline
292 {
293  if (!CanGetMax()) {
294  ThrowUnassigned(0);
295  }
296  return m_Max;
297 }
298 
299 inline
301 {
302  m_Max = value;
303  m_set_State[0] |= 0x3;
304 }
305 
306 inline
308 {
309 #ifdef _DEBUG
310  if (!IsSetMax()) {
311  memset(&m_Max,UnassignedByte(),sizeof(m_Max));
312  }
313 #endif
314  m_set_State[0] |= 0x1;
315  return m_Max;
316 }
317 
318 inline
320 {
321  return ((m_set_State[0] & 0xc) != 0);
322 }
323 
324 inline
326 {
327  return IsSetMin();
328 }
329 
330 inline
332 {
333  m_Min = 0;
334  m_set_State[0] &= ~0xc;
335 }
336 
337 inline
339 {
340  if (!CanGetMin()) {
341  ThrowUnassigned(1);
342  }
343  return m_Min;
344 }
345 
346 inline
348 {
349  m_Min = value;
350  m_set_State[0] |= 0xc;
351 }
352 
353 inline
355 {
356 #ifdef _DEBUG
357  if (!IsSetMin()) {
358  memset(&m_Min,UnassignedByte(),sizeof(m_Min));
359  }
360 #endif
361  m_set_State[0] |= 0x4;
362  return m_Min;
363 }
364 
365 inline
367 {
368  return ((m_set_State[0] & 0x30) != 0);
369 }
370 
371 inline
373 {
374  return IsSetAxis();
375 }
376 
377 inline
379 {
380  m_Axis = 0;
381  m_set_State[0] &= ~0x30;
382 }
383 
384 inline
386 {
387  if (!CanGetAxis()) {
388  ThrowUnassigned(2);
389  }
390  return m_Axis;
391 }
392 
393 inline
395 {
396  m_Axis = value;
397  m_set_State[0] |= 0x30;
398 }
399 
400 inline
402 {
403 #ifdef _DEBUG
404  if (!IsSetAxis()) {
405  memset(&m_Axis,UnassignedByte(),sizeof(m_Axis));
406  }
407 #endif
408  m_set_State[0] |= 0x10;
409  return m_Axis;
410 }
411 
412 inline
414 {
415  return ((m_set_State[0] & 0xc0) != 0);
416 }
417 
418 inline
420 {
421  return true;
422 }
423 
424 inline
426 {
427  return m_Values;
428 }
429 
430 inline
432 {
433  m_set_State[0] |= 0x40;
434  return m_Values;
435 }
436 
437 ///////////////////////////////////////////////////////////
438 ////////////////// end of inline methods //////////////////
439 ///////////////////////////////////////////////////////////
440 
441 
442 
443 
444 
445 END_objects_SCOPE // namespace ncbi::objects::
446 
448 
449 
450 #endif // OBJECTS_SEQRES_INT_GRAPH_BASE_HPP
CInt_graph_Base –.
Definition: Int_graph_.hpp:73
Base class for all serializable objects.
Definition: serialbase.hpp:150
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_SEQRES_EXPORT
Definition: ncbi_export.h:785
bool CanGetMin(void) const
Check if it is safe to call GetMin method.
Definition: Int_graph_.hpp:325
TMax & SetMax(void)
Assign a value to Max data member.
Definition: Int_graph_.hpp:307
CSerialObject Tparent
Definition: Int_graph_.hpp:74
bool IsSetValues(void) const
Check if a value has been assigned to Values data member.
Definition: Int_graph_.hpp:413
Uint4 m_set_State[1]
Definition: Int_graph_.hpp:255
void ResetMin(void)
Reset Min data member.
Definition: Int_graph_.hpp:331
bool IsSetMax(void) const
Check if a value has been assigned to Max data member.
Definition: Int_graph_.hpp:272
TMin & SetMin(void)
Assign a value to Min data member.
Definition: Int_graph_.hpp:354
TAxis & SetAxis(void)
Assign a value to Axis data member.
Definition: Int_graph_.hpp:401
bool CanGetAxis(void) const
Check if it is safe to call GetAxis method.
Definition: Int_graph_.hpp:372
bool IsSetMin(void) const
Check if a value has been assigned to Min data member.
Definition: Int_graph_.hpp:319
vector< int > m_Values
Definition: Int_graph_.hpp:259
void ResetAxis(void)
Reset Axis data member.
Definition: Int_graph_.hpp:378
const TValues & GetValues(void) const
Get the Values member data.
Definition: Int_graph_.hpp:425
void ResetMax(void)
Reset Max data member.
Definition: Int_graph_.hpp:284
TMin GetMin(void) const
Get the Min member data.
Definition: Int_graph_.hpp:338
CInt_graph_Base(const CInt_graph_Base &)
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
Definition: Int_graph_.hpp:98
bool IsSetAxis(void) const
Check if a value has been assigned to Axis data member.
Definition: Int_graph_.hpp:366
TAxis GetAxis(void) const
Get the Axis member data.
Definition: Int_graph_.hpp:385
bool CanGetMax(void) const
Check if it is safe to call GetMax method.
Definition: Int_graph_.hpp:278
vector< int > TValues
Definition: Int_graph_.hpp:88
bool CanGetValues(void) const
Check if it is safe to call GetValues method.
Definition: Int_graph_.hpp:419
CInt_graph_Base & operator=(const CInt_graph_Base &)
TMax GetMax(void) const
Get the Max member data.
Definition: Int_graph_.hpp:291
TValues & SetValues(void)
Assign a value to Values data member.
Definition: Int_graph_.hpp:431
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed Sep 04 15:07:14 2024 by modify_doxy.py rev. 669887