NCBI C++ ToolKit
Biostruc_seq_.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 Biostruc_seq_.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/ncbimime/ncbimime.asn">ncbimime.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/ncbimime/ncbimime.def">ncbimime.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_NCBIMIME_BIOSTRUC_SEQ_BASE_HPP
42 #define OBJECTS_NCBIMIME_BIOSTRUC_SEQ_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 CBiostruc;
63 class CSeq_entry;
64 
65 
66 // generated classes
67 
68 
69 /** @addtogroup dataspec_NCBI_Mime
70  *
71  * @{
72  */
73 
74 /////////////////////////////////////////////////////////////////////////////
75 /// display structure seq added by yanli
76 ///
77 /// CBiostruc_seq_Base --
78 ///
79 
81 {
83 public:
84  // constructor
85  CBiostruc_seq_Base(void);
86  // destructor
87  virtual ~CBiostruc_seq_Base(void);
88 
89  // type info
91 
92  // types
94  typedef list< CRef< CSeq_entry > > TSequences;
97 
98  // member index
99  enum class E_memberIndex {
100  e__allMandatory = 0,
101  e_structure,
102  e_sequences,
103  e_style_dictionary,
104  e_user_annotations
105  };
107 
108  // getters
109  // setters
110 
111  /// Check if a value has been assigned to Structure data member.
112  ///
113  /// Data member Structure is mandatory;
114  /// its type is defined as 'typedef CBiostruc TStructure'
115  /// @return
116  /// - true, if a value has been assigned.
117  /// - false, otherwise.
118  bool IsSetStructure(void) const;
119 
120  /// Check if it is safe to call GetStructure method.
121  ///
122  /// @return
123  /// - true, if the data member is getatable.
124  /// - false, otherwise.
125  bool CanGetStructure(void) const;
126 
127  /// Reset Structure data member.
128  void ResetStructure(void);
129 
130  /// Get the Structure member data.
131  ///
132  /// @return
133  /// Reference to the member data.
134  const TStructure& GetStructure(void) const;
135 
136  /// Assign a value to Structure data member.
137  ///
138  /// @param value
139  /// Reference to value.
140  void SetStructure(TStructure& value);
141 
142  /// Assign a value to Structure data member.
143  ///
144  /// @return
145  /// Reference to the data value.
146  TStructure& SetStructure(void);
147 
148  /// Check if a value has been assigned to Sequences data member.
149  ///
150  /// Data member Sequences is mandatory;
151  /// its type is defined as 'typedef list< CRef< CSeq_entry > > TSequences'
152  /// @return
153  /// - true, if a value has been assigned.
154  /// - false, otherwise.
155  bool IsSetSequences(void) const;
156 
157  /// Check if it is safe to call GetSequences method.
158  ///
159  /// @return
160  /// - true, if the data member is getatable.
161  /// - false, otherwise.
162  bool CanGetSequences(void) const;
163 
164  /// Reset Sequences data member.
165  void ResetSequences(void);
166 
167  /// Get the Sequences member data.
168  ///
169  /// @return
170  /// Reference to the member data.
171  const TSequences& GetSequences(void) const;
172 
173  /// Assign a value to Sequences data member.
174  ///
175  /// @return
176  /// Reference to the data value.
177  TSequences& SetSequences(void);
178 
179  /// Check if a value has been assigned to Style_dictionary data member.
180  ///
181  /// Data member Style_dictionary is optional;
182  /// its type is defined as 'typedef CCn3d_style_dictionary TStyle_dictionary'
183  /// @return
184  /// - true, if a value has been assigned.
185  /// - false, otherwise.
186  bool IsSetStyle_dictionary(void) const;
187 
188  /// Check if it is safe to call GetStyle_dictionary method.
189  ///
190  /// @return
191  /// - true, if the data member is getatable.
192  /// - false, otherwise.
193  bool CanGetStyle_dictionary(void) const;
194 
195  /// Reset Style_dictionary data member.
196  void ResetStyle_dictionary(void);
197 
198  /// Get the Style_dictionary member data.
199  ///
200  /// @return
201  /// Reference to the member data.
202  const TStyle_dictionary& GetStyle_dictionary(void) const;
203 
204  /// Assign a value to Style_dictionary data member.
205  ///
206  /// @param value
207  /// Reference to value.
208  void SetStyle_dictionary(TStyle_dictionary& value);
209 
210  /// Assign a value to Style_dictionary data member.
211  ///
212  /// @return
213  /// Reference to the data value.
214  TStyle_dictionary& SetStyle_dictionary(void);
215 
216  /// Check if a value has been assigned to User_annotations data member.
217  ///
218  /// Data member User_annotations is optional;
219  /// its type is defined as 'typedef CCn3d_user_annotations TUser_annotations'
220  /// @return
221  /// - true, if a value has been assigned.
222  /// - false, otherwise.
223  bool IsSetUser_annotations(void) const;
224 
225  /// Check if it is safe to call GetUser_annotations method.
226  ///
227  /// @return
228  /// - true, if the data member is getatable.
229  /// - false, otherwise.
230  bool CanGetUser_annotations(void) const;
231 
232  /// Reset User_annotations data member.
233  void ResetUser_annotations(void);
234 
235  /// Get the User_annotations member data.
236  ///
237  /// @return
238  /// Reference to the member data.
239  const TUser_annotations& GetUser_annotations(void) const;
240 
241  /// Assign a value to User_annotations data member.
242  ///
243  /// @param value
244  /// Reference to value.
245  void SetUser_annotations(TUser_annotations& value);
246 
247  /// Assign a value to User_annotations data member.
248  ///
249  /// @return
250  /// Reference to the data value.
251  TUser_annotations& SetUser_annotations(void);
252 
253  /// Reset the whole object
254  virtual void Reset(void);
255 
256 
257 private:
258  // Prohibit copy constructor and assignment operator
261 
262  // data
263  Uint4 m_set_State[1];
265  list< CRef< CSeq_entry > > m_Sequences;
268 };
269 
270 /* @} */
271 
272 
273 
274 
275 
276 ///////////////////////////////////////////////////////////
277 ///////////////////// inline methods //////////////////////
278 ///////////////////////////////////////////////////////////
279 inline
281 {
282  return m_Structure.NotEmpty();
283 }
284 
285 inline
287 {
288  return true;
289 }
290 
291 inline
293 {
294  if ( !m_Structure ) {
295  const_cast<CBiostruc_seq_Base*>(this)->ResetStructure();
296  }
297  return (*m_Structure);
298 }
299 
300 inline
302 {
303  if ( !m_Structure ) {
304  ResetStructure();
305  }
306  return (*m_Structure);
307 }
308 
309 inline
311 {
312  return ((m_set_State[0] & 0xc) != 0);
313 }
314 
315 inline
317 {
318  return true;
319 }
320 
321 inline
323 {
324  return m_Sequences;
325 }
326 
327 inline
329 {
330  m_set_State[0] |= 0x4;
331  return m_Sequences;
332 }
333 
334 inline
336 {
337  return m_Style_dictionary.NotEmpty();
338 }
339 
340 inline
342 {
343  return IsSetStyle_dictionary();
344 }
345 
346 inline
348 {
349  if (!CanGetStyle_dictionary()) {
350  ThrowUnassigned(2);
351  }
352  return (*m_Style_dictionary);
353 }
354 
355 inline
357 {
358  return m_User_annotations.NotEmpty();
359 }
360 
361 inline
363 {
364  return IsSetUser_annotations();
365 }
366 
367 inline
369 {
370  if (!CanGetUser_annotations()) {
371  ThrowUnassigned(3);
372  }
373  return (*m_User_annotations);
374 }
375 
376 ///////////////////////////////////////////////////////////
377 ////////////////// end of inline methods //////////////////
378 ///////////////////////////////////////////////////////////
379 
380 
381 
382 
383 
384 END_objects_SCOPE // namespace ncbi::objects::
385 
387 
388 
389 #endif // OBJECTS_NCBIMIME_BIOSTRUC_SEQ_BASE_HPP
display structure seq added by yanli
CCn3d_style_dictionary –.
CCn3d_user_annotations –.
CRef –.
Definition: ncbiobj.hpp:618
Definition: Seq_entry.hpp:56
Base class for all serializable objects.
Definition: serialbase.hpp:150
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_NCBIMIME_EXPORT
Definition: ncbi_export.h:648
CCn3d_user_annotations TUser_annotations
CSerialObject Tparent
CBiostruc_seq_Base & operator=(const CBiostruc_seq_Base &)
CRef< TStyle_dictionary > m_Style_dictionary
CRef< TStructure > m_Structure
bool IsSetSequences(void) const
Check if a value has been assigned to Sequences data member.
bool CanGetSequences(void) const
Check if it is safe to call GetSequences method.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
bool IsSetStructure(void) const
Check if a value has been assigned to Structure data member.
TStructure & SetStructure(void)
Assign a value to Structure data member.
const TStructure & GetStructure(void) const
Get the Structure member data.
bool CanGetStructure(void) const
Check if it is safe to call GetStructure method.
CCn3d_style_dictionary TStyle_dictionary
list< CRef< CSeq_entry > > TSequences
const TUser_annotations & GetUser_annotations(void) const
Get the User_annotations member data.
CBiostruc_seq_Base(const CBiostruc_seq_Base &)
const TStyle_dictionary & GetStyle_dictionary(void) const
Get the Style_dictionary member data.
void ResetStructure(void)
Reset Structure data member.
const TSequences & GetSequences(void) const
Get the Sequences member data.
bool CanGetUser_annotations(void) const
Check if it is safe to call GetUser_annotations method.
CRef< TUser_annotations > m_User_annotations
bool IsSetUser_annotations(void) const
Check if a value has been assigned to User_annotations data member.
list< CRef< CSeq_entry > > m_Sequences
bool CanGetStyle_dictionary(void) const
Check if it is safe to call GetStyle_dictionary method.
bool IsSetStyle_dictionary(void) const
Check if a value has been assigned to Style_dictionary data member.
TSequences & SetSequences(void)
Assign a value to Sequences data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:12 2024 by modify_doxy.py rev. 669887