NCBI C++ ToolKit
Suspect_rule_.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 Suspect_rule_.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/macro/macro.asn">macro.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/macro/macro.def">macro.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_MACRO_SUSPECT_RULE_BASE_HPP
42 #define OBJECTS_MACRO_SUSPECT_RULE_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
50 
52 
53 #ifndef BEGIN_objects_SCOPE
54 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
55 # define END_objects_SCOPE END_SCOPE(objects)
56 #endif
57 BEGIN_objects_SCOPE // namespace ncbi::objects::
58 
59 
60 // forward declarations
62 class CReplace_rule;
63 class CSearch_func;
64 
65 
66 // generated classes
67 
68 
69 /** @addtogroup dataspec_NCBI_Macro
70  *
71  * @{
72  */
73 
74 /////////////////////////////////////////////////////////////////////////////
75 ///
76 /// CSuspect_rule_Base --
77 ///
78 
80 {
82 public:
83  // constructor
84  CSuspect_rule_Base(void);
85  // destructor
86  virtual ~CSuspect_rule_Base(void);
87 
88  // type info
90 
91  // types
97  typedef string TDescription;
98  typedef bool TFatal;
99 
100  // member index
101  enum class E_memberIndex {
102  e__allMandatory = 0,
103  e_find,
104  e_except,
106  e_rule_type,
107  e_replace,
109  e_fatal
110  };
112 
113  // getters
114  // setters
115 
116  /// Check if a value has been assigned to Find data member.
117  ///
118  /// Data member Find is mandatory;
119  /// its type is defined as 'typedef CSearch_func TFind'
120  /// @return
121  /// - true, if a value has been assigned.
122  /// - false, otherwise.
123  bool IsSetFind(void) const;
124 
125  /// Check if it is safe to call GetFind method.
126  ///
127  /// @return
128  /// - true, if the data member is getatable.
129  /// - false, otherwise.
130  bool CanGetFind(void) const;
131 
132  /// Reset Find data member.
133  void ResetFind(void);
134 
135  /// Get the Find member data.
136  ///
137  /// @return
138  /// Reference to the member data.
139  const TFind& GetFind(void) const;
140 
141  /// Assign a value to Find data member.
142  ///
143  /// @param value
144  /// Reference to value.
145  void SetFind(TFind& value);
146 
147  /// Assign a value to Find data member.
148  ///
149  /// @return
150  /// Reference to the data value.
151  TFind& SetFind(void);
152 
153  /// Check if a value has been assigned to Except data member.
154  ///
155  /// Data member Except is optional;
156  /// its type is defined as 'typedef CSearch_func TExcept'
157  /// @return
158  /// - true, if a value has been assigned.
159  /// - false, otherwise.
160  bool IsSetExcept(void) const;
161 
162  /// Check if it is safe to call GetExcept method.
163  ///
164  /// @return
165  /// - true, if the data member is getatable.
166  /// - false, otherwise.
167  bool CanGetExcept(void) const;
168 
169  /// Reset Except data member.
170  void ResetExcept(void);
171 
172  /// Get the Except member data.
173  ///
174  /// @return
175  /// Reference to the member data.
176  const TExcept& GetExcept(void) const;
177 
178  /// Assign a value to Except data member.
179  ///
180  /// @param value
181  /// Reference to value.
182  void SetExcept(TExcept& value);
183 
184  /// Assign a value to Except data member.
185  ///
186  /// @return
187  /// Reference to the data value.
188  TExcept& SetExcept(void);
189 
190  /// Check if a value has been assigned to Feat_constraint data member.
191  ///
192  /// Data member Feat_constraint is optional;
193  /// its type is defined as 'typedef CConstraint_choice_set TFeat_constraint'
194  /// @return
195  /// - true, if a value has been assigned.
196  /// - false, otherwise.
197  bool IsSetFeat_constraint(void) const;
198 
199  /// Check if it is safe to call GetFeat_constraint method.
200  ///
201  /// @return
202  /// - true, if the data member is getatable.
203  /// - false, otherwise.
204  bool CanGetFeat_constraint(void) const;
205 
206  /// Reset Feat_constraint data member.
207  void ResetFeat_constraint(void);
208 
209  /// Get the Feat_constraint member data.
210  ///
211  /// @return
212  /// Reference to the member data.
213  const TFeat_constraint& GetFeat_constraint(void) const;
214 
215  /// Assign a value to Feat_constraint data member.
216  ///
217  /// @param value
218  /// Reference to value.
220 
221  /// Assign a value to Feat_constraint data member.
222  ///
223  /// @return
224  /// Reference to the data value.
226 
227  /// Check if a value has been assigned to Rule_type data member.
228  ///
229  /// Data member Rule_type is optional with default eFix_type_none;
230  /// its type is defined as 'typedef EFix_type TRule_type'
231  /// @return
232  /// - true, if a value has been assigned.
233  /// - false, otherwise.
234  bool IsSetRule_type(void) const;
235 
236  /// Check if it is safe to call GetRule_type method.
237  ///
238  /// @return
239  /// - true, if the data member is getatable.
240  /// - false, otherwise.
241  bool CanGetRule_type(void) const;
242 
243  /// Reset Rule_type data member.
244  void ResetRule_type(void);
245 
246  /// Assign default value to Rule_type data member.
247  void SetDefaultRule_type(void);
248 
249  /// Get the Rule_type member data.
250  ///
251  /// @return
252  /// Copy of the member data.
253  TRule_type GetRule_type(void) const;
254 
255  /// Assign a value to Rule_type data member.
256  ///
257  /// @param value
258  /// Value to assign
260 
261  /// Assign a value to Rule_type data member.
262  ///
263  /// @return
264  /// Reference to the data value.
265  TRule_type& SetRule_type(void);
266 
267  /// Check if a value has been assigned to Replace data member.
268  ///
269  /// Data member Replace is optional;
270  /// its type is defined as 'typedef CReplace_rule TReplace'
271  /// @return
272  /// - true, if a value has been assigned.
273  /// - false, otherwise.
274  bool IsSetReplace(void) const;
275 
276  /// Check if it is safe to call GetReplace method.
277  ///
278  /// @return
279  /// - true, if the data member is getatable.
280  /// - false, otherwise.
281  bool CanGetReplace(void) const;
282 
283  /// Reset Replace data member.
284  void ResetReplace(void);
285 
286  /// Get the Replace member data.
287  ///
288  /// @return
289  /// Reference to the member data.
290  const TReplace& GetReplace(void) const;
291 
292  /// Assign a value to Replace data member.
293  ///
294  /// @param value
295  /// Reference to value.
296  void SetReplace(TReplace& value);
297 
298  /// Assign a value to Replace data member.
299  ///
300  /// @return
301  /// Reference to the data value.
302  TReplace& SetReplace(void);
303 
304  /// Check if a value has been assigned to Description data member.
305  ///
306  /// Data member Description is optional;
307  /// its type is defined as 'typedef string TDescription'
308  /// @return
309  /// - true, if a value has been assigned.
310  /// - false, otherwise.
311  bool IsSetDescription(void) const;
312 
313  /// Check if it is safe to call GetDescription method.
314  ///
315  /// @return
316  /// - true, if the data member is getatable.
317  /// - false, otherwise.
318  bool CanGetDescription(void) const;
319 
320  /// Reset Description data member.
321  void ResetDescription(void);
322 
323  /// Get the Description member data.
324  ///
325  /// @return
326  /// Reference to the member data.
327  const TDescription& GetDescription(void) const;
328 
329  /// Assign a value to Description data member.
330  ///
331  /// @param value
332  /// Value to assign
333  void SetDescription(const TDescription& value);
335 
336  /// Assign a value to Description data member.
337  ///
338  /// @return
339  /// Reference to the data value.
341 
342  /// Check if a value has been assigned to Fatal data member.
343  ///
344  /// Data member Fatal is optional with default false;
345  /// its type is defined as 'typedef bool TFatal'
346  /// @return
347  /// - true, if a value has been assigned.
348  /// - false, otherwise.
349  bool IsSetFatal(void) const;
350 
351  /// Check if it is safe to call GetFatal method.
352  ///
353  /// @return
354  /// - true, if the data member is getatable.
355  /// - false, otherwise.
356  bool CanGetFatal(void) const;
357 
358  /// Reset Fatal data member.
359  void ResetFatal(void);
360 
361  /// Assign default value to Fatal data member.
362  void SetDefaultFatal(void);
363 
364  /// Get the Fatal member data.
365  ///
366  /// @return
367  /// Copy of the member data.
368  TFatal GetFatal(void) const;
369 
370  /// Assign a value to Fatal data member.
371  ///
372  /// @param value
373  /// Value to assign
374  void SetFatal(TFatal value);
375 
376  /// Assign a value to Fatal data member.
377  ///
378  /// @return
379  /// Reference to the data value.
380  TFatal& SetFatal(void);
381 
382  /// Reset the whole object
383  virtual void Reset(void);
384 
385 
386 private:
387  // Prohibit copy constructor and assignment operator
390 
391  // data
399  bool m_Fatal;
400 };
401 
402 /* @} */
403 
404 
405 
406 
407 
408 ///////////////////////////////////////////////////////////
409 ///////////////////// inline methods //////////////////////
410 ///////////////////////////////////////////////////////////
411 inline
413 {
414  return m_Find.NotEmpty();
415 }
416 
417 inline
419 {
420  return true;
421 }
422 
423 inline
425 {
426  if ( !m_Find ) {
427  const_cast<CSuspect_rule_Base*>(this)->ResetFind();
428  }
429  return (*m_Find);
430 }
431 
432 inline
434 {
435  if ( !m_Find ) {
436  ResetFind();
437  }
438  return (*m_Find);
439 }
440 
441 inline
443 {
444  return m_Except.NotEmpty();
445 }
446 
447 inline
449 {
450  return IsSetExcept();
451 }
452 
453 inline
455 {
456  if (!CanGetExcept()) {
457  ThrowUnassigned(1);
458  }
459  return (*m_Except);
460 }
461 
462 inline
464 {
465  return m_Feat_constraint.NotEmpty();
466 }
467 
468 inline
470 {
471  return IsSetFeat_constraint();
472 }
473 
474 inline
476 {
477  if (!CanGetFeat_constraint()) {
478  ThrowUnassigned(2);
479  }
480  return (*m_Feat_constraint);
481 }
482 
483 inline
485 {
486  return ((m_set_State[0] & 0xc0) != 0);
487 }
488 
489 inline
491 {
492  return true;
493 }
494 
495 inline
497 {
499  m_set_State[0] &= ~0xc0;
500 }
501 
502 inline
504 {
505  ResetRule_type();
506 }
507 
508 inline
510 {
511  return m_Rule_type;
512 }
513 
514 inline
516 {
517  m_Rule_type = value;
518  m_set_State[0] |= 0xc0;
519 }
520 
521 inline
523 {
524 #ifdef _DEBUG
525  if (!IsSetRule_type()) {
526  memset(&m_Rule_type,UnassignedByte(),sizeof(m_Rule_type));
527  }
528 #endif
529  m_set_State[0] |= 0x40;
530  return m_Rule_type;
531 }
532 
533 inline
535 {
536  return m_Replace.NotEmpty();
537 }
538 
539 inline
541 {
542  return IsSetReplace();
543 }
544 
545 inline
547 {
548  if (!CanGetReplace()) {
549  ThrowUnassigned(4);
550  }
551  return (*m_Replace);
552 }
553 
554 inline
556 {
557  return ((m_set_State[0] & 0xc00) != 0);
558 }
559 
560 inline
562 {
563  return IsSetDescription();
564 }
565 
566 inline
568 {
569  if (!CanGetDescription()) {
570  ThrowUnassigned(5);
571  }
572  return m_Description;
573 }
574 
575 inline
577 {
579  m_set_State[0] |= 0xc00;
580 }
581 
582 inline
584 {
585  m_Description = std::forward<CSuspect_rule_Base::TDescription>(value);
586  m_set_State[0] |= 0xc00;
587 }
588 
589 inline
591 {
592 #ifdef _DEBUG
593  if (!IsSetDescription()) {
595  }
596 #endif
597  m_set_State[0] |= 0x400;
598  return m_Description;
599 }
600 
601 inline
603 {
604  return ((m_set_State[0] & 0x3000) != 0);
605 }
606 
607 inline
609 {
610  return true;
611 }
612 
613 inline
615 {
616  m_Fatal = false;
617  m_set_State[0] &= ~0x3000;
618 }
619 
620 inline
622 {
623  ResetFatal();
624 }
625 
626 inline
628 {
629  return m_Fatal;
630 }
631 
632 inline
634 {
635  m_Fatal = value;
636  m_set_State[0] |= 0x3000;
637 }
638 
639 inline
641 {
642 #ifdef _DEBUG
643  if (!IsSetFatal()) {
644  memset(&m_Fatal,UnassignedByte(),sizeof(m_Fatal));
645  }
646 #endif
647  m_set_State[0] |= 0x1000;
648  return m_Fatal;
649 }
650 
651 ///////////////////////////////////////////////////////////
652 ////////////////// end of inline methods //////////////////
653 ///////////////////////////////////////////////////////////
654 
655 
656 
657 
658 
659 END_objects_SCOPE // namespace ncbi::objects::
660 
662 
663 
664 #endif // OBJECTS_MACRO_SUSPECT_RULE_BASE_HPP
User-defined methods of the data storage class.
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
CSuspect_rule_Base –.
char value[7]
Definition: config.c:431
static char UnassignedByte(void)
Definition: serialbase.hpp:181
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
virtual void Reset(void)
Reset the whole object.
TFeat_constraint & SetFeat_constraint(void)
Assign a value to Feat_constraint data member.
void SetDefaultFatal(void)
Assign default value to Fatal data member.
virtual ~CSuspect_rule_Base(void)
TRule_type & SetRule_type(void)
Assign a value to Rule_type data member.
CSearch_func TExcept
bool IsSetRule_type(void) const
Check if a value has been assigned to Rule_type data member.
void ResetRule_type(void)
Reset Rule_type data member.
bool IsSetFeat_constraint(void) const
Check if a value has been assigned to Feat_constraint data member.
EFix_type
Access to EFix_type's attributes (values, names) as defined in spec.
Definition: Fix_type_.hpp:63
CSearch_func TFind
bool CanGetFeat_constraint(void) const
Check if it is safe to call GetFeat_constraint method.
CRef< TFind > m_Find
bool IsSetDescription(void) const
Check if a value has been assigned to Description data member.
CSuspect_rule_Base & operator=(const CSuspect_rule_Base &)
bool CanGetDescription(void) const
Check if it is safe to call GetDescription method.
TRule_type GetRule_type(void) const
Get the Rule_type member data.
const TDescription & GetDescription(void) const
Get the Description member data.
bool CanGetFind(void) const
Check if it is safe to call GetFind method.
TExcept & SetExcept(void)
Assign a value to Except data member.
CSuspect_rule_Base(const CSuspect_rule_Base &)
const TExcept & GetExcept(void) const
Get the Except member data.
void ResetFind(void)
Reset Find data member.
void ResetExcept(void)
Reset Except data member.
CConstraint_choice_set TFeat_constraint
const TFind & GetFind(void) const
Get the Find member data.
const TFeat_constraint & GetFeat_constraint(void) const
Get the Feat_constraint member data.
CRef< TFeat_constraint > m_Feat_constraint
bool CanGetFatal(void) const
Check if it is safe to call GetFatal method.
void SetDefaultRule_type(void)
Assign default value to Rule_type data member.
void ResetFatal(void)
Reset Fatal data member.
TFatal GetFatal(void) const
Get the Fatal member data.
void ResetDescription(void)
Reset Description data member.
bool IsSetFind(void) const
Check if a value has been assigned to Find data member.
void ResetReplace(void)
Reset Replace data member.
bool IsSetFatal(void) const
Check if a value has been assigned to Fatal data member.
CRef< TReplace > m_Replace
bool CanGetExcept(void) const
Check if it is safe to call GetExcept method.
CRef< TExcept > m_Except
const TReplace & GetReplace(void) const
Get the Replace member data.
TFatal & SetFatal(void)
Assign a value to Fatal data member.
TReplace & SetReplace(void)
Assign a value to Replace data member.
bool IsSetReplace(void) const
Check if a value has been assigned to Replace data member.
bool CanGetReplace(void) const
Check if it is safe to call GetReplace method.
bool CanGetRule_type(void) const
Check if it is safe to call GetRule_type method.
Tparent::CMemberIndex< E_memberIndex, 8 > TmemberIndex
CReplace_rule TReplace
TFind & SetFind(void)
Assign a value to Find data member.
TDescription & SetDescription(void)
Assign a value to Description data member.
bool IsSetExcept(void) const
Check if a value has been assigned to Except data member.
void ResetFeat_constraint(void)
Reset Feat_constraint data member.
CSerialObject Tparent
@ eFix_type_none
Definition: Fix_type_.hpp:64
Modified on Wed Feb 21 09:55:21 2024 by modify_doxy.py rev. 669887