NCBI C++ ToolKit
SeqEdit_Cmd_ResetSeqAttr_.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 SeqEdit_Cmd_ResetSeqAttr_.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/seqedit/seqedit.asn">seqedit.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqedit/seqedit.def">seqedit.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_SEQEDIT_SEQEDIT_CMD_RESETSEQATTR_BASE_HPP
42 #define OBJECTS_SEQEDIT_SEQEDIT_CMD_RESETSEQATTR_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
47 
48 #ifndef BEGIN_objects_SCOPE
49 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
50 # define END_objects_SCOPE END_SCOPE(objects)
51 #endif
52 BEGIN_objects_SCOPE // namespace ncbi::objects::
53 
54 
55 // forward declarations
56 class CSeqEdit_Id;
57 
58 
59 // generated classes
60 
61 
62 /** @addtogroup dataspec_NCBI_SeqEdit
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 /// Reset bioseq's attribute
69 ///
70 /// CSeqEdit_Cmd_ResetSeqAttr_Base --
71 ///
72 
74 {
76 public:
77  // constructor
79  // destructor
80  virtual ~CSeqEdit_Cmd_ResetSeqAttr_Base(void);
81 
82  // type info
84 
85  enum EWhat {
86  eWhat_not_set = 0,
87  eWhat_inst = 1, ///< whole seq-inst object
88  eWhat_repr = 2, ///< repr field of seq-inst object
89  eWhat_mol = 3, ///< mol field of seq-inst object
90  eWhat_length = 4, ///< length field of seq-inst object
91  eWhat_fuzz = 5, ///< fuzz field of seq-inst object
92  eWhat_topology = 6, ///< topology field of seq-inst object
93  eWhat_strand = 7, ///< strand field of seq-inst object
94  eWhat_ext = 8, ///< extr field of seq-inst object
95  eWhat_hist = 9, ///< hist field of seq-inst object
96  eWhat_seq_data = 10 ///< seq-data field of seq-inst object
97  };
98 
99  /// Access to EWhat's attributes (values, names) as defined in spec
100  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EWhat)(void);
101 
102  // types
103  typedef CSeqEdit_Id TId;
104  typedef EWhat TWhat;
105 
106  // member index
107  enum class E_memberIndex {
108  e__allMandatory = 0,
109  e_id,
110  e_what
111  };
113 
114  // getters
115  // setters
116 
117  /// Bioseq id
118  /// Check if a value has been assigned to Id data member.
119  ///
120  /// Data member Id is mandatory;
121  /// its type is defined as 'typedef CSeqEdit_Id TId'
122  /// @return
123  /// - true, if a value has been assigned.
124  /// - false, otherwise.
125  bool IsSetId(void) const;
126 
127  /// Check if it is safe to call GetId method.
128  ///
129  /// @return
130  /// - true, if the data member is getatable.
131  /// - false, otherwise.
132  bool CanGetId(void) const;
133 
134  /// Reset Id data member.
135  void ResetId(void);
136 
137  /// Get the Id member data.
138  ///
139  /// @return
140  /// Reference to the member data.
141  const TId& GetId(void) const;
142 
143  /// Assign a value to Id data member.
144  ///
145  /// @param value
146  /// Reference to value.
147  void SetId(TId& value);
148 
149  /// Assign a value to Id data member.
150  ///
151  /// @return
152  /// Reference to the data value.
153  TId& SetId(void);
154 
155  /// Check if a value has been assigned to What data member.
156  ///
157  /// Data member What is mandatory;
158  /// its type is defined as 'typedef EWhat TWhat'
159  /// @return
160  /// - true, if a value has been assigned.
161  /// - false, otherwise.
162  bool IsSetWhat(void) const;
163 
164  /// Check if it is safe to call GetWhat method.
165  ///
166  /// @return
167  /// - true, if the data member is getatable.
168  /// - false, otherwise.
169  bool CanGetWhat(void) const;
170 
171  /// Reset What data member.
172  void ResetWhat(void);
173 
174  /// Get the What member data.
175  ///
176  /// @return
177  /// Copy of the member data.
178  TWhat GetWhat(void) const;
179 
180  /// Assign a value to What data member.
181  ///
182  /// @param value
183  /// Value to assign
184  void SetWhat(TWhat value);
185 
186  /// Assign a value to What data member.
187  ///
188  /// @return
189  /// Reference to the data value.
190  TWhat& SetWhat(void);
191 
192  /// Reset the whole object
193  virtual void Reset(void);
194 
195 
196 private:
197  // Prohibit copy constructor and assignment operator
200 
201  // data
202  Uint4 m_set_State[1];
205 };
206 
207 /* @} */
208 
209 
210 
211 
212 
213 ///////////////////////////////////////////////////////////
214 ///////////////////// inline methods //////////////////////
215 ///////////////////////////////////////////////////////////
216 inline
218 {
219  return m_Id.NotEmpty();
220 }
221 
222 inline
224 {
225  return true;
226 }
227 
228 inline
230 {
231  if ( !m_Id ) {
232  const_cast<CSeqEdit_Cmd_ResetSeqAttr_Base*>(this)->ResetId();
233  }
234  return (*m_Id);
235 }
236 
237 inline
239 {
240  if ( !m_Id ) {
241  ResetId();
242  }
243  return (*m_Id);
244 }
245 
246 inline
248 {
249  return ((m_set_State[0] & 0xc) != 0);
250 }
251 
252 inline
254 {
255  return IsSetWhat();
256 }
257 
258 inline
260 {
261  m_What = (EWhat)(0);
262  m_set_State[0] &= ~0xc;
263 }
264 
265 inline
267 {
268  if (!CanGetWhat()) {
269  ThrowUnassigned(1);
270  }
271  return m_What;
272 }
273 
274 inline
276 {
277  m_What = value;
278  m_set_State[0] |= 0xc;
279 }
280 
281 inline
283 {
284 #ifdef _DEBUG
285  if (!IsSetWhat()) {
286  memset(&m_What,UnassignedByte(),sizeof(m_What));
287  }
288 #endif
289  m_set_State[0] |= 0x4;
290  return m_What;
291 }
292 
293 ///////////////////////////////////////////////////////////
294 ////////////////// end of inline methods //////////////////
295 ///////////////////////////////////////////////////////////
296 
297 
298 
299 
300 
301 END_objects_SCOPE // namespace ncbi::objects::
302 
304 
305 
306 #endif // OBJECTS_SEQEDIT_SEQEDIT_CMD_RESETSEQATTR_BASE_HPP
CRef –.
Definition: ncbiobj.hpp:618
CSeqEdit_Id –.
Definition: SeqEdit_Id.hpp:66
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
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
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_SEQEDIT_EXPORT
Definition: ncbi_export.h:801
bool IsSetWhat(void) const
Check if a value has been assigned to What data member.
TId & SetId(void)
Assign a value to Id data member.
CSeqEdit_Cmd_ResetSeqAttr_Base & operator=(const CSeqEdit_Cmd_ResetSeqAttr_Base &)
bool CanGetId(void) const
Check if it is safe to call GetId method.
TWhat GetWhat(void) const
Get the What member data.
TWhat & SetWhat(void)
Assign a value to What data member.
void ResetId(void)
Reset Id data member.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
CSeqEdit_Cmd_ResetSeqAttr_Base(const CSeqEdit_Cmd_ResetSeqAttr_Base &)
const TId & GetId(void) const
Get the Id member data.
bool IsSetId(void) const
Bioseq id Check if a value has been assigned to Id data member.
bool CanGetWhat(void) const
Check if it is safe to call GetWhat method.
void ResetWhat(void)
Reset What data member.
Modified on Fri Dec 08 08:19:34 2023 by modify_doxy.py rev. 669887