NCBI C++ ToolKit
CoreBlock_.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 CoreBlock_.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/scoremat/scoremat.asn">scoremat.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/scoremat/scoremat.def">scoremat.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_SCOREMAT_COREBLOCK_BASE_HPP
42 #define OBJECTS_SCOREMAT_COREBLOCK_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
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 // forward declarations
60 class CBlockProperty;
61 
62 
63 // generated classes
64 
65 
66 /** @addtogroup dataspec_NCBI_ScoreMat
67  *
68  * @{
69  */
70 
71 /////////////////////////////////////////////////////////////////////////////
72 ///
73 /// CCoreBlock_Base --
74 ///
75 
77 {
79 public:
80  // constructor
81  CCoreBlock_Base(void);
82  // destructor
83  virtual ~CCoreBlock_Base(void);
84 
85  // type info
87 
88  // types
89  typedef int TStart;
90  typedef int TStop;
91  typedef int TMinstart;
92  typedef int TMaxstop;
93  typedef list< CRef< CBlockProperty > > TProperty;
94 
95  // member index
96  enum class E_memberIndex {
97  e__allMandatory = 0,
98  e_start,
99  e_stop,
100  e_minstart,
101  e_maxstop,
102  e_property
103  };
105 
106  // getters
107  // setters
108 
109  /// begin of block on query
110  /// Check if a value has been assigned to Start data member.
111  ///
112  /// Data member Start is mandatory;
113  /// its type is defined as 'typedef int TStart'
114  /// @return
115  /// - true, if a value has been assigned.
116  /// - false, otherwise.
117  bool IsSetStart(void) const;
118 
119  /// Check if it is safe to call GetStart method.
120  ///
121  /// @return
122  /// - true, if the data member is getatable.
123  /// - false, otherwise.
124  bool CanGetStart(void) const;
125 
126  /// Reset Start data member.
127  void ResetStart(void);
128 
129  /// Get the Start member data.
130  ///
131  /// @return
132  /// Copy of the member data.
133  TStart GetStart(void) const;
134 
135  /// Assign a value to Start data member.
136  ///
137  /// @param value
138  /// Value to assign
139  void SetStart(TStart value);
140 
141  /// Assign a value to Start data member.
142  ///
143  /// @return
144  /// Reference to the data value.
145  TStart& SetStart(void);
146 
147  /// end of block on query
148  /// Check if a value has been assigned to Stop data member.
149  ///
150  /// Data member Stop is mandatory;
151  /// its type is defined as 'typedef int TStop'
152  /// @return
153  /// - true, if a value has been assigned.
154  /// - false, otherwise.
155  bool IsSetStop(void) const;
156 
157  /// Check if it is safe to call GetStop method.
158  ///
159  /// @return
160  /// - true, if the data member is getatable.
161  /// - false, otherwise.
162  bool CanGetStop(void) const;
163 
164  /// Reset Stop data member.
165  void ResetStop(void);
166 
167  /// Get the Stop member data.
168  ///
169  /// @return
170  /// Copy of the member data.
171  TStop GetStop(void) const;
172 
173  /// Assign a value to Stop data member.
174  ///
175  /// @param value
176  /// Value to assign
177  void SetStop(TStop value);
178 
179  /// Assign a value to Stop data member.
180  ///
181  /// @return
182  /// Reference to the data value.
183  TStop& SetStop(void);
184 
185  /// optional N-terminal extension
186  /// Check if a value has been assigned to Minstart data member.
187  ///
188  /// Data member Minstart is optional;
189  /// its type is defined as 'typedef int TMinstart'
190  /// @return
191  /// - true, if a value has been assigned.
192  /// - false, otherwise.
193  bool IsSetMinstart(void) const;
194 
195  /// Check if it is safe to call GetMinstart method.
196  ///
197  /// @return
198  /// - true, if the data member is getatable.
199  /// - false, otherwise.
200  bool CanGetMinstart(void) const;
201 
202  /// Reset Minstart data member.
203  void ResetMinstart(void);
204 
205  /// Get the Minstart member data.
206  ///
207  /// @return
208  /// Copy of the member data.
209  TMinstart GetMinstart(void) const;
210 
211  /// Assign a value to Minstart data member.
212  ///
213  /// @param value
214  /// Value to assign
215  void SetMinstart(TMinstart value);
216 
217  /// Assign a value to Minstart data member.
218  ///
219  /// @return
220  /// Reference to the data value.
221  TMinstart& SetMinstart(void);
222 
223  /// optional C-terminal extension
224  /// Check if a value has been assigned to Maxstop data member.
225  ///
226  /// Data member Maxstop is optional;
227  /// its type is defined as 'typedef int TMaxstop'
228  /// @return
229  /// - true, if a value has been assigned.
230  /// - false, otherwise.
231  bool IsSetMaxstop(void) const;
232 
233  /// Check if it is safe to call GetMaxstop method.
234  ///
235  /// @return
236  /// - true, if the data member is getatable.
237  /// - false, otherwise.
238  bool CanGetMaxstop(void) const;
239 
240  /// Reset Maxstop data member.
241  void ResetMaxstop(void);
242 
243  /// Get the Maxstop member data.
244  ///
245  /// @return
246  /// Copy of the member data.
247  TMaxstop GetMaxstop(void) const;
248 
249  /// Assign a value to Maxstop data member.
250  ///
251  /// @param value
252  /// Value to assign
253  void SetMaxstop(TMaxstop value);
254 
255  /// Assign a value to Maxstop data member.
256  ///
257  /// @return
258  /// Reference to the data value.
259  TMaxstop& SetMaxstop(void);
260 
261  /// Check if a value has been assigned to Property data member.
262  ///
263  /// Data member Property is optional;
264  /// its type is defined as 'typedef list< CRef< CBlockProperty > > TProperty'
265  /// @return
266  /// - true, if a value has been assigned.
267  /// - false, otherwise.
268  bool IsSetProperty(void) const;
269 
270  /// Check if it is safe to call GetProperty method.
271  ///
272  /// @return
273  /// - true, if the data member is getatable.
274  /// - false, otherwise.
275  bool CanGetProperty(void) const;
276 
277  /// Reset Property data member.
278  void ResetProperty(void);
279 
280  /// Get the Property member data.
281  ///
282  /// @return
283  /// Reference to the member data.
284  const TProperty& GetProperty(void) const;
285 
286  /// Assign a value to Property data member.
287  ///
288  /// @return
289  /// Reference to the data value.
290  TProperty& SetProperty(void);
291 
292  /// Reset the whole object
293  virtual void Reset(void);
294 
295 
296 private:
297  // Prohibit copy constructor and assignment operator
300 
301  // data
302  Uint4 m_set_State[1];
303  int m_Start;
304  int m_Stop;
307  list< CRef< CBlockProperty > > m_Property;
308 };
309 
310 /* @} */
311 
312 
313 
314 
315 
316 ///////////////////////////////////////////////////////////
317 ///////////////////// inline methods //////////////////////
318 ///////////////////////////////////////////////////////////
319 inline
321 {
322  return ((m_set_State[0] & 0x3) != 0);
323 }
324 
325 inline
327 {
328  return IsSetStart();
329 }
330 
331 inline
333 {
334  m_Start = 0;
335  m_set_State[0] &= ~0x3;
336 }
337 
338 inline
340 {
341  if (!CanGetStart()) {
342  ThrowUnassigned(0);
343  }
344  return m_Start;
345 }
346 
347 inline
349 {
350  m_Start = value;
351  m_set_State[0] |= 0x3;
352 }
353 
354 inline
356 {
357 #ifdef _DEBUG
358  if (!IsSetStart()) {
359  memset(&m_Start,UnassignedByte(),sizeof(m_Start));
360  }
361 #endif
362  m_set_State[0] |= 0x1;
363  return m_Start;
364 }
365 
366 inline
368 {
369  return ((m_set_State[0] & 0xc) != 0);
370 }
371 
372 inline
374 {
375  return IsSetStop();
376 }
377 
378 inline
380 {
381  m_Stop = 0;
382  m_set_State[0] &= ~0xc;
383 }
384 
385 inline
387 {
388  if (!CanGetStop()) {
389  ThrowUnassigned(1);
390  }
391  return m_Stop;
392 }
393 
394 inline
396 {
397  m_Stop = value;
398  m_set_State[0] |= 0xc;
399 }
400 
401 inline
403 {
404 #ifdef _DEBUG
405  if (!IsSetStop()) {
406  memset(&m_Stop,UnassignedByte(),sizeof(m_Stop));
407  }
408 #endif
409  m_set_State[0] |= 0x4;
410  return m_Stop;
411 }
412 
413 inline
415 {
416  return ((m_set_State[0] & 0x30) != 0);
417 }
418 
419 inline
421 {
422  return IsSetMinstart();
423 }
424 
425 inline
427 {
428  m_Minstart = 0;
429  m_set_State[0] &= ~0x30;
430 }
431 
432 inline
434 {
435  if (!CanGetMinstart()) {
436  ThrowUnassigned(2);
437  }
438  return m_Minstart;
439 }
440 
441 inline
443 {
444  m_Minstart = value;
445  m_set_State[0] |= 0x30;
446 }
447 
448 inline
450 {
451 #ifdef _DEBUG
452  if (!IsSetMinstart()) {
453  memset(&m_Minstart,UnassignedByte(),sizeof(m_Minstart));
454  }
455 #endif
456  m_set_State[0] |= 0x10;
457  return m_Minstart;
458 }
459 
460 inline
462 {
463  return ((m_set_State[0] & 0xc0) != 0);
464 }
465 
466 inline
468 {
469  return IsSetMaxstop();
470 }
471 
472 inline
474 {
475  m_Maxstop = 0;
476  m_set_State[0] &= ~0xc0;
477 }
478 
479 inline
481 {
482  if (!CanGetMaxstop()) {
483  ThrowUnassigned(3);
484  }
485  return m_Maxstop;
486 }
487 
488 inline
490 {
491  m_Maxstop = value;
492  m_set_State[0] |= 0xc0;
493 }
494 
495 inline
497 {
498 #ifdef _DEBUG
499  if (!IsSetMaxstop()) {
500  memset(&m_Maxstop,UnassignedByte(),sizeof(m_Maxstop));
501  }
502 #endif
503  m_set_State[0] |= 0x40;
504  return m_Maxstop;
505 }
506 
507 inline
509 {
510  return ((m_set_State[0] & 0x300) != 0);
511 }
512 
513 inline
515 {
516  return true;
517 }
518 
519 inline
521 {
522  return m_Property;
523 }
524 
525 inline
527 {
528  m_set_State[0] |= 0x100;
529  return m_Property;
530 }
531 
532 ///////////////////////////////////////////////////////////
533 ////////////////// end of inline methods //////////////////
534 ///////////////////////////////////////////////////////////
535 
536 
537 
538 
539 
540 END_objects_SCOPE // namespace ncbi::objects::
541 
543 
544 
545 #endif // OBJECTS_SCOREMAT_COREBLOCK_BASE_HPP
CBlockProperty –.
CCoreBlock_Base –.
Definition: CoreBlock_.hpp:77
Base class for all serializable objects.
Definition: serialbase.hpp:150
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
TSeqPos GetStop(const CSeq_loc &loc, CScope *scope, ESeqLocExtremes ext=eExtreme_Positional)
If only one CBioseq is represented by CSeq_loc, returns the position at the stop of the location.
TSeqPos GetStart(const CSeq_loc &loc, CScope *scope, ESeqLocExtremes ext=eExtreme_Positional)
If only one CBioseq is represented by CSeq_loc, returns the position at the start of the location.
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_SCOREMAT_EXPORT
Definition: ncbi_export.h:736
Tparent::CMemberIndex< E_memberIndex, 6 > TmemberIndex
Definition: CoreBlock_.hpp:104
CSerialObject Tparent
Definition: CoreBlock_.hpp:78
bool CanGetMaxstop(void) const
Check if it is safe to call GetMaxstop method.
Definition: CoreBlock_.hpp:467
list< CRef< CBlockProperty > > TProperty
Definition: CoreBlock_.hpp:93
bool IsSetProperty(void) const
Check if a value has been assigned to Property data member.
Definition: CoreBlock_.hpp:508
TProperty & SetProperty(void)
Assign a value to Property data member.
Definition: CoreBlock_.hpp:526
bool IsSetStop(void) const
end of block on query Check if a value has been assigned to Stop data member.
Definition: CoreBlock_.hpp:367
Uint4 m_set_State[1]
Definition: CoreBlock_.hpp:302
bool CanGetProperty(void) const
Check if it is safe to call GetProperty method.
Definition: CoreBlock_.hpp:514
void ResetStart(void)
Reset Start data member.
Definition: CoreBlock_.hpp:332
bool IsSetMinstart(void) const
optional N-terminal extension Check if a value has been assigned to Minstart data member.
Definition: CoreBlock_.hpp:414
bool IsSetStart(void) const
begin of block on query Check if a value has been assigned to Start data member.
Definition: CoreBlock_.hpp:320
bool IsSetMaxstop(void) const
optional C-terminal extension Check if a value has been assigned to Maxstop data member.
Definition: CoreBlock_.hpp:461
CCoreBlock_Base & operator=(const CCoreBlock_Base &)
TStop GetStop(void) const
Get the Stop member data.
Definition: CoreBlock_.hpp:386
bool CanGetMinstart(void) const
Check if it is safe to call GetMinstart method.
Definition: CoreBlock_.hpp:420
TStart GetStart(void) const
Get the Start member data.
Definition: CoreBlock_.hpp:339
TStop & SetStop(void)
Assign a value to Stop data member.
Definition: CoreBlock_.hpp:402
const TProperty & GetProperty(void) const
Get the Property member data.
Definition: CoreBlock_.hpp:520
list< CRef< CBlockProperty > > m_Property
Definition: CoreBlock_.hpp:307
CCoreBlock_Base(const CCoreBlock_Base &)
void ResetMaxstop(void)
Reset Maxstop data member.
Definition: CoreBlock_.hpp:473
TMinstart & SetMinstart(void)
Assign a value to Minstart data member.
Definition: CoreBlock_.hpp:449
TMinstart GetMinstart(void) const
Get the Minstart member data.
Definition: CoreBlock_.hpp:433
bool CanGetStop(void) const
Check if it is safe to call GetStop method.
Definition: CoreBlock_.hpp:373
void ResetMinstart(void)
Reset Minstart data member.
Definition: CoreBlock_.hpp:426
TStart & SetStart(void)
Assign a value to Start data member.
Definition: CoreBlock_.hpp:355
TMaxstop GetMaxstop(void) const
Get the Maxstop member data.
Definition: CoreBlock_.hpp:480
void ResetStop(void)
Reset Stop data member.
Definition: CoreBlock_.hpp:379
TMaxstop & SetMaxstop(void)
Assign a value to Maxstop data member.
Definition: CoreBlock_.hpp:496
bool CanGetStart(void) const
Check if it is safe to call GetStart method.
Definition: CoreBlock_.hpp:326
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:36 2024 by modify_doxy.py rev. 669887