NCBI C++ ToolKit
ID2S_Reply_Get_Chunk_.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 ID2S_Reply_Get_Chunk_.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/id2/id2.asn">id2.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/id2/id2.def">id2.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_ID2_ID2S_REPLY_GET_CHUNK_BASE_HPP
42 #define OBJECTS_ID2_ID2S_REPLY_GET_CHUNK_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
60 class CID2_Blob_Id;
61 class CID2_Reply_Data;
62 
63 
64 // generated classes
65 
66 
67 /** @addtogroup dataspec_NCBI_ID2Access
68  *
69  * @{
70  */
71 
72 /////////////////////////////////////////////////////////////////////////////
73 /// Reply to ID2S-Request-Get-Chunks.
74 ///
75 /// CID2S_Reply_Get_Chunk_Base --
76 ///
77 
79 {
81 public:
82  // constructor
84  // destructor
85  virtual ~CID2S_Reply_Get_Chunk_Base(void);
86 
87  // type info
89 
90  // types
94 
95  // member index
96  enum class E_memberIndex {
97  e__allMandatory = 0,
98  e_blob_id,
99  e_chunk_id,
100  e_data
101  };
103 
104  // getters
105  // setters
106 
107  /// Check if a value has been assigned to Blob_id data member.
108  ///
109  /// Data member Blob_id is mandatory;
110  /// its type is defined as 'typedef CID2_Blob_Id TBlob_id'
111  /// @return
112  /// - true, if a value has been assigned.
113  /// - false, otherwise.
114  bool IsSetBlob_id(void) const;
115 
116  /// Check if it is safe to call GetBlob_id method.
117  ///
118  /// @return
119  /// - true, if the data member is getatable.
120  /// - false, otherwise.
121  bool CanGetBlob_id(void) const;
122 
123  /// Reset Blob_id data member.
124  void ResetBlob_id(void);
125 
126  /// Get the Blob_id member data.
127  ///
128  /// @return
129  /// Reference to the member data.
130  const TBlob_id& GetBlob_id(void) const;
131 
132  /// Assign a value to Blob_id data member.
133  ///
134  /// @param value
135  /// Reference to value.
136  void SetBlob_id(TBlob_id& value);
137 
138  /// Assign a value to Blob_id data member.
139  ///
140  /// @return
141  /// Reference to the data value.
142  TBlob_id& SetBlob_id(void);
143 
144  /// id of chunk to send
145  /// Check if a value has been assigned to Chunk_id data member.
146  ///
147  /// Data member Chunk_id is mandatory;
148  /// its type is defined as 'typedef CID2S_Chunk_Id TChunk_id'
149  /// @return
150  /// - true, if a value has been assigned.
151  /// - false, otherwise.
152  bool IsSetChunk_id(void) const;
153 
154  /// Check if it is safe to call GetChunk_id method.
155  ///
156  /// @return
157  /// - true, if the data member is getatable.
158  /// - false, otherwise.
159  bool CanGetChunk_id(void) const;
160 
161  /// Reset Chunk_id data member.
162  void ResetChunk_id(void);
163 
164  /// Get the Chunk_id member data.
165  ///
166  /// @return
167  /// Reference to the member data.
168  const TChunk_id& GetChunk_id(void) const;
169 
170  /// Assign a value to Chunk_id data member.
171  ///
172  /// @param value
173  /// Value to assign
174  void SetChunk_id(const TChunk_id& value);
175 
176  /// Assign a value to Chunk_id data member.
177  ///
178  /// @return
179  /// Reference to the data value.
180  TChunk_id& SetChunk_id(void);
181 
182  /// chunk data
183  /// not set if error occurred
184  /// Check if a value has been assigned to Data data member.
185  ///
186  /// Data member Data is optional;
187  /// its type is defined as 'typedef CID2_Reply_Data TData'
188  /// @return
189  /// - true, if a value has been assigned.
190  /// - false, otherwise.
191  bool IsSetData(void) const;
192 
193  /// Check if it is safe to call GetData method.
194  ///
195  /// @return
196  /// - true, if the data member is getatable.
197  /// - false, otherwise.
198  bool CanGetData(void) const;
199 
200  /// Reset Data data member.
201  void ResetData(void);
202 
203  /// Get the Data member data.
204  ///
205  /// @return
206  /// Reference to the member data.
207  const TData& GetData(void) const;
208 
209  /// Assign a value to Data data member.
210  ///
211  /// @param value
212  /// Reference to value.
213  void SetData(TData& value);
214 
215  /// Assign a value to Data data member.
216  ///
217  /// @return
218  /// Reference to the data value.
219  TData& SetData(void);
220 
221  /// Reset the whole object
222  virtual void Reset(void);
223 
224 
225 private:
226  // Prohibit copy constructor and assignment operator
229 
230  // data
231  Uint4 m_set_State[1];
235 };
236 
237 /* @} */
238 
239 
240 
241 
242 
243 ///////////////////////////////////////////////////////////
244 ///////////////////// inline methods //////////////////////
245 ///////////////////////////////////////////////////////////
246 inline
248 {
249  return m_Blob_id.NotEmpty();
250 }
251 
252 inline
254 {
255  return true;
256 }
257 
258 inline
260 {
261  if ( !m_Blob_id ) {
262  const_cast<CID2S_Reply_Get_Chunk_Base*>(this)->ResetBlob_id();
263  }
264  return (*m_Blob_id);
265 }
266 
267 inline
269 {
270  if ( !m_Blob_id ) {
271  ResetBlob_id();
272  }
273  return (*m_Blob_id);
274 }
275 
276 inline
278 {
279  return ((m_set_State[0] & 0xc) != 0);
280 }
281 
282 inline
284 {
285  return IsSetChunk_id();
286 }
287 
288 inline
290 {
292  m_set_State[0] &= ~0xc;
293 }
294 
295 inline
297 {
298  if (!CanGetChunk_id()) {
299  ThrowUnassigned(1);
300  }
301  return m_Chunk_id;
302 }
303 
304 inline
306 {
307  m_Chunk_id = value;
308  m_set_State[0] |= 0xc;
309 }
310 
311 inline
313 {
314  m_set_State[0] |= 0x4;
315  return m_Chunk_id;
316 }
317 
318 inline
320 {
321  return m_Data.NotEmpty();
322 }
323 
324 inline
326 {
327  return IsSetData();
328 }
329 
330 inline
332 {
333  if (!CanGetData()) {
334  ThrowUnassigned(2);
335  }
336  return (*m_Data);
337 }
338 
339 ///////////////////////////////////////////////////////////
340 ////////////////// end of inline methods //////////////////
341 ///////////////////////////////////////////////////////////
342 
343 
344 
345 
346 
347 END_objects_SCOPE // namespace ncbi::objects::
348 
350 
351 
352 #endif // OBJECTS_ID2_ID2S_REPLY_GET_CHUNK_BASE_HPP
User-defined methods of the data storage class.
CID2S_Chunk_Id –.
Reply to ID2S-Request-Get-Chunks.
CID2_Blob_Id –.
Definition: ID2_Blob_Id.hpp:66
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
void ThrowUnassigned(TMemberIndex index) const
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty – pointing to an object and has a non-null value.
Definition: ncbiobj.hpp:726
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_ID2_EXPORT
Definition: ncbi_export.h:552
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
bool CanGetChunk_id(void) const
Check if it is safe to call GetChunk_id method.
bool IsSetBlob_id(void) const
Check if a value has been assigned to Blob_id data member.
CID2S_Reply_Get_Chunk_Base & operator=(const CID2S_Reply_Get_Chunk_Base &)
void ResetChunk_id(void)
Reset Chunk_id data member.
bool CanGetBlob_id(void) const
Check if it is safe to call GetBlob_id method.
const TBlob_id & GetBlob_id(void) const
Get the Blob_id member data.
TChunk_id & SetChunk_id(void)
Assign a value to Chunk_id data member.
bool IsSetData(void) const
chunk data not set if error occurred Check if a value has been assigned to Data data member.
const TChunk_id & GetChunk_id(void) const
Get the Chunk_id member data.
CID2S_Reply_Get_Chunk_Base(const CID2S_Reply_Get_Chunk_Base &)
TBlob_id & SetBlob_id(void)
Assign a value to Blob_id data member.
const TData & GetData(void) const
Get the Data member data.
void ResetBlob_id(void)
Reset Blob_id data member.
bool CanGetData(void) const
Check if it is safe to call GetData method.
bool IsSetChunk_id(void) const
id of chunk to send Check if a value has been assigned to Chunk_id data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed Sep 04 15:01:56 2024 by modify_doxy.py rev. 669887