NCBI C++ ToolKit
PluginMRUEntry_.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 PluginMRUEntry_.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_PLUGINMRUENTRY_BASE_HPP
42 #define GUI_OBJECTS_PLUGINMRUENTRY_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 <string>
52 
54 
55 #ifndef BEGIN_objects_SCOPE
56 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
57 # define END_objects_SCOPE END_SCOPE(objects)
58 #endif
59 BEGIN_objects_SCOPE // namespace ncbi::objects::
60 
61 
62 // forward declarations
63 class CPluginMessage;
64 
65 
66 // generated classes
67 
68 
69 /** @addtogroup dataspec_NCBI_Plugin
70  *
71  * @{
72  */
73 
74 /////////////////////////////////////////////////////////////////////////////
75 ///-
76 ///- MRU structures
77 ///-
78 ///
79 /// CPluginMRUEntry_Base --
80 ///
81 
83 {
85 public:
86  // constructor
88  // destructor
89  virtual ~CPluginMRUEntry_Base(void);
90 
91  // type info
93 
94  // types
95  typedef string TLabel;
97 
98  // member index
99  enum class E_memberIndex {
100  e__allMandatory = 0,
101  e_label,
102  e_message
103  };
105 
106  // getters
107  // setters
108 
109  /// Check if a value has been assigned to Label data member.
110  ///
111  /// Data member Label is mandatory;
112  /// its type is defined as 'typedef string TLabel'
113  /// @return
114  /// - true, if a value has been assigned.
115  /// - false, otherwise.
116  bool IsSetLabel(void) const;
117 
118  /// Check if it is safe to call GetLabel method.
119  ///
120  /// @return
121  /// - true, if the data member is getatable.
122  /// - false, otherwise.
123  bool CanGetLabel(void) const;
124 
125  /// Reset Label data member.
126  void ResetLabel(void);
127 
128  /// Get the Label member data.
129  ///
130  /// @return
131  /// Reference to the member data.
132  const TLabel& GetLabel(void) const;
133 
134  /// Assign a value to Label data member.
135  ///
136  /// @param value
137  /// Value to assign
138  void SetLabel(const TLabel& value);
139  void SetLabel(TLabel&& value);
140 
141  /// Assign a value to Label data member.
142  ///
143  /// @return
144  /// Reference to the data value.
145  TLabel& SetLabel(void);
146 
147  /// Check if a value has been assigned to Message data member.
148  ///
149  /// Data member Message is mandatory;
150  /// its type is defined as 'typedef CPluginMessage TMessage'
151  /// @return
152  /// - true, if a value has been assigned.
153  /// - false, otherwise.
154  bool IsSetMessage(void) const;
155 
156  /// Check if it is safe to call GetMessage method.
157  ///
158  /// @return
159  /// - true, if the data member is getatable.
160  /// - false, otherwise.
161  bool CanGetMessage(void) const;
162 
163  /// Reset Message data member.
164  void ResetMessage(void);
165 
166  /// Get the Message member data.
167  ///
168  /// @return
169  /// Reference to the member data.
170  const TMessage& GetMessage(void) const;
171 
172  /// Assign a value to Message data member.
173  ///
174  /// @param value
175  /// Reference to value.
176  void SetMessage(TMessage& value);
177 
178  /// Assign a value to Message data member.
179  ///
180  /// @return
181  /// Reference to the data value.
182  TMessage& SetMessage(void);
183 
184  /// Reset the whole object
185  virtual void Reset(void);
186 
187 
188 private:
189  // Prohibit copy constructor and assignment operator
192 
193  // data
194  Uint4 m_set_State[1];
195  string m_Label;
197 };
198 
199 /* @} */
200 
201 
202 
203 
204 
205 ///////////////////////////////////////////////////////////
206 ///////////////////// inline methods //////////////////////
207 ///////////////////////////////////////////////////////////
208 inline
210 {
211  return ((m_set_State[0] & 0x3) != 0);
212 }
213 
214 inline
216 {
217  return IsSetLabel();
218 }
219 
220 inline
222 {
223  if (!CanGetLabel()) {
224  ThrowUnassigned(0);
225  }
226  return m_Label;
227 }
228 
229 inline
231 {
232  m_Label = value;
233  m_set_State[0] |= 0x3;
234 }
235 
236 inline
238 {
239  m_Label = std::forward<CPluginMRUEntry_Base::TLabel>(value);
240  m_set_State[0] |= 0x3;
241 }
242 
243 inline
245 {
246 #ifdef _DEBUG
247  if (!IsSetLabel()) {
249  }
250 #endif
251  m_set_State[0] |= 0x1;
252  return m_Label;
253 }
254 
255 inline
257 {
258  return m_Message.NotEmpty();
259 }
260 
261 inline
263 {
264  return true;
265 }
266 
267 inline
269 {
270  if ( !m_Message ) {
271  const_cast<CPluginMRUEntry_Base*>(this)->ResetMessage();
272  }
273  return (*m_Message);
274 }
275 
276 inline
278 {
279  if ( !m_Message ) {
280  ResetMessage();
281  }
282  return (*m_Message);
283 }
284 
285 ///////////////////////////////////////////////////////////
286 ////////////////// end of inline methods //////////////////
287 ///////////////////////////////////////////////////////////
288 
289 
290 
291 
292 
293 END_objects_SCOPE // namespace ncbi::objects::
294 
296 
297 
298 #endif // GUI_OBJECTS_PLUGINMRUENTRY_BASE_HPP
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
void ThrowUnassigned(TMemberIndex index) const
static string UnassignedString(void)
Definition: serialbase.hpp:175
string GetLabel(const CSeq_id &id)
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
bool CanGetLabel(void) const
Check if it is safe to call GetLabel method.
TLabel & SetLabel(void)
Assign a value to Label data member.
bool CanGetMessage(void) const
Check if it is safe to call GetMessage method.
void ResetMessage(void)
Reset Message data member.
CPluginMessage TMessage
const TMessage & GetMessage(void) const
Get the Message member data.
TMessage & SetMessage(void)
Assign a value to Message data member.
const TLabel & GetLabel(void) const
Get the Label member data.
bool IsSetLabel(void) const
Check if a value has been assigned to Label data member.
CPluginMRUEntry_Base(const CPluginMRUEntry_Base &)
CPluginMRUEntry_Base & operator=(const CPluginMRUEntry_Base &)
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
bool IsSetMessage(void) const
Check if a value has been assigned to Message data member.
CRef< TMessage > m_Message
Defines to provide correct exporting from DLLs in Windows.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Mon Apr 22 04:05:59 2024 by modify_doxy.py rev. 669887