NCBI C++ ToolKit
Sparse_seg_ext_.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 Sparse_seg_ext_.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/seqalign/seqalign.asn">seqalign.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqalign/seqalign.def">seqalign.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_SEQALIGN_SPARSE_SEG_EXT_BASE_HPP
42 #define OBJECTS_SEQALIGN_SPARSE_SEG_EXT_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 // generated classes
56 
57 
58 /** @addtogroup dataspec_NCBI_Seqalign
59  *
60  * @{
61  */
62 
63 /////////////////////////////////////////////////////////////////////////////
64 ///
65 /// CSparse_seg_ext_Base --
66 ///
67 
69 {
71 public:
72  // constructor
74  // destructor
75  virtual ~CSparse_seg_ext_Base(void);
76 
77  // type info
79 
80  // types
81  typedef int TIndex;
82 
83  // member index
84  enum class E_memberIndex {
85  e__allMandatory = 0,
86  e_index
87  };
89 
90  // getters
91  // setters
92 
93  ///seg-ext SET OF {
94  /// index INTEGER,
95  /// data User-field
96  /// }
97  /// Check if a value has been assigned to Index data member.
98  ///
99  /// Data member Index is mandatory;
100  /// its type is defined as 'typedef int TIndex'
101  /// @return
102  /// - true, if a value has been assigned.
103  /// - false, otherwise.
104  bool IsSetIndex(void) const;
105 
106  /// Check if it is safe to call GetIndex method.
107  ///
108  /// @return
109  /// - true, if the data member is getatable.
110  /// - false, otherwise.
111  bool CanGetIndex(void) const;
112 
113  /// Reset Index data member.
114  void ResetIndex(void);
115 
116  /// Get the Index member data.
117  ///
118  /// @return
119  /// Copy of the member data.
120  TIndex GetIndex(void) const;
121 
122  /// Assign a value to Index data member.
123  ///
124  /// @param value
125  /// Value to assign
126  void SetIndex(TIndex value);
127 
128  /// Assign a value to Index data member.
129  ///
130  /// @return
131  /// Reference to the data value.
132  TIndex& SetIndex(void);
133 
134  /// Reset the whole object
135  virtual void Reset(void);
136 
137 
138 private:
139  // Prohibit copy constructor and assignment operator
142 
143  // data
144  Uint4 m_set_State[1];
145  int m_Index;
146 };
147 
148 /* @} */
149 
150 
151 
152 
153 
154 ///////////////////////////////////////////////////////////
155 ///////////////////// inline methods //////////////////////
156 ///////////////////////////////////////////////////////////
157 inline
159 {
160  return ((m_set_State[0] & 0x3) != 0);
161 }
162 
163 inline
165 {
166  return IsSetIndex();
167 }
168 
169 inline
171 {
172  m_Index = 0;
173  m_set_State[0] &= ~0x3;
174 }
175 
176 inline
178 {
179  if (!CanGetIndex()) {
180  ThrowUnassigned(0);
181  }
182  return m_Index;
183 }
184 
185 inline
187 {
188  m_Index = value;
189  m_set_State[0] |= 0x3;
190 }
191 
192 inline
194 {
195 #ifdef _DEBUG
196  if (!IsSetIndex()) {
197  memset(&m_Index,UnassignedByte(),sizeof(m_Index));
198  }
199 #endif
200  m_set_State[0] |= 0x1;
201  return m_Index;
202 }
203 
204 ///////////////////////////////////////////////////////////
205 ////////////////// end of inline methods //////////////////
206 ///////////////////////////////////////////////////////////
207 
208 
209 
210 
211 
212 END_objects_SCOPE // namespace ncbi::objects::
213 
215 
216 
217 #endif // OBJECTS_SEQALIGN_SPARSE_SEG_EXT_BASE_HPP
Base class for all serializable objects.
Definition: serialbase.hpp:150
CSparse_seg_ext_Base –.
static char UnassignedByte(void)
Definition: serialbase.hpp:181
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_SEQALIGN_EXPORT
Definition: ncbi_export.h:744
CSparse_seg_ext_Base(const CSparse_seg_ext_Base &)
CSparse_seg_ext_Base & operator=(const CSparse_seg_ext_Base &)
bool IsSetIndex(void) const
seg-ext SET OF { index INTEGER, data User-field } Check if a value has been assigned to Index data me...
Tparent::CMemberIndex< E_memberIndex, 2 > TmemberIndex
TIndex GetIndex(void) const
Get the Index member data.
TIndex & SetIndex(void)
Assign a value to Index data member.
void ResetIndex(void)
Reset Index data member.
bool CanGetIndex(void) const
Check if it is safe to call GetIndex method.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sat Apr 20 12:18:39 2024 by modify_doxy.py rev. 669887