NCBI C++ ToolKit
SeqEdit_Cmd_AttachSeqEntry_.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_AttachSeqEntry_.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_ATTACHSEQENTRY_BASE_HPP
42 #define OBJECTS_SEQEDIT_SEQEDIT_CMD_ATTACHSEQENTRY_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 class CSeq_entry;
58 
59 
60 // generated classes
61 
62 
63 /** @addtogroup dataspec_NCBI_SeqEdit
64  *
65  * @{
66  */
67 
68 /////////////////////////////////////////////////////////////////////////////
69 ///***************************************************************
70 /// Attach a seq entry to bioseq-set
71 ///
72 /// CSeqEdit_Cmd_AttachSeqEntry_Base --
73 ///
74 
76 {
78 public:
79  // constructor
81  // destructor
82  virtual ~CSeqEdit_Cmd_AttachSeqEntry_Base(void);
83 
84  // type info
86 
87  // types
88  typedef CSeqEdit_Id TId;
90  typedef int TIndex;
91 
92  // member index
93  enum class E_memberIndex {
94  e__allMandatory = 0,
95  e_id,
96  e_seq_entry,
97  e_index
98  };
100 
101  // getters
102  // setters
103 
104  /// Bioseq_set id
105  /// Check if a value has been assigned to Id data member.
106  ///
107  /// Data member Id is mandatory;
108  /// its type is defined as 'typedef CSeqEdit_Id TId'
109  /// @return
110  /// - true, if a value has been assigned.
111  /// - false, otherwise.
112  bool IsSetId(void) const;
113 
114  /// Check if it is safe to call GetId method.
115  ///
116  /// @return
117  /// - true, if the data member is getatable.
118  /// - false, otherwise.
119  bool CanGetId(void) const;
120 
121  /// Reset Id data member.
122  void ResetId(void);
123 
124  /// Get the Id member data.
125  ///
126  /// @return
127  /// Reference to the member data.
128  const TId& GetId(void) const;
129 
130  /// Assign a value to Id data member.
131  ///
132  /// @param value
133  /// Reference to value.
134  void SetId(TId& value);
135 
136  /// Assign a value to Id data member.
137  ///
138  /// @return
139  /// Reference to the data value.
140  TId& SetId(void);
141 
142  /// set entry
143  /// Check if a value has been assigned to Seq_entry data member.
144  ///
145  /// Data member Seq_entry is optional;
146  /// its type is defined as 'typedef CSeq_entry TSeq_entry'
147  /// @return
148  /// - true, if a value has been assigned.
149  /// - false, otherwise.
150  bool IsSetSeq_entry(void) const;
151 
152  /// Check if it is safe to call GetSeq_entry method.
153  ///
154  /// @return
155  /// - true, if the data member is getatable.
156  /// - false, otherwise.
157  bool CanGetSeq_entry(void) const;
158 
159  /// Reset Seq_entry data member.
160  void ResetSeq_entry(void);
161 
162  /// Get the Seq_entry member data.
163  ///
164  /// @return
165  /// Reference to the member data.
166  const TSeq_entry& GetSeq_entry(void) const;
167 
168  /// Assign a value to Seq_entry data member.
169  ///
170  /// @param value
171  /// Reference to value.
172  void SetSeq_entry(TSeq_entry& value);
173 
174  /// Assign a value to Seq_entry data member.
175  ///
176  /// @return
177  /// Reference to the data value.
178  TSeq_entry& SetSeq_entry(void);
179 
180  /// index
181  /// Check if a value has been assigned to Index data member.
182  ///
183  /// Data member Index is mandatory;
184  /// its type is defined as 'typedef int TIndex'
185  /// @return
186  /// - true, if a value has been assigned.
187  /// - false, otherwise.
188  bool IsSetIndex(void) const;
189 
190  /// Check if it is safe to call GetIndex method.
191  ///
192  /// @return
193  /// - true, if the data member is getatable.
194  /// - false, otherwise.
195  bool CanGetIndex(void) const;
196 
197  /// Reset Index data member.
198  void ResetIndex(void);
199 
200  /// Get the Index member data.
201  ///
202  /// @return
203  /// Copy of the member data.
204  TIndex GetIndex(void) const;
205 
206  /// Assign a value to Index data member.
207  ///
208  /// @param value
209  /// Value to assign
210  void SetIndex(TIndex value);
211 
212  /// Assign a value to Index data member.
213  ///
214  /// @return
215  /// Reference to the data value.
216  TIndex& SetIndex(void);
217 
218  /// Reset the whole object
219  virtual void Reset(void);
220 
221 
222 private:
223  // Prohibit copy constructor and assignment operator
226 
227  // data
228  Uint4 m_set_State[1];
231  int m_Index;
232 };
233 
234 /* @} */
235 
236 
237 
238 
239 
240 ///////////////////////////////////////////////////////////
241 ///////////////////// inline methods //////////////////////
242 ///////////////////////////////////////////////////////////
243 inline
245 {
246  return m_Id.NotEmpty();
247 }
248 
249 inline
251 {
252  return true;
253 }
254 
255 inline
257 {
258  if ( !m_Id ) {
259  const_cast<CSeqEdit_Cmd_AttachSeqEntry_Base*>(this)->ResetId();
260  }
261  return (*m_Id);
262 }
263 
264 inline
266 {
267  if ( !m_Id ) {
268  ResetId();
269  }
270  return (*m_Id);
271 }
272 
273 inline
275 {
276  return m_Seq_entry.NotEmpty();
277 }
278 
279 inline
281 {
282  return IsSetSeq_entry();
283 }
284 
285 inline
287 {
288  if (!CanGetSeq_entry()) {
289  ThrowUnassigned(1);
290  }
291  return (*m_Seq_entry);
292 }
293 
294 inline
296 {
297  return ((m_set_State[0] & 0x30) != 0);
298 }
299 
300 inline
302 {
303  return IsSetIndex();
304 }
305 
306 inline
308 {
309  m_Index = 0;
310  m_set_State[0] &= ~0x30;
311 }
312 
313 inline
315 {
316  if (!CanGetIndex()) {
317  ThrowUnassigned(2);
318  }
319  return m_Index;
320 }
321 
322 inline
324 {
325  m_Index = value;
326  m_set_State[0] |= 0x30;
327 }
328 
329 inline
331 {
332 #ifdef _DEBUG
333  if (!IsSetIndex()) {
334  memset(&m_Index,UnassignedByte(),sizeof(m_Index));
335  }
336 #endif
337  m_set_State[0] |= 0x10;
338  return m_Index;
339 }
340 
341 ///////////////////////////////////////////////////////////
342 ////////////////// end of inline methods //////////////////
343 ///////////////////////////////////////////////////////////
344 
345 
346 
347 
348 
349 END_objects_SCOPE // namespace ncbi::objects::
350 
352 
353 
354 #endif // OBJECTS_SEQEDIT_SEQEDIT_CMD_ATTACHSEQENTRY_BASE_HPP
CRef –.
Definition: ncbiobj.hpp:618
*************************************************************** Attach a seq entry to bioseq-set
CSeqEdit_Id –.
Definition: SeqEdit_Id.hpp:66
Definition: Seq_entry.hpp:56
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
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
TIndex GetIndex(void) const
Get the Index member data.
CSeqEdit_Cmd_AttachSeqEntry_Base & operator=(const CSeqEdit_Cmd_AttachSeqEntry_Base &)
TIndex & SetIndex(void)
Assign a value to Index data member.
CSeqEdit_Cmd_AttachSeqEntry_Base(const CSeqEdit_Cmd_AttachSeqEntry_Base &)
void ResetIndex(void)
Reset Index data member.
bool IsSetId(void) const
Bioseq_set id Check if a value has been assigned to Id data member.
const TSeq_entry & GetSeq_entry(void) const
Get the Seq_entry member data.
bool IsSetSeq_entry(void) const
set entry Check if a value has been assigned to Seq_entry data member.
bool CanGetSeq_entry(void) const
Check if it is safe to call GetSeq_entry method.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
void ResetId(void)
Reset Id data member.
bool IsSetIndex(void) const
index Check if a value has been assigned to Index data member.
const TId & GetId(void) const
Get the Id member data.
TId & SetId(void)
Assign a value to Id data member.
bool CanGetId(void) const
Check if it is safe to call GetId method.
bool CanGetIndex(void) const
Check if it is safe to call GetIndex method.
CSeq_entry_Info & GetSeq_entry(CTSE_Info &tse, const CBioObjectId &id)
Modified on Sat Dec 02 09:20:21 2023 by modify_doxy.py rev. 669887