NCBI C++ ToolKit
Align_def_.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 Align_def_.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/seq/seq.asn">seq.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seq/seq.def">seq.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_SEQ_ALIGN_DEF_BASE_HPP
42 #define OBJECTS_SEQ_ALIGN_DEF_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 CSeq_id;
61 
62 
63 // generated classes
64 
65 
66 /** @addtogroup dataspec_NCBI_Sequence
67  *
68  * @{
69  */
70 
71 /////////////////////////////////////////////////////////////////////////////
72 ///
73 /// CAlign_def_Base --
74 ///
75 
77 {
79 public:
80  // constructor
81  CAlign_def_Base(void);
82  // destructor
83  virtual ~CAlign_def_Base(void);
84 
85  // type info
87 
88  /// class of align Seq-annot
89  enum EAlign_type {
90  eAlign_type_ref = 1, ///< set of alignments to the same sequence
91  eAlign_type_alt = 2, ///< set of alternate alignments of the same seqs
92  eAlign_type_blocks = 3, ///< set of aligned blocks in the same seqs
93  eAlign_type_other = 255
94  };
95 
96  /// Access to EAlign_type's attributes (values, names) as defined in spec
97  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EAlign_type)(void);
98 
99  // types
100  typedef int TAlign_type;
101  typedef list< CRef< CSeq_id > > TIds;
102 
103  // member index
104  enum class E_memberIndex {
105  e__allMandatory = 0,
106  e_align_type,
107  e_ids
108  };
110 
111  // getters
112  // setters
113 
114  /// Check if a value has been assigned to Align_type data member.
115  ///
116  /// Data member Align_type is mandatory;
117  /// its type is defined as 'typedef int TAlign_type'
118  /// @return
119  /// - true, if a value has been assigned.
120  /// - false, otherwise.
121  bool IsSetAlign_type(void) const;
122 
123  /// Check if it is safe to call GetAlign_type method.
124  ///
125  /// @return
126  /// - true, if the data member is getatable.
127  /// - false, otherwise.
128  bool CanGetAlign_type(void) const;
129 
130  /// Reset Align_type data member.
131  void ResetAlign_type(void);
132 
133  /// Get the Align_type member data.
134  ///
135  /// @return
136  /// Copy of the member data.
137  TAlign_type GetAlign_type(void) const;
138 
139  /// Assign a value to Align_type data member.
140  ///
141  /// @param value
142  /// Value to assign
143  void SetAlign_type(TAlign_type value);
144 
145  /// Assign a value to Align_type data member.
146  ///
147  /// @return
148  /// Reference to the data value.
149  TAlign_type& SetAlign_type(void);
150 
151  /// used for the one ref seqid for now
152  /// Check if a value has been assigned to Ids data member.
153  ///
154  /// Data member Ids is optional;
155  /// its type is defined as 'typedef list< CRef< CSeq_id > > TIds'
156  /// @return
157  /// - true, if a value has been assigned.
158  /// - false, otherwise.
159  bool IsSetIds(void) const;
160 
161  /// Check if it is safe to call GetIds method.
162  ///
163  /// @return
164  /// - true, if the data member is getatable.
165  /// - false, otherwise.
166  bool CanGetIds(void) const;
167 
168  /// Reset Ids data member.
169  void ResetIds(void);
170 
171  /// Get the Ids member data.
172  ///
173  /// @return
174  /// Reference to the member data.
175  const TIds& GetIds(void) const;
176 
177  /// Assign a value to Ids data member.
178  ///
179  /// @return
180  /// Reference to the data value.
181  TIds& SetIds(void);
182 
183  /// Reset the whole object
184  virtual void Reset(void);
185 
186 
187 private:
188  // Prohibit copy constructor and assignment operator
191 
192  // data
193  Uint4 m_set_State[1];
195  list< CRef< CSeq_id > > m_Ids;
196 };
197 
198 /* @} */
199 
200 
201 
202 
203 
204 ///////////////////////////////////////////////////////////
205 ///////////////////// inline methods //////////////////////
206 ///////////////////////////////////////////////////////////
207 inline
209 {
210  return ((m_set_State[0] & 0x3) != 0);
211 }
212 
213 inline
215 {
216  return IsSetAlign_type();
217 }
218 
219 inline
221 {
222  m_Align_type = (EAlign_type)(0);
223  m_set_State[0] &= ~0x3;
224 }
225 
226 inline
228 {
229  if (!CanGetAlign_type()) {
230  ThrowUnassigned(0);
231  }
232  return m_Align_type;
233 }
234 
235 inline
237 {
239  m_set_State[0] |= 0x3;
240 }
241 
242 inline
244 {
245 #ifdef _DEBUG
246  if (!IsSetAlign_type()) {
247  memset(&m_Align_type,UnassignedByte(),sizeof(m_Align_type));
248  }
249 #endif
250  m_set_State[0] |= 0x1;
251  return m_Align_type;
252 }
253 
254 inline
256 {
257  return ((m_set_State[0] & 0xc) != 0);
258 }
259 
260 inline
262 {
263  return true;
264 }
265 
266 inline
268 {
269  return m_Ids;
270 }
271 
272 inline
274 {
275  m_set_State[0] |= 0x4;
276  return m_Ids;
277 }
278 
279 ///////////////////////////////////////////////////////////
280 ////////////////// end of inline methods //////////////////
281 ///////////////////////////////////////////////////////////
282 
283 
284 
285 
286 
287 END_objects_SCOPE // namespace ncbi::objects::
288 
290 
291 
292 #endif // OBJECTS_SEQ_ALIGN_DEF_BASE_HPP
CAlign_def_Base –.
Definition: Align_def_.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
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
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_SEQ_EXPORT
Definition: ncbi_export.h:825
TAlign_type & SetAlign_type(void)
Assign a value to Align_type data member.
Definition: Align_def_.hpp:243
EAlign_type
class of align Seq-annot
Definition: Align_def_.hpp:89
TIds & SetIds(void)
Assign a value to Ids data member.
Definition: Align_def_.hpp:273
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
Definition: Align_def_.hpp:109
list< CRef< CSeq_id > > m_Ids
Definition: Align_def_.hpp:195
list< CRef< CSeq_id > > TIds
Definition: Align_def_.hpp:101
bool IsSetAlign_type(void) const
Check if a value has been assigned to Align_type data member.
Definition: Align_def_.hpp:208
CAlign_def_Base & operator=(const CAlign_def_Base &)
void ResetAlign_type(void)
Reset Align_type data member.
Definition: Align_def_.hpp:220
bool CanGetAlign_type(void) const
Check if it is safe to call GetAlign_type method.
Definition: Align_def_.hpp:214
TAlign_type GetAlign_type(void) const
Get the Align_type member data.
Definition: Align_def_.hpp:227
CAlign_def_Base(const CAlign_def_Base &)
bool CanGetIds(void) const
Check if it is safe to call GetIds method.
Definition: Align_def_.hpp:261
const TIds & GetIds(void) const
Get the Ids member data.
Definition: Align_def_.hpp:267
CSerialObject Tparent
Definition: Align_def_.hpp:78
Uint4 m_set_State[1]
Definition: Align_def_.hpp:193
bool IsSetIds(void) const
used for the one ref seqid for now Check if a value has been assigned to Ids data member.
Definition: Align_def_.hpp:255
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
static bool GetIds(const T &d, set< string > &labels, const string name="", bool detect=false, bool found=false)
Modified on Sat May 25 14:16:45 2024 by modify_doxy.py rev. 669887