NCBI C++ ToolKit
Molinfo_block_.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 Molinfo_block_.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_MOLINFO_BLOCK_BASE_HPP
42 #define OBJECTS_MACRO_MOLINFO_BLOCK_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 // forward declarations
58 
59 
60 // generated classes
61 
62 
63 /** @addtogroup dataspec_NCBI_Macro
64  *
65  * @{
66  */
67 
68 /////////////////////////////////////////////////////////////////////////////
69 ///
70 /// CMolinfo_block_Base --
71 ///
72 
74 {
76 public:
77  // constructor
78  CMolinfo_block_Base(void);
79  // destructor
80  virtual ~CMolinfo_block_Base(void);
81 
82  // type info
84 
85  // types
89 
90  // member index
91  enum class E_memberIndex {
92  e__allMandatory = 0,
93  e_to_list,
96  };
98 
99  // getters
100  // setters
101 
102  /// Check if a value has been assigned to To_list data member.
103  ///
104  /// Data member To_list is mandatory;
105  /// its type is defined as 'typedef CMolinfo_field_list TTo_list'
106  /// @return
107  /// - true, if a value has been assigned.
108  /// - false, otherwise.
109  bool IsSetTo_list(void) const;
110 
111  /// Check if it is safe to call GetTo_list method.
112  ///
113  /// @return
114  /// - true, if the data member is getatable.
115  /// - false, otherwise.
116  bool CanGetTo_list(void) const;
117 
118  /// Reset To_list data member.
119  void ResetTo_list(void);
120 
121  /// Get the To_list member data.
122  ///
123  /// @return
124  /// Reference to the member data.
125  const TTo_list& GetTo_list(void) const;
126 
127  /// Assign a value to To_list data member.
128  ///
129  /// @param value
130  /// Reference to value.
131  void SetTo_list(TTo_list& value);
132 
133  /// Assign a value to To_list data member.
134  ///
135  /// @return
136  /// Reference to the data value.
137  TTo_list& SetTo_list(void);
138 
139  /// Check if a value has been assigned to From_list data member.
140  ///
141  /// Data member From_list is optional;
142  /// its type is defined as 'typedef CMolinfo_field_list TFrom_list'
143  /// @return
144  /// - true, if a value has been assigned.
145  /// - false, otherwise.
146  bool IsSetFrom_list(void) const;
147 
148  /// Check if it is safe to call GetFrom_list method.
149  ///
150  /// @return
151  /// - true, if the data member is getatable.
152  /// - false, otherwise.
153  bool CanGetFrom_list(void) const;
154 
155  /// Reset From_list data member.
156  void ResetFrom_list(void);
157 
158  /// Get the From_list member data.
159  ///
160  /// @return
161  /// Reference to the member data.
162  const TFrom_list& GetFrom_list(void) const;
163 
164  /// Assign a value to From_list data member.
165  ///
166  /// @param value
167  /// Reference to value.
169 
170  /// Assign a value to From_list data member.
171  ///
172  /// @return
173  /// Reference to the data value.
174  TFrom_list& SetFrom_list(void);
175 
176  /// Check if a value has been assigned to Constraint data member.
177  ///
178  /// Data member Constraint is optional;
179  /// its type is defined as 'typedef CConstraint_choice_set TConstraint'
180  /// @return
181  /// - true, if a value has been assigned.
182  /// - false, otherwise.
183  bool IsSetConstraint(void) const;
184 
185  /// Check if it is safe to call GetConstraint method.
186  ///
187  /// @return
188  /// - true, if the data member is getatable.
189  /// - false, otherwise.
190  bool CanGetConstraint(void) const;
191 
192  /// Reset Constraint data member.
193  void ResetConstraint(void);
194 
195  /// Get the Constraint member data.
196  ///
197  /// @return
198  /// Reference to the member data.
199  const TConstraint& GetConstraint(void) const;
200 
201  /// Assign a value to Constraint data member.
202  ///
203  /// @param value
204  /// Reference to value.
206 
207  /// Assign a value to Constraint data member.
208  ///
209  /// @return
210  /// Reference to the data value.
211  TConstraint& SetConstraint(void);
212 
213  /// Reset the whole object
214  virtual void Reset(void);
215 
216 
217 private:
218  // Prohibit copy constructor and assignment operator
221 
222  // data
227 };
228 
229 /* @} */
230 
231 
232 
233 
234 
235 ///////////////////////////////////////////////////////////
236 ///////////////////// inline methods //////////////////////
237 ///////////////////////////////////////////////////////////
238 inline
240 {
241  return m_To_list.NotEmpty();
242 }
243 
244 inline
246 {
247  return true;
248 }
249 
250 inline
252 {
253  if ( !m_To_list ) {
254  const_cast<CMolinfo_block_Base*>(this)->ResetTo_list();
255  }
256  return (*m_To_list);
257 }
258 
259 inline
261 {
262  if ( !m_To_list ) {
263  ResetTo_list();
264  }
265  return (*m_To_list);
266 }
267 
268 inline
270 {
271  return m_From_list.NotEmpty();
272 }
273 
274 inline
276 {
277  return IsSetFrom_list();
278 }
279 
280 inline
282 {
283  if (!CanGetFrom_list()) {
284  ThrowUnassigned(1);
285  }
286  return (*m_From_list);
287 }
288 
289 inline
291 {
292  return m_Constraint.NotEmpty();
293 }
294 
295 inline
297 {
298  return IsSetConstraint();
299 }
300 
301 inline
303 {
304  if (!CanGetConstraint()) {
305  ThrowUnassigned(2);
306  }
307  return (*m_Constraint);
308 }
309 
310 ///////////////////////////////////////////////////////////
311 ////////////////// end of inline methods //////////////////
312 ///////////////////////////////////////////////////////////
313 
314 
315 
316 
317 
318 END_objects_SCOPE // namespace ncbi::objects::
319 
321 
322 
323 #endif // OBJECTS_MACRO_MOLINFO_BLOCK_BASE_HPP
CMolinfo_block_Base –.
CMolinfo_field_list –.
CRef –.
Definition: ncbiobj.hpp:618
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
virtual ~CMolinfo_block_Base(void)
CMolinfo_block_Base(const CMolinfo_block_Base &)
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
CRef< TConstraint > m_Constraint
bool CanGetConstraint(void) const
Check if it is safe to call GetConstraint method.
TTo_list & SetTo_list(void)
Assign a value to To_list data member.
bool IsSetFrom_list(void) const
Check if a value has been assigned to From_list data member.
CConstraint_choice_set TConstraint
const TConstraint & GetConstraint(void) const
Get the Constraint member data.
const TFrom_list & GetFrom_list(void) const
Get the From_list member data.
virtual void Reset(void)
Reset the whole object.
TFrom_list & SetFrom_list(void)
Assign a value to From_list data member.
const TTo_list & GetTo_list(void) const
Get the To_list member data.
CMolinfo_field_list TFrom_list
bool IsSetTo_list(void) const
Check if a value has been assigned to To_list data member.
CMolinfo_field_list TTo_list
TConstraint & SetConstraint(void)
Assign a value to Constraint data member.
void ResetTo_list(void)
Reset To_list data member.
CRef< TFrom_list > m_From_list
bool CanGetFrom_list(void) const
Check if it is safe to call GetFrom_list method.
bool IsSetConstraint(void) const
Check if a value has been assigned to Constraint data member.
CRef< TTo_list > m_To_list
bool CanGetTo_list(void) const
Check if it is safe to call GetTo_list method.
void ResetConstraint(void)
Reset Constraint data member.
CSerialObject Tparent
CMolinfo_block_Base & operator=(const CMolinfo_block_Base &)
void ResetFrom_list(void)
Reset From_list data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:37 2024 by modify_doxy.py rev. 669887