NCBI C++ ToolKit
PluginUserType_.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 PluginUserType_.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_PLUGINUSERTYPE_BASE_HPP
42 #define GUI_OBJECTS_PLUGINUSERTYPE_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 // generated classes
63 
64 
65 /** @addtogroup dataspec_NCBI_Plugin
66  *
67  * @{
68  */
69 
70 /////////////////////////////////////////////////////////////////////////////
71 ///
72 /// user types for determining which plugins apply to a given set of objects
73 ///
74 ///
75 /// CPluginUserType_Base --
76 ///
77 
79 {
81 public:
82  // constructor
84  // destructor
85  virtual ~CPluginUserType_Base(void);
86 
87  // type info
89 
90  // types
91  typedef string TType;
92  typedef string TSubtype;
93 
94  // member index
95  enum class E_memberIndex {
96  e__allMandatory = 0,
97  e_type,
98  e_subtype
99  };
101 
102  // getters
103  // setters
104 
105  /// Check if a value has been assigned to Type data member.
106  ///
107  /// Data member Type is mandatory;
108  /// its type is defined as 'typedef string TType'
109  /// @return
110  /// - true, if a value has been assigned.
111  /// - false, otherwise.
112  bool IsSetType(void) const;
113 
114  /// Check if it is safe to call GetType method.
115  ///
116  /// @return
117  /// - true, if the data member is getatable.
118  /// - false, otherwise.
119  bool CanGetType(void) const;
120 
121  /// Reset Type data member.
122  void ResetType(void);
123 
124  /// Get the Type member data.
125  ///
126  /// @return
127  /// Reference to the member data.
128  const TType& GetType(void) const;
129 
130  /// Assign a value to Type data member.
131  ///
132  /// @param value
133  /// Value to assign
134  void SetType(const TType& value);
135  void SetType(TType&& value);
136 
137  /// Assign a value to Type data member.
138  ///
139  /// @return
140  /// Reference to the data value.
141  TType& SetType(void);
142 
143  /// Check if a value has been assigned to Subtype data member.
144  ///
145  /// Data member Subtype is optional;
146  /// its type is defined as 'typedef string TSubtype'
147  /// @return
148  /// - true, if a value has been assigned.
149  /// - false, otherwise.
150  bool IsSetSubtype(void) const;
151 
152  /// Check if it is safe to call GetSubtype method.
153  ///
154  /// @return
155  /// - true, if the data member is getatable.
156  /// - false, otherwise.
157  bool CanGetSubtype(void) const;
158 
159  /// Reset Subtype data member.
160  void ResetSubtype(void);
161 
162  /// Get the Subtype member data.
163  ///
164  /// @return
165  /// Reference to the member data.
166  const TSubtype& GetSubtype(void) const;
167 
168  /// Assign a value to Subtype data member.
169  ///
170  /// @param value
171  /// Value to assign
172  void SetSubtype(const TSubtype& value);
173  void SetSubtype(TSubtype&& value);
174 
175  /// Assign a value to Subtype data member.
176  ///
177  /// @return
178  /// Reference to the data value.
179  TSubtype& SetSubtype(void);
180 
181  /// Reset the whole object
182  virtual void Reset(void);
183 
184 
185 private:
186  // Prohibit copy constructor and assignment operator
189 
190  // data
191  Uint4 m_set_State[1];
192  string m_Type;
193  string m_Subtype;
194 };
195 
196 /* @} */
197 
198 
199 
200 
201 
202 ///////////////////////////////////////////////////////////
203 ///////////////////// inline methods //////////////////////
204 ///////////////////////////////////////////////////////////
205 inline
207 {
208  return ((m_set_State[0] & 0x3) != 0);
209 }
210 
211 inline
213 {
214  return IsSetType();
215 }
216 
217 inline
219 {
220  if (!CanGetType()) {
221  ThrowUnassigned(0);
222  }
223  return m_Type;
224 }
225 
226 inline
228 {
229  m_Type = value;
230  m_set_State[0] |= 0x3;
231 }
232 
233 inline
235 {
236  m_Type = std::forward<CPluginUserType_Base::TType>(value);
237  m_set_State[0] |= 0x3;
238 }
239 
240 inline
242 {
243 #ifdef _DEBUG
244  if (!IsSetType()) {
246  }
247 #endif
248  m_set_State[0] |= 0x1;
249  return m_Type;
250 }
251 
252 inline
254 {
255  return ((m_set_State[0] & 0xc) != 0);
256 }
257 
258 inline
260 {
261  return IsSetSubtype();
262 }
263 
264 inline
266 {
267  if (!CanGetSubtype()) {
268  ThrowUnassigned(1);
269  }
270  return m_Subtype;
271 }
272 
273 inline
275 {
276  m_Subtype = value;
277  m_set_State[0] |= 0xc;
278 }
279 
280 inline
282 {
283  m_Subtype = std::forward<CPluginUserType_Base::TSubtype>(value);
284  m_set_State[0] |= 0xc;
285 }
286 
287 inline
289 {
290 #ifdef _DEBUG
291  if (!IsSetSubtype()) {
293  }
294 #endif
295  m_set_State[0] |= 0x4;
296  return m_Subtype;
297 }
298 
299 ///////////////////////////////////////////////////////////
300 ////////////////// end of inline methods //////////////////
301 ///////////////////////////////////////////////////////////
302 
303 
304 
305 
306 
307 END_objects_SCOPE // namespace ncbi::objects::
308 
310 
311 
312 #endif // GUI_OBJECTS_PLUGINUSERTYPE_BASE_HPP
user types for determining which plugins apply to a given set of objects
Base class for all serializable objects.
Definition: serialbase.hpp:150
int GetSubtype(CFieldNamePanel *field_name_panel, string &ncRNA_class)
void ThrowUnassigned(TMemberIndex index) const
static string UnassignedString(void)
Definition: serialbase.hpp:175
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
const TType & GetType(void) const
Get the Type member data.
CPluginUserType_Base(const CPluginUserType_Base &)
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
bool IsSetSubtype(void) const
Check if a value has been assigned to Subtype data member.
bool CanGetSubtype(void) const
Check if it is safe to call GetSubtype method.
TType & SetType(void)
Assign a value to Type data member.
bool IsSetType(void) const
Check if a value has been assigned to Type data member.
CPluginUserType_Base & operator=(const CPluginUserType_Base &)
bool CanGetType(void) const
Check if it is safe to call GetType method.
TSubtype & SetSubtype(void)
Assign a value to Subtype data member.
const TSubtype & GetSubtype(void) const
Get the Subtype member data.
Defines to provide correct exporting from DLLs in Windows.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Mon Jun 24 05:25:51 2024 by modify_doxy.py rev. 669887