NCBI C++ ToolKit
ID2_Reply_Get_Blob_.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 ID2_Reply_Get_Blob_.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_ID2_REPLY_GET_BLOB_BASE_HPP
42 #define OBJECTS_ID2_ID2_REPLY_GET_BLOB_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
56 class CID2_Blob_Id;
57 class CID2_Reply_Data;
58 
59 
60 // generated classes
61 
62 
63 /** @addtogroup dataspec_NCBI_ID2Access
64  *
65  * @{
66  */
67 
68 /////////////////////////////////////////////////////////////////////////////
69 /// Reply to ID2-Request-Get-Blob-Info.
70 ///
71 /// CID2_Reply_Get_Blob_Base --
72 ///
73 
75 {
77 public:
78  // constructor
80  // destructor
81  virtual ~CID2_Reply_Get_Blob_Base(void);
82 
83  // type info
85 
86  // types
88  typedef int TSplit_version;
90  typedef int TBlob_state;
91 
92  // member index
93  enum class E_memberIndex {
94  e__allMandatory = 0,
95  e_blob_id,
96  e_split_version,
97  e_data,
98  e_blob_state
99  };
101 
102  // getters
103  // setters
104 
105  /// Check if a value has been assigned to Blob_id data member.
106  ///
107  /// Data member Blob_id is mandatory;
108  /// its type is defined as 'typedef CID2_Blob_Id TBlob_id'
109  /// @return
110  /// - true, if a value has been assigned.
111  /// - false, otherwise.
112  bool IsSetBlob_id(void) const;
113 
114  /// Check if it is safe to call GetBlob_id method.
115  ///
116  /// @return
117  /// - true, if the data member is getatable.
118  /// - false, otherwise.
119  bool CanGetBlob_id(void) const;
120 
121  /// Reset Blob_id data member.
122  void ResetBlob_id(void);
123 
124  /// Get the Blob_id member data.
125  ///
126  /// @return
127  /// Reference to the member data.
128  const TBlob_id& GetBlob_id(void) const;
129 
130  /// Assign a value to Blob_id data member.
131  ///
132  /// @param value
133  /// Reference to value.
134  void SetBlob_id(TBlob_id& value);
135 
136  /// Assign a value to Blob_id data member.
137  ///
138  /// @return
139  /// Reference to the data value.
140  TBlob_id& SetBlob_id(void);
141 
142  /// version of split data
143  /// (0 for non split)
144  /// Check if a value has been assigned to Split_version data member.
145  ///
146  /// Data member Split_version is optional with default 0;
147  /// its type is defined as 'typedef int TSplit_version'
148  /// @return
149  /// - true, if a value has been assigned.
150  /// - false, otherwise.
151  bool IsSetSplit_version(void) const;
152 
153  /// Check if it is safe to call GetSplit_version method.
154  ///
155  /// @return
156  /// - true, if the data member is getatable.
157  /// - false, otherwise.
158  bool CanGetSplit_version(void) const;
159 
160  /// Reset Split_version data member.
161  void ResetSplit_version(void);
162 
163  /// Assign default value to Split_version data member.
164  void SetDefaultSplit_version(void);
165 
166  /// Get the Split_version member data.
167  ///
168  /// @return
169  /// Copy of the member data.
170  TSplit_version GetSplit_version(void) const;
171 
172  /// Assign a value to Split_version data member.
173  ///
174  /// @param value
175  /// Value to assign
176  void SetSplit_version(TSplit_version value);
177 
178  /// Assign a value to Split_version data member.
179  ///
180  /// @return
181  /// Reference to the data value.
182  TSplit_version& SetSplit_version(void);
183 
184  /// whole blob or blob skeleton
185  /// not set if error occurred
186  /// Check if a value has been assigned to Data data member.
187  ///
188  /// Data member Data is optional;
189  /// its type is defined as 'typedef CID2_Reply_Data TData'
190  /// @return
191  /// - true, if a value has been assigned.
192  /// - false, otherwise.
193  bool IsSetData(void) const;
194 
195  /// Check if it is safe to call GetData method.
196  ///
197  /// @return
198  /// - true, if the data member is getatable.
199  /// - false, otherwise.
200  bool CanGetData(void) const;
201 
202  /// Reset Data data member.
203  void ResetData(void);
204 
205  /// Get the Data member data.
206  ///
207  /// @return
208  /// Reference to the member data.
209  const TData& GetData(void) const;
210 
211  /// Assign a value to Data data member.
212  ///
213  /// @param value
214  /// Reference to value.
215  void SetData(TData& value);
216 
217  /// Assign a value to Data data member.
218  ///
219  /// @return
220  /// Reference to the data value.
221  TData& SetData(void);
222 
223  /// state bits of the blob, 0 or missing means regular live data
224  /// Check if a value has been assigned to Blob_state data member.
225  ///
226  /// Data member Blob_state is optional;
227  /// its type is defined as 'typedef int TBlob_state'
228  /// @return
229  /// - true, if a value has been assigned.
230  /// - false, otherwise.
231  bool IsSetBlob_state(void) const;
232 
233  /// Check if it is safe to call GetBlob_state method.
234  ///
235  /// @return
236  /// - true, if the data member is getatable.
237  /// - false, otherwise.
238  bool CanGetBlob_state(void) const;
239 
240  /// Reset Blob_state data member.
241  void ResetBlob_state(void);
242 
243  /// Get the Blob_state member data.
244  ///
245  /// @return
246  /// Copy of the member data.
247  TBlob_state GetBlob_state(void) const;
248 
249  /// Assign a value to Blob_state data member.
250  ///
251  /// @param value
252  /// Value to assign
253  void SetBlob_state(TBlob_state value);
254 
255  /// Assign a value to Blob_state data member.
256  ///
257  /// @return
258  /// Reference to the data value.
259  TBlob_state& SetBlob_state(void);
260 
261  /// Reset the whole object
262  virtual void Reset(void);
263 
264 
265 private:
266  // Prohibit copy constructor and assignment operator
269 
270  // data
271  Uint4 m_set_State[1];
276 };
277 
278 /* @} */
279 
280 
281 
282 
283 
284 ///////////////////////////////////////////////////////////
285 ///////////////////// inline methods //////////////////////
286 ///////////////////////////////////////////////////////////
287 inline
289 {
290  return m_Blob_id.NotEmpty();
291 }
292 
293 inline
295 {
296  return true;
297 }
298 
299 inline
301 {
302  if ( !m_Blob_id ) {
303  const_cast<CID2_Reply_Get_Blob_Base*>(this)->ResetBlob_id();
304  }
305  return (*m_Blob_id);
306 }
307 
308 inline
310 {
311  if ( !m_Blob_id ) {
312  ResetBlob_id();
313  }
314  return (*m_Blob_id);
315 }
316 
317 inline
319 {
320  return ((m_set_State[0] & 0xc) != 0);
321 }
322 
323 inline
325 {
326  return true;
327 }
328 
329 inline
331 {
332  m_Split_version = 0;
333  m_set_State[0] &= ~0xc;
334 }
335 
336 inline
338 {
340 }
341 
342 inline
344 {
345  return m_Split_version;
346 }
347 
348 inline
350 {
352  m_set_State[0] |= 0xc;
353 }
354 
355 inline
357 {
358 #ifdef _DEBUG
359  if (!IsSetSplit_version()) {
361  }
362 #endif
363  m_set_State[0] |= 0x4;
364  return m_Split_version;
365 }
366 
367 inline
369 {
370  return m_Data.NotEmpty();
371 }
372 
373 inline
375 {
376  return IsSetData();
377 }
378 
379 inline
381 {
382  if (!CanGetData()) {
383  ThrowUnassigned(2);
384  }
385  return (*m_Data);
386 }
387 
388 inline
390 {
391  return ((m_set_State[0] & 0xc0) != 0);
392 }
393 
394 inline
396 {
397  return IsSetBlob_state();
398 }
399 
400 inline
402 {
403  m_Blob_state = 0;
404  m_set_State[0] &= ~0xc0;
405 }
406 
407 inline
409 {
410  if (!CanGetBlob_state()) {
411  ThrowUnassigned(3);
412  }
413  return m_Blob_state;
414 }
415 
416 inline
418 {
420  m_set_State[0] |= 0xc0;
421 }
422 
423 inline
425 {
426 #ifdef _DEBUG
427  if (!IsSetBlob_state()) {
428  memset(&m_Blob_state,UnassignedByte(),sizeof(m_Blob_state));
429  }
430 #endif
431  m_set_State[0] |= 0x40;
432  return m_Blob_state;
433 }
434 
435 ///////////////////////////////////////////////////////////
436 ////////////////// end of inline methods //////////////////
437 ///////////////////////////////////////////////////////////
438 
439 
440 
441 
442 
443 END_objects_SCOPE // namespace ncbi::objects::
444 
446 
447 
448 #endif // OBJECTS_ID2_ID2_REPLY_GET_BLOB_BASE_HPP
CID2_Blob_Id –.
Definition: ID2_Blob_Id.hpp:66
Reply to ID2-Request-Get-Blob-Info.
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
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
TBlob_state & SetBlob_state(void)
Assign a value to Blob_state data member.
bool CanGetBlob_id(void) const
Check if it is safe to call GetBlob_id method.
bool CanGetData(void) const
Check if it is safe to call GetData method.
bool IsSetSplit_version(void) const
version of split data (0 for non split) Check if a value has been assigned to Split_version data memb...
const TBlob_id & GetBlob_id(void) const
Get the Blob_id member data.
bool IsSetBlob_state(void) const
state bits of the blob, 0 or missing means regular live data Check if a value has been assigned to Bl...
CID2_Reply_Get_Blob_Base & operator=(const CID2_Reply_Get_Blob_Base &)
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
TSplit_version & SetSplit_version(void)
Assign a value to Split_version data member.
TBlob_state GetBlob_state(void) const
Get the Blob_state member data.
void ResetSplit_version(void)
Reset Split_version data member.
void ResetBlob_id(void)
Reset Blob_id data member.
TSplit_version GetSplit_version(void) const
Get the Split_version member data.
bool CanGetSplit_version(void) const
Check if it is safe to call GetSplit_version method.
void ResetBlob_state(void)
Reset Blob_state data member.
CID2_Reply_Get_Blob_Base(const CID2_Reply_Get_Blob_Base &)
bool IsSetBlob_id(void) const
Check if a value has been assigned to Blob_id data member.
TBlob_id & SetBlob_id(void)
Assign a value to Blob_id data member.
const TData & GetData(void) const
Get the Data member data.
void SetDefaultSplit_version(void)
Assign default value to Split_version data member.
bool CanGetBlob_state(void) const
Check if it is safe to call GetBlob_state method.
bool IsSetData(void) const
whole blob or blob skeleton not set if error occurred Check if a value has been assigned to Data data...
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:58:24 2024 by modify_doxy.py rev. 669887