NCBI C++ ToolKit
GCClientRequest_.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 GCClientRequest_.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/genomecoll/gencoll_client.asn">gencoll_client.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/genomecoll/gencoll_client.def">gencoll_client.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_GENOMECOLL_GCCLIENTREQUEST_BASE_HPP
42 #define OBJECTS_GENOMECOLL_GCCLIENTREQUEST_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
60 
61 
62 // generated classes
63 
64 
65 /** @addtogroup dataspec_NCBI_GencollClient
66  *
67  * @{
68  */
69 
70 /////////////////////////////////////////////////////////////////////////////
71 ///
72 /// CGCClientRequest_Base --
73 ///
74 
76 {
78 public:
79  // constructor
81  // destructor
82  virtual ~CGCClientRequest_Base(void);
83 
84  // type info
86 
87 
88  /// Choice variants.
89  enum E_Choice {
90  e_not_set = 0, ///< No variant selected
95  };
96  /// Maximum+1 value of the choice variant enumerator.
98  e_MaxChoice = 5 ///< == e_Get_assembly_by_sequence+1
99  };
100 
101  /// Reset the whole object
102  virtual void Reset(void);
103 
104  /// Reset the selection (set it to e_not_set).
105  virtual void ResetSelection(void);
106 
107  /// Which variant is currently selected.
108  ///
109  /// @return
110  /// Choice state enumerator.
111  E_Choice Which(void) const;
112 
113  /// Verify selection, throw exception if it differs from the expected.
114  ///
115  /// @param index
116  /// Expected selection.
117  void CheckSelected(E_Choice index) const;
118 
119  /// Throw 'InvalidSelection' exception.
120  ///
121  /// @param index
122  /// Expected selection.
123  NCBI_NORETURN void ThrowInvalidSelection(E_Choice index) const;
124 
125  /// Retrieve selection name (for diagnostic purposes).
126  ///
127  /// @param index
128  /// One of possible selection states.
129  /// @return
130  /// Name string.
131  static string SelectionName(E_Choice index);
132 
133  /// Select the requested variant if needed.
134  ///
135  /// @param index
136  /// New selection state.
137  /// @param reset
138  /// Flag that defines the resetting of the variant data. The data will
139  /// be reset if either the current selection differs from the new one,
140  /// or the flag is set to eDoResetVariant.
142  /// Select the requested variant if needed,
143  /// allocating CObject variants from memory pool.
144  void Select(E_Choice index,
145  EResetVariant reset,
146  CObjectMemoryPool* pool);
147 
148  // types
153 
154  // getters
155  // setters
156 
157 
158  /// Check if variant Get_chrtype_valid is selected.
159  ///
160  /// Get_chrtype_valid type is defined as 'typedef CGCClient_ValidateChrTypeLocRequest TGet_chrtype_valid'.
161  /// @return
162  /// - true, if the variant is selected.
163  /// - false, otherwise.
164  bool IsGet_chrtype_valid(void) const;
165 
166  /// Get the variant data.
167  ///
168  /// @return
169  /// Reference to the data.
170  const TGet_chrtype_valid& GetGet_chrtype_valid(void) const;
171 
172  /// Select the variant.
173  ///
174  /// @return
175  /// Reference to the variant data.
177  /// Select the variant and set its data.
178  ///
179  /// @param value
180  /// Reference to the data.
182 
183 
184  /// Check if variant Get_equivalent_assemblies is selected.
185  ///
186  /// Get_equivalent_assemblies type is defined as 'typedef CGCClient_GetEquivalentAssembliesRequest TGet_equivalent_assemblies'.
187  /// @return
188  /// - true, if the variant is selected.
189  /// - false, otherwise.
190  bool IsGet_equivalent_assemblies(void) const;
191 
192  /// Get the variant data.
193  ///
194  /// @return
195  /// Reference to the data.
197 
198  /// Select the variant.
199  ///
200  /// @return
201  /// Reference to the variant data.
203  /// Select the variant and set its data.
204  ///
205  /// @param value
206  /// Reference to the data.
208 
209 
210  /// Check if variant Get_assembly_blob is selected.
211  ///
212  /// Get_assembly_blob type is defined as 'typedef CGCClient_GetAssemblyBlobRequest TGet_assembly_blob'.
213  /// @return
214  /// - true, if the variant is selected.
215  /// - false, otherwise.
216  bool IsGet_assembly_blob(void) const;
217 
218  /// Get the variant data.
219  ///
220  /// @return
221  /// Reference to the data.
222  const TGet_assembly_blob& GetGet_assembly_blob(void) const;
223 
224  /// Select the variant.
225  ///
226  /// @return
227  /// Reference to the variant data.
229  /// Select the variant and set its data.
230  ///
231  /// @param value
232  /// Reference to the data.
234 
235 
236  /// Check if variant Get_assembly_by_sequence is selected.
237  ///
238  /// Get_assembly_by_sequence type is defined as 'typedef CGCClient_GetAssemblyBySequenceRequest TGet_assembly_by_sequence'.
239  /// @return
240  /// - true, if the variant is selected.
241  /// - false, otherwise.
242  bool IsGet_assembly_by_sequence(void) const;
243 
244  /// Get the variant data.
245  ///
246  /// @return
247  /// Reference to the data.
249 
250  /// Select the variant.
251  ///
252  /// @return
253  /// Reference to the variant data.
255  /// Select the variant and set its data.
256  ///
257  /// @param value
258  /// Reference to the data.
260 
261 
262 private:
263  // copy constructor and assignment operator
266  // choice state
268  // helper methods
269  void DoSelect(E_Choice index, CObjectMemoryPool* pool = 0);
270 
271  static const char* const sm_SelectionNames[];
272  // data
273  NCBI_NS_NCBI::CSerialObject *m_object;
274 };
275 
276 /* @} */
277 
278 
279 
280 
281 
282 ///////////////////////////////////////////////////////////
283 ///////////////////// inline methods //////////////////////
284 ///////////////////////////////////////////////////////////
285 inline
287 {
288  return m_choice;
289 }
290 
291 inline
293 {
294  if ( m_choice != index )
295  ThrowInvalidSelection(index);
296 }
297 
298 inline
299 void CGCClientRequest_Base::Select(E_Choice index, NCBI_NS_NCBI::EResetVariant reset, NCBI_NS_NCBI::CObjectMemoryPool* pool)
300 {
301  if ( reset == NCBI_NS_NCBI::eDoResetVariant || m_choice != index ) {
302  if ( m_choice != e_not_set )
303  ResetSelection();
304  DoSelect(index, pool);
305  }
306 }
307 
308 inline
310 {
311  Select(index, reset, 0);
312 }
313 
314 inline
316 {
317  return m_choice == e_Get_chrtype_valid;
318 }
319 
320 inline
322 {
324 }
325 
326 inline
328 {
329  return m_choice == e_Get_assembly_blob;
330 }
331 
332 inline
334 {
336 }
337 
338 ///////////////////////////////////////////////////////////
339 ////////////////// end of inline methods //////////////////
340 ///////////////////////////////////////////////////////////
341 
342 
343 
344 
345 
346 END_objects_SCOPE // namespace ncbi::objects::
347 
349 
350 
351 #endif // OBJECTS_GENOMECOLL_GCCLIENTREQUEST_BASE_HPP
CGCClientRequest_Base –.
CGCClient_GetAssemblyBlobRequest –.
CGCClient_GetEquivalentAssembliesRequest –.
CGCClient_ValidateChrTypeLocRequest –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
EResetVariant
Definition: serialbase.hpp:76
@ eDoResetVariant
Definition: serialbase.hpp:77
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
virtual ~CGCClientRequest_Base(void)
CGCClientRequest_Base(const CGCClientRequest_Base &)
const TGet_assembly_by_sequence & GetGet_assembly_by_sequence(void) const
Get the variant data.
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
bool IsGet_assembly_blob(void) const
Check if variant Get_assembly_blob is selected.
static const char *const sm_SelectionNames[]
bool IsGet_assembly_by_sequence(void) const
Check if variant Get_assembly_by_sequence is selected.
NCBI_NS_NCBI::CSerialObject * m_object
const TGet_assembly_blob & GetGet_assembly_blob(void) const
Get the variant data.
virtual void Reset(void)
Reset the whole object.
CGCClientRequest_Base & operator=(const CGCClientRequest_Base &)
E_Choice
Choice variants.
TGet_chrtype_valid & SetGet_chrtype_valid(void)
Select the variant.
CGCClient_GetAssemblyBySequenceRequest TGet_assembly_by_sequence
E_Choice Which(void) const
Which variant is currently selected.
virtual void ResetSelection(void)
Reset the selection (set it to e_not_set).
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
const TGet_chrtype_valid & GetGet_chrtype_valid(void) const
Get the variant data.
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
TGet_equivalent_assemblies & SetGet_equivalent_assemblies(void)
Select the variant.
CGCClient_GetAssemblyBlobRequest TGet_assembly_blob
E_ChoiceStopper
Maximum+1 value of the choice variant enumerator.
CGCClient_GetEquivalentAssembliesRequest TGet_equivalent_assemblies
TGet_assembly_by_sequence & SetGet_assembly_by_sequence(void)
Select the variant.
TGet_assembly_blob & SetGet_assembly_blob(void)
Select the variant.
bool IsGet_chrtype_valid(void) const
Check if variant Get_chrtype_valid is selected.
CGCClient_ValidateChrTypeLocRequest TGet_chrtype_valid
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
const TGet_equivalent_assemblies & GetGet_equivalent_assemblies(void) const
Get the variant data.
void Select(E_Choice index, EResetVariant reset, CObjectMemoryPool *pool)
Select the requested variant if needed, allocating CObject variants from memory pool.
bool IsGet_equivalent_assemblies(void) const
Check if variant Get_equivalent_assemblies is selected.
@ e_not_set
No variant selected.
@ e_MaxChoice
== e_Get_assembly_by_sequence+1
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed May 29 18:41:47 2024 by modify_doxy.py rev. 669887