NCBI C++ ToolKit
Publication_constraint_.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 Publication_constraint_.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_PUBLICATION_CONSTRAINT_BASE_HPP
42 #define OBJECTS_MACRO_PUBLICATION_CONSTRAINT_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 // forward declarations
62 
63 
64 // generated classes
65 
66 
67 /** @addtogroup dataspec_NCBI_Macro
68  *
69  * @{
70  */
71 
72 /////////////////////////////////////////////////////////////////////////////
73 ///
74 /// CPublication_constraint_Base --
75 ///
76 
78 {
80 public:
81  // constructor
83  // destructor
84  virtual ~CPublication_constraint_Base(void);
85 
86  // type info
88 
89  // types
90  typedef EPub_type TType;
93 
94  // member index
95  enum class E_memberIndex {
96  e__allMandatory = 0,
97  e_type,
98  e_field,
100  };
102 
103  // getters
104  // setters
105 
106  /// Check if a value has been assigned to Type data member.
107  ///
108  /// Data member Type is mandatory;
109  /// its type is defined as 'typedef EPub_type TType'
110  /// @return
111  /// - true, if a value has been assigned.
112  /// - false, otherwise.
113  bool IsSetType(void) const;
114 
115  /// Check if it is safe to call GetType method.
116  ///
117  /// @return
118  /// - true, if the data member is getatable.
119  /// - false, otherwise.
120  bool CanGetType(void) const;
121 
122  /// Reset Type data member.
123  void ResetType(void);
124 
125  /// Get the Type member data.
126  ///
127  /// @return
128  /// Copy of the member data.
129  TType GetType(void) const;
130 
131  /// Assign a value to Type data member.
132  ///
133  /// @param value
134  /// Value to assign
135  void SetType(TType value);
136 
137  /// Assign a value to Type data member.
138  ///
139  /// @return
140  /// Reference to the data value.
141  TType& SetType(void);
142 
143  /// Check if a value has been assigned to Field data member.
144  ///
145  /// Data member Field is optional;
146  /// its type is defined as 'typedef CPub_field_constraint TField'
147  /// @return
148  /// - true, if a value has been assigned.
149  /// - false, otherwise.
150  bool IsSetField(void) const;
151 
152  /// Check if it is safe to call GetField method.
153  ///
154  /// @return
155  /// - true, if the data member is getatable.
156  /// - false, otherwise.
157  bool CanGetField(void) const;
158 
159  /// Reset Field data member.
160  void ResetField(void);
161 
162  /// Get the Field member data.
163  ///
164  /// @return
165  /// Reference to the member data.
166  const TField& GetField(void) const;
167 
168  /// Assign a value to Field data member.
169  ///
170  /// @param value
171  /// Reference to value.
172  void SetField(TField& value);
173 
174  /// Assign a value to Field data member.
175  ///
176  /// @return
177  /// Reference to the data value.
178  TField& SetField(void);
179 
180  /// Check if a value has been assigned to Special_field data member.
181  ///
182  /// Data member Special_field is optional;
183  /// its type is defined as 'typedef CPub_field_special_constraint TSpecial_field'
184  /// @return
185  /// - true, if a value has been assigned.
186  /// - false, otherwise.
187  bool IsSetSpecial_field(void) const;
188 
189  /// Check if it is safe to call GetSpecial_field method.
190  ///
191  /// @return
192  /// - true, if the data member is getatable.
193  /// - false, otherwise.
194  bool CanGetSpecial_field(void) const;
195 
196  /// Reset Special_field data member.
197  void ResetSpecial_field(void);
198 
199  /// Get the Special_field member data.
200  ///
201  /// @return
202  /// Reference to the member data.
203  const TSpecial_field& GetSpecial_field(void) const;
204 
205  /// Assign a value to Special_field data member.
206  ///
207  /// @param value
208  /// Reference to value.
210 
211  /// Assign a value to Special_field data member.
212  ///
213  /// @return
214  /// Reference to the data value.
216 
217  /// Reset the whole object
218  virtual void Reset(void);
219 
220 
221 private:
222  // Prohibit copy constructor and assignment operator
225 
226  // data
231 };
232 
233 /* @} */
234 
235 
236 
237 
238 
239 ///////////////////////////////////////////////////////////
240 ///////////////////// inline methods //////////////////////
241 ///////////////////////////////////////////////////////////
242 inline
244 {
245  return ((m_set_State[0] & 0x3) != 0);
246 }
247 
248 inline
250 {
251  return IsSetType();
252 }
253 
254 inline
256 {
258  m_set_State[0] &= ~0x3;
259 }
260 
261 inline
263 {
264  if (!CanGetType()) {
265  ThrowUnassigned(0);
266  }
267  return m_Type;
268 }
269 
270 inline
272 {
273  m_Type = value;
274  m_set_State[0] |= 0x3;
275 }
276 
277 inline
279 {
280 #ifdef _DEBUG
281  if (!IsSetType()) {
282  memset(&m_Type,UnassignedByte(),sizeof(m_Type));
283  }
284 #endif
285  m_set_State[0] |= 0x1;
286  return m_Type;
287 }
288 
289 inline
291 {
292  return m_Field.NotEmpty();
293 }
294 
295 inline
297 {
298  return IsSetField();
299 }
300 
301 inline
303 {
304  if (!CanGetField()) {
305  ThrowUnassigned(1);
306  }
307  return (*m_Field);
308 }
309 
310 inline
312 {
313  return m_Special_field.NotEmpty();
314 }
315 
316 inline
318 {
319  return IsSetSpecial_field();
320 }
321 
322 inline
324 {
325  if (!CanGetSpecial_field()) {
326  ThrowUnassigned(2);
327  }
328  return (*m_Special_field);
329 }
330 
331 ///////////////////////////////////////////////////////////
332 ////////////////// end of inline methods //////////////////
333 ///////////////////////////////////////////////////////////
334 
335 
336 
337 
338 
339 END_objects_SCOPE // namespace ncbi::objects::
340 
342 
343 
344 #endif // OBJECTS_MACRO_PUBLICATION_CONSTRAINT_BASE_HPP
User-defined methods of the data storage class.
CPub_field_constraint –.
CPub_field_special_constraint –.
CPublication_constraint_Base –.
CRef –.
Definition: ncbiobj.hpp:618
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
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
const TSpecial_field & GetSpecial_field(void) const
Get the Special_field member data.
bool CanGetField(void) const
Check if it is safe to call GetField method.
bool IsSetField(void) const
Check if a value has been assigned to Field data member.
void ResetField(void)
Reset Field data member.
virtual void Reset(void)
Reset the whole object.
TType & SetType(void)
Assign a value to Type data member.
bool IsSetSpecial_field(void) const
Check if a value has been assigned to Special_field data member.
const TField & GetField(void) const
Get the Field member data.
CPublication_constraint_Base & operator=(const CPublication_constraint_Base &)
void ResetType(void)
Reset Type data member.
bool IsSetType(void) const
Check if a value has been assigned to Type data member.
bool CanGetType(void) const
Check if it is safe to call GetType method.
TType GetType(void) const
Get the Type member data.
TSpecial_field & SetSpecial_field(void)
Assign a value to Special_field data member.
CPub_field_special_constraint TSpecial_field
CPublication_constraint_Base(const CPublication_constraint_Base &)
EPub_type
complex constraints
Definition: Pub_type_.hpp:64
TField & SetField(void)
Assign a value to Field data member.
bool CanGetSpecial_field(void) const
Check if it is safe to call GetSpecial_field method.
void ResetSpecial_field(void)
Reset Special_field data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Thu May 30 12:23:52 2024 by modify_doxy.py rev. 669887