NCBI C++ ToolKit
PluginLibInfo_.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 PluginLibInfo_.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_PLUGINLIBINFO_BASE_HPP
42 #define GUI_OBJECTS_PLUGINLIBINFO_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 CPluginInfoSet;
64 
65 
66 // generated classes
67 
68 
69 /** @addtogroup dataspec_NCBI_Plugin
70  *
71  * @{
72  */
73 
74 /////////////////////////////////////////////////////////////////////////////
75 ///-
76 ///- kludge around missing CTypeRef code (doesn't support
77 ///- SET OF SEQUENCE {...} if the sequence includes a derived class)
78 ///-
79 ///
80 /// CPluginLibInfo_Base --
81 ///
82 
84 {
86 public:
87  // constructor
88  CPluginLibInfo_Base(void);
89  // destructor
90  virtual ~CPluginLibInfo_Base(void);
91 
92  // type info
94 
95  // types
96  typedef string TLibrary;
97  typedef bool TEnabled;
99 
100  // member index
101  enum class E_memberIndex {
102  e__allMandatory = 0,
103  e_library,
104  e_enabled,
105  e_info
106  };
108 
109  // getters
110  // setters
111 
112  /// Check if a value has been assigned to Library data member.
113  ///
114  /// Data member Library is mandatory;
115  /// its type is defined as 'typedef string TLibrary'
116  /// @return
117  /// - true, if a value has been assigned.
118  /// - false, otherwise.
119  bool IsSetLibrary(void) const;
120 
121  /// Check if it is safe to call GetLibrary method.
122  ///
123  /// @return
124  /// - true, if the data member is getatable.
125  /// - false, otherwise.
126  bool CanGetLibrary(void) const;
127 
128  /// Reset Library data member.
129  void ResetLibrary(void);
130 
131  /// Get the Library member data.
132  ///
133  /// @return
134  /// Reference to the member data.
135  const TLibrary& GetLibrary(void) const;
136 
137  /// Assign a value to Library data member.
138  ///
139  /// @param value
140  /// Value to assign
141  void SetLibrary(const TLibrary& value);
142  void SetLibrary(TLibrary&& value);
143 
144  /// Assign a value to Library data member.
145  ///
146  /// @return
147  /// Reference to the data value.
148  TLibrary& SetLibrary(void);
149 
150  /// flag: is this plugin enabled?
151  /// Check if a value has been assigned to Enabled data member.
152  ///
153  /// Data member Enabled is optional with default true;
154  /// its type is defined as 'typedef bool TEnabled'
155  /// @return
156  /// - true, if a value has been assigned.
157  /// - false, otherwise.
158  bool IsSetEnabled(void) const;
159 
160  /// Check if it is safe to call GetEnabled method.
161  ///
162  /// @return
163  /// - true, if the data member is getatable.
164  /// - false, otherwise.
165  bool CanGetEnabled(void) const;
166 
167  /// Reset Enabled data member.
168  void ResetEnabled(void);
169 
170  /// Assign default value to Enabled data member.
171  void SetDefaultEnabled(void);
172 
173  /// Get the Enabled member data.
174  ///
175  /// @return
176  /// Copy of the member data.
177  TEnabled GetEnabled(void) const;
178 
179  /// Assign a value to Enabled data member.
180  ///
181  /// @param value
182  /// Value to assign
183  void SetEnabled(TEnabled value);
184 
185  /// Assign a value to Enabled data member.
186  ///
187  /// @return
188  /// Reference to the data value.
189  TEnabled& SetEnabled(void);
190 
191  /// Check if a value has been assigned to Info data member.
192  ///
193  /// Data member Info is mandatory;
194  /// its type is defined as 'typedef CPluginInfoSet TInfo'
195  /// @return
196  /// - true, if a value has been assigned.
197  /// - false, otherwise.
198  bool IsSetInfo(void) const;
199 
200  /// Check if it is safe to call GetInfo method.
201  ///
202  /// @return
203  /// - true, if the data member is getatable.
204  /// - false, otherwise.
205  bool CanGetInfo(void) const;
206 
207  /// Reset Info data member.
208  void ResetInfo(void);
209 
210  /// Get the Info member data.
211  ///
212  /// @return
213  /// Reference to the member data.
214  const TInfo& GetInfo(void) const;
215 
216  /// Assign a value to Info data member.
217  ///
218  /// @param value
219  /// Reference to value.
220  void SetInfo(TInfo& value);
221 
222  /// Assign a value to Info data member.
223  ///
224  /// @return
225  /// Reference to the data value.
226  TInfo& SetInfo(void);
227 
228  /// Reset the whole object
229  virtual void Reset(void);
230 
231 
232 private:
233  // Prohibit copy constructor and assignment operator
236 
237  // data
238  Uint4 m_set_State[1];
239  string m_Library;
240  bool m_Enabled;
242 };
243 
244 /* @} */
245 
246 
247 
248 
249 
250 ///////////////////////////////////////////////////////////
251 ///////////////////// inline methods //////////////////////
252 ///////////////////////////////////////////////////////////
253 inline
255 {
256  return ((m_set_State[0] & 0x3) != 0);
257 }
258 
259 inline
261 {
262  return IsSetLibrary();
263 }
264 
265 inline
267 {
268  if (!CanGetLibrary()) {
269  ThrowUnassigned(0);
270  }
271  return m_Library;
272 }
273 
274 inline
276 {
277  m_Library = value;
278  m_set_State[0] |= 0x3;
279 }
280 
281 inline
283 {
284  m_Library = std::forward<CPluginLibInfo_Base::TLibrary>(value);
285  m_set_State[0] |= 0x3;
286 }
287 
288 inline
290 {
291 #ifdef _DEBUG
292  if (!IsSetLibrary()) {
294  }
295 #endif
296  m_set_State[0] |= 0x1;
297  return m_Library;
298 }
299 
300 inline
302 {
303  return ((m_set_State[0] & 0xc) != 0);
304 }
305 
306 inline
308 {
309  return true;
310 }
311 
312 inline
314 {
315  m_Enabled = true;
316  m_set_State[0] &= ~0xc;
317 }
318 
319 inline
321 {
322  ResetEnabled();
323 }
324 
325 inline
327 {
328  return m_Enabled;
329 }
330 
331 inline
333 {
334  m_Enabled = value;
335  m_set_State[0] |= 0xc;
336 }
337 
338 inline
340 {
341 #ifdef _DEBUG
342  if (!IsSetEnabled()) {
343  memset(&m_Enabled,UnassignedByte(),sizeof(m_Enabled));
344  }
345 #endif
346  m_set_State[0] |= 0x4;
347  return m_Enabled;
348 }
349 
350 inline
352 {
353  return m_Info.NotEmpty();
354 }
355 
356 inline
358 {
359  return true;
360 }
361 
362 inline
364 {
365  if ( !m_Info ) {
366  const_cast<CPluginLibInfo_Base*>(this)->ResetInfo();
367  }
368  return (*m_Info);
369 }
370 
371 inline
373 {
374  if ( !m_Info ) {
375  ResetInfo();
376  }
377  return (*m_Info);
378 }
379 
380 ///////////////////////////////////////////////////////////
381 ////////////////// end of inline methods //////////////////
382 ///////////////////////////////////////////////////////////
383 
384 
385 
386 
387 
388 END_objects_SCOPE // namespace ncbi::objects::
389 
391 
392 
393 #endif // GUI_OBJECTS_PLUGINLIBINFO_BASE_HPP
@PluginInfoSet.hpp User-defined methods of the data storage class.
Base class for all serializable objects.
Definition: serialbase.hpp:150
char value[7]
Definition: config.c:431
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
static string UnassignedString(void)
Definition: serialbase.hpp:175
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_GUIOBJECTS_EXPORT
Definition: gui_export.h:511
TLibrary & SetLibrary(void)
Assign a value to Library data member.
CPluginInfoSet TInfo
CSerialObject Tparent
void ResetInfo(void)
Reset Info data member.
TInfo & SetInfo(void)
Assign a value to Info data member.
void ResetEnabled(void)
Reset Enabled data member.
bool CanGetLibrary(void) const
Check if it is safe to call GetLibrary method.
bool IsSetInfo(void) const
Check if a value has been assigned to Info data member.
bool IsSetEnabled(void) const
flag: is this plugin enabled? Check if a value has been assigned to Enabled data member.
bool CanGetEnabled(void) const
Check if it is safe to call GetEnabled method.
TEnabled GetEnabled(void) const
Get the Enabled member data.
const TInfo & GetInfo(void) const
Get the Info member data.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
bool CanGetInfo(void) const
Check if it is safe to call GetInfo method.
const TLibrary & GetLibrary(void) const
Get the Library member data.
CPluginLibInfo_Base & operator=(const CPluginLibInfo_Base &)
void SetDefaultEnabled(void)
Assign default value to Enabled data member.
CPluginLibInfo_Base(const CPluginLibInfo_Base &)
bool IsSetLibrary(void) const
Check if a value has been assigned to Library data member.
TEnabled & SetEnabled(void)
Assign a value to Enabled data member.
Defines to provide correct exporting from DLLs in Windows.
Modified on Tue Dec 05 02:10:31 2023 by modify_doxy.py rev. 669887