NCBI C++ ToolKit
PluginReply_.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 PluginReply_.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/gui/objects/gui_objects.asn">gui_objects.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/gui/objects/gui_objects.def">gui_objects.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 GUI_OBJECTS_PLUGINREPLY_BASE_HPP
42 #define GUI_OBJECTS_PLUGINREPLY_BASE_HPP
43 
44 // extra headers
45 #include <gui/gui_export.h>
46 
47 // standard includes
48 #include <serial/serialbase.hpp>
49 
50 // generated includes
51 #include <list>
53 
55 
56 #ifndef BEGIN_objects_SCOPE
57 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
58 # define END_objects_SCOPE END_SCOPE(objects)
59 #endif
60 BEGIN_objects_SCOPE // namespace ncbi::objects::
61 
62 
63 // forward declarations
64 class CPluginArgSet;
65 class CPluginReplyAction;
66 class CPluginValue;
67 
68 
69 // generated classes
70 
71 
72 /** @addtogroup dataspec_NCBI_Plugin
73  *
74  * @{
75  */
76 
77 /////////////////////////////////////////////////////////////////////////////
78 ///-
79 ///- PluginReply defines the responses received from a plugin after completion
80 ///- of its activities.
81 ///-
82 ///
83 /// CPluginReply_Base --
84 ///
85 
87 {
89 public:
90  // constructor
91  CPluginReply_Base(void);
92  // destructor
93  virtual ~CPluginReply_Base(void);
94 
95  // type info
97 
98  // types
100  typedef list< CRef< CPluginReplyAction > > TAction;
101  typedef list< CRef< CPluginValue > > TRaw;
103 
104  // member index
105  enum class E_memberIndex {
106  e__allMandatory = 0,
107  e_status,
108  e_action,
109  e_raw,
110  e_formatted
111  };
113 
114  // getters
115  // setters
116 
117  /// Check if a value has been assigned to Status data member.
118  ///
119  /// Data member Status is optional with default eMessageStatus_failed;
120  /// its type is defined as 'typedef EMessageStatus TStatus'
121  /// @return
122  /// - true, if a value has been assigned.
123  /// - false, otherwise.
124  bool IsSetStatus(void) const;
125 
126  /// Check if it is safe to call GetStatus method.
127  ///
128  /// @return
129  /// - true, if the data member is getatable.
130  /// - false, otherwise.
131  bool CanGetStatus(void) const;
132 
133  /// Reset Status data member.
134  void ResetStatus(void);
135 
136  /// Assign default value to Status data member.
137  void SetDefaultStatus(void);
138 
139  /// Get the Status member data.
140  ///
141  /// @return
142  /// Copy of the member data.
143  TStatus GetStatus(void) const;
144 
145  /// Assign a value to Status data member.
146  ///
147  /// @param value
148  /// Value to assign
149  void SetStatus(TStatus value);
150 
151  /// Assign a value to Status data member.
152  ///
153  /// @return
154  /// Reference to the data value.
155  TStatus& SetStatus(void);
156 
157  /// Check if a value has been assigned to Action data member.
158  ///
159  /// Data member Action is optional;
160  /// its type is defined as 'typedef list< CRef< CPluginReplyAction > > TAction'
161  /// @return
162  /// - true, if a value has been assigned.
163  /// - false, otherwise.
164  bool IsSetAction(void) const;
165 
166  /// Check if it is safe to call GetAction method.
167  ///
168  /// @return
169  /// - true, if the data member is getatable.
170  /// - false, otherwise.
171  bool CanGetAction(void) const;
172 
173  /// Reset Action data member.
174  void ResetAction(void);
175 
176  /// Get the Action member data.
177  ///
178  /// @return
179  /// Reference to the member data.
180  const TAction& GetAction(void) const;
181 
182  /// Assign a value to Action data member.
183  ///
184  /// @return
185  /// Reference to the data value.
186  TAction& SetAction(void);
187 
188  /// things we've produced
189  /// Check if a value has been assigned to Raw data member.
190  ///
191  /// Data member Raw is optional;
192  /// its type is defined as 'typedef list< CRef< CPluginValue > > TRaw'
193  /// @return
194  /// - true, if a value has been assigned.
195  /// - false, otherwise.
196  bool IsSetRaw(void) const;
197 
198  /// Check if it is safe to call GetRaw method.
199  ///
200  /// @return
201  /// - true, if the data member is getatable.
202  /// - false, otherwise.
203  bool CanGetRaw(void) const;
204 
205  /// Reset Raw data member.
206  void ResetRaw(void);
207 
208  /// Get the Raw member data.
209  ///
210  /// @return
211  /// Reference to the member data.
212  const TRaw& GetRaw(void) const;
213 
214  /// Assign a value to Raw data member.
215  ///
216  /// @return
217  /// Reference to the data value.
218  TRaw& SetRaw(void);
219 
220  /// caller-defined args
221  /// Check if a value has been assigned to Formatted data member.
222  ///
223  /// Data member Formatted is optional;
224  /// its type is defined as 'typedef CPluginArgSet TFormatted'
225  /// @return
226  /// - true, if a value has been assigned.
227  /// - false, otherwise.
228  bool IsSetFormatted(void) const;
229 
230  /// Check if it is safe to call GetFormatted method.
231  ///
232  /// @return
233  /// - true, if the data member is getatable.
234  /// - false, otherwise.
235  bool CanGetFormatted(void) const;
236 
237  /// Reset Formatted data member.
238  void ResetFormatted(void);
239 
240  /// Get the Formatted member data.
241  ///
242  /// @return
243  /// Reference to the member data.
244  const TFormatted& GetFormatted(void) const;
245 
246  /// Assign a value to Formatted data member.
247  ///
248  /// @param value
249  /// Reference to value.
250  void SetFormatted(TFormatted& value);
251 
252  /// Assign a value to Formatted data member.
253  ///
254  /// @return
255  /// Reference to the data value.
256  TFormatted& SetFormatted(void);
257 
258  /// Reset the whole object
259  virtual void Reset(void);
260 
261 
262 private:
263  // Prohibit copy constructor and assignment operator
266 
267  // data
268  Uint4 m_set_State[1];
270  list< CRef< CPluginReplyAction > > m_Action;
271  list< CRef< CPluginValue > > m_Raw;
273 };
274 
275 /* @} */
276 
277 
278 
279 
280 
281 ///////////////////////////////////////////////////////////
282 ///////////////////// inline methods //////////////////////
283 ///////////////////////////////////////////////////////////
284 inline
286 {
287  return ((m_set_State[0] & 0x3) != 0);
288 }
289 
290 inline
292 {
293  return true;
294 }
295 
296 inline
298 {
300  m_set_State[0] &= ~0x3;
301 }
302 
303 inline
305 {
306  ResetStatus();
307 }
308 
309 inline
311 {
312  return m_Status;
313 }
314 
315 inline
317 {
318  m_Status = value;
319  m_set_State[0] |= 0x3;
320 }
321 
322 inline
324 {
325 #ifdef _DEBUG
326  if (!IsSetStatus()) {
327  memset(&m_Status,UnassignedByte(),sizeof(m_Status));
328  }
329 #endif
330  m_set_State[0] |= 0x1;
331  return m_Status;
332 }
333 
334 inline
336 {
337  return ((m_set_State[0] & 0xc) != 0);
338 }
339 
340 inline
342 {
343  return true;
344 }
345 
346 inline
348 {
349  return m_Action;
350 }
351 
352 inline
354 {
355  m_set_State[0] |= 0x4;
356  return m_Action;
357 }
358 
359 inline
361 {
362  return ((m_set_State[0] & 0x30) != 0);
363 }
364 
365 inline
367 {
368  return true;
369 }
370 
371 inline
373 {
374  return m_Raw;
375 }
376 
377 inline
379 {
380  m_set_State[0] |= 0x10;
381  return m_Raw;
382 }
383 
384 inline
386 {
387  return m_Formatted.NotEmpty();
388 }
389 
390 inline
392 {
393  return IsSetFormatted();
394 }
395 
396 inline
398 {
399  if (!CanGetFormatted()) {
400  ThrowUnassigned(3);
401  }
402  return (*m_Formatted);
403 }
404 
405 ///////////////////////////////////////////////////////////
406 ////////////////// end of inline methods //////////////////
407 ///////////////////////////////////////////////////////////
408 
409 
410 
411 
412 
413 END_objects_SCOPE // namespace ncbi::objects::
414 
416 
417 
418 #endif // GUI_OBJECTS_PLUGINREPLY_BASE_HPP
User-defined methods of the data storage class.
namespace ncbi::objects::
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
#define NCBI_GUIOBJECTS_EXPORT
Definition: gui_export.h:511
list< CRef< CPluginReplyAction > > m_Action
const TRaw & GetRaw(void) const
Get the Raw member data.
EMessageStatus TStatus
EMessageStatus
bool CanGetFormatted(void) const
Check if it is safe to call GetFormatted method.
TAction & SetAction(void)
Assign a value to Action data member.
bool IsSetAction(void) const
Check if a value has been assigned to Action data member.
EMessageStatus m_Status
bool IsSetStatus(void) const
Check if a value has been assigned to Status data member.
CPluginReply_Base(const CPluginReply_Base &)
bool CanGetStatus(void) const
Check if it is safe to call GetStatus method.
CSerialObject Tparent
TRaw & SetRaw(void)
Assign a value to Raw data member.
list< CRef< CPluginValue > > m_Raw
const TFormatted & GetFormatted(void) const
Get the Formatted member data.
void ResetStatus(void)
Reset Status data member.
TStatus & SetStatus(void)
Assign a value to Status data member.
list< CRef< CPluginReplyAction > > TAction
bool CanGetAction(void) const
Check if it is safe to call GetAction method.
CRef< TFormatted > m_Formatted
bool IsSetFormatted(void) const
caller-defined args Check if a value has been assigned to Formatted data member.
bool CanGetRaw(void) const
Check if it is safe to call GetRaw method.
CPluginReply_Base & operator=(const CPluginReply_Base &)
list< CRef< CPluginValue > > TRaw
const TAction & GetAction(void) const
Get the Action member data.
void SetDefaultStatus(void)
Assign default value to Status data member.
bool IsSetRaw(void) const
things we've produced Check if a value has been assigned to Raw data member.
TStatus GetStatus(void) const
Get the Status member data.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
CPluginArgSet TFormatted
@ eMessageStatus_failed
Defines to provide correct exporting from DLLs in Windows.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Tue Apr 23 07:40:42 2024 by modify_doxy.py rev. 669887