NCBI C++ ToolKit
Partial_3_set_action_.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 Partial_3_set_action_.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/macro/macro.asn">macro.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/macro/macro.def">macro.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_MACRO_PARTIAL_3_SET_ACTION_BASE_HPP
42 #define OBJECTS_MACRO_PARTIAL_3_SET_ACTION_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
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 // generated classes
60 
61 
62 /** @addtogroup dataspec_NCBI_Macro
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///
69 /// CPartial_3_set_action_Base --
70 ///
71 
73 {
75 public:
76  // constructor
78  // destructor
79  virtual ~CPartial_3_set_action_Base(void);
80 
81  // type info
83 
84  // types
86  typedef bool TExtend;
87 
88  // member index
89  enum class E_memberIndex {
90  e__allMandatory = 0,
92  e_extend
93  };
95 
96  // getters
97  // setters
98 
99  /// Check if a value has been assigned to Constraint data member.
100  ///
101  /// Data member Constraint is mandatory;
102  /// its type is defined as 'typedef EPartial_3_set_constraint TConstraint'
103  /// @return
104  /// - true, if a value has been assigned.
105  /// - false, otherwise.
106  bool IsSetConstraint(void) const;
107 
108  /// Check if it is safe to call GetConstraint method.
109  ///
110  /// @return
111  /// - true, if the data member is getatable.
112  /// - false, otherwise.
113  bool CanGetConstraint(void) const;
114 
115  /// Reset Constraint data member.
116  void ResetConstraint(void);
117 
118  /// Get the Constraint member data.
119  ///
120  /// @return
121  /// Copy of the member data.
122  TConstraint GetConstraint(void) const;
123 
124  /// Assign a value to Constraint data member.
125  ///
126  /// @param value
127  /// Value to assign
129 
130  /// Assign a value to Constraint data member.
131  ///
132  /// @return
133  /// Reference to the data value.
134  TConstraint& SetConstraint(void);
135 
136  /// Check if a value has been assigned to Extend data member.
137  ///
138  /// Data member Extend is mandatory;
139  /// its type is defined as 'typedef bool TExtend'
140  /// @return
141  /// - true, if a value has been assigned.
142  /// - false, otherwise.
143  bool IsSetExtend(void) const;
144 
145  /// Check if it is safe to call GetExtend method.
146  ///
147  /// @return
148  /// - true, if the data member is getatable.
149  /// - false, otherwise.
150  bool CanGetExtend(void) const;
151 
152  /// Reset Extend data member.
153  void ResetExtend(void);
154 
155  /// Get the Extend member data.
156  ///
157  /// @return
158  /// Copy of the member data.
159  TExtend GetExtend(void) const;
160 
161  /// Assign a value to Extend data member.
162  ///
163  /// @param value
164  /// Value to assign
165  void SetExtend(TExtend value);
166 
167  /// Assign a value to Extend data member.
168  ///
169  /// @return
170  /// Reference to the data value.
171  TExtend& SetExtend(void);
172 
173  /// Reset the whole object
174  virtual void Reset(void);
175 
176 
177 private:
178  // Prohibit copy constructor and assignment operator
181 
182  // data
185  bool m_Extend;
186 };
187 
188 /* @} */
189 
190 
191 
192 
193 
194 ///////////////////////////////////////////////////////////
195 ///////////////////// inline methods //////////////////////
196 ///////////////////////////////////////////////////////////
197 inline
199 {
200  return ((m_set_State[0] & 0x3) != 0);
201 }
202 
203 inline
205 {
206  return IsSetConstraint();
207 }
208 
209 inline
211 {
213  m_set_State[0] &= ~0x3;
214 }
215 
216 inline
218 {
219  if (!CanGetConstraint()) {
220  ThrowUnassigned(0);
221  }
222  return m_Constraint;
223 }
224 
225 inline
227 {
229  m_set_State[0] |= 0x3;
230 }
231 
232 inline
234 {
235 #ifdef _DEBUG
236  if (!IsSetConstraint()) {
237  memset(&m_Constraint,UnassignedByte(),sizeof(m_Constraint));
238  }
239 #endif
240  m_set_State[0] |= 0x1;
241  return m_Constraint;
242 }
243 
244 inline
246 {
247  return ((m_set_State[0] & 0xc) != 0);
248 }
249 
250 inline
252 {
253  return IsSetExtend();
254 }
255 
256 inline
258 {
259  m_Extend = 0;
260  m_set_State[0] &= ~0xc;
261 }
262 
263 inline
265 {
266  if (!CanGetExtend()) {
267  ThrowUnassigned(1);
268  }
269  return m_Extend;
270 }
271 
272 inline
274 {
275  m_Extend = value;
276  m_set_State[0] |= 0xc;
277 }
278 
279 inline
281 {
282 #ifdef _DEBUG
283  if (!IsSetExtend()) {
284  memset(&m_Extend,UnassignedByte(),sizeof(m_Extend));
285  }
286 #endif
287  m_set_State[0] |= 0x4;
288  return m_Extend;
289 }
290 
291 ///////////////////////////////////////////////////////////
292 ////////////////// end of inline methods //////////////////
293 ///////////////////////////////////////////////////////////
294 
295 
296 
297 
298 
299 END_objects_SCOPE // namespace ncbi::objects::
300 
302 
303 
304 #endif // OBJECTS_MACRO_PARTIAL_3_SET_ACTION_BASE_HPP
User-defined methods of the data storage class.
CPartial_3_set_action_Base –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
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
bool IsSetExtend(void) const
Check if a value has been assigned to Extend data member.
CPartial_3_set_action_Base(const CPartial_3_set_action_Base &)
bool CanGetConstraint(void) const
Check if it is safe to call GetConstraint method.
EPartial_3_set_constraint TConstraint
virtual void Reset(void)
Reset the whole object.
TExtend GetExtend(void) const
Get the Extend member data.
TConstraint & SetConstraint(void)
Assign a value to Constraint data member.
void ResetExtend(void)
Reset Extend data member.
TExtend & SetExtend(void)
Assign a value to Extend data member.
bool IsSetConstraint(void) const
Check if a value has been assigned to Constraint data member.
EPartial_3_set_constraint
Access to EPartial_3_set_constraint's attributes (values, names) as defined in spec.
bool CanGetExtend(void) const
Check if it is safe to call GetExtend method.
EPartial_3_set_constraint m_Constraint
CPartial_3_set_action_Base & operator=(const CPartial_3_set_action_Base &)
TConstraint GetConstraint(void) const
Get the Constraint member data.
void ResetConstraint(void)
Reset Constraint data member.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed May 29 18:37:00 2024 by modify_doxy.py rev. 669887