NCBI C++ ToolKit
TMgr_TrackACL_Permission_.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 TMgr_TrackACL_Permission_.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/trackmgr/trackmgr.asn">trackmgr.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/trackmgr/trackmgr.def">trackmgr.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_TRACKMGR_TMGR_TRACKACL_PERMISSION_BASE_HPP
42 #define OBJECTS_TRACKMGR_TMGR_TRACKACL_PERMISSION_BASE_HPP
43 
44 // extra headers
46 
47 // standard includes
48 #include <serial/serialbase.hpp>
49 
50 // generated includes
51 #include <string>
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 // generated classes
64 
65 
66 /** @addtogroup dataspec_NCBI_TrackManager
67  *
68  * @{
69  */
70 
71 /////////////////////////////////////////////////////////////////////////////
72 ///
73 /// CTMgr_TrackACL_Permission_Base --
74 ///
75 
77 {
79 public:
80  // constructor
82  // destructor
83  virtual ~CTMgr_TrackACL_Permission_Base(void);
84 
85  // type info
87 
88  // types
89  typedef int TAccess_level;
90  typedef string TAccess_key;
91 
92  // member index
93  enum class E_memberIndex {
94  e__allMandatory = 0,
95  e_access_level,
96  e_access_key
97  };
99 
100  // getters
101  // setters
102 
103  /// Check if a value has been assigned to Access_level data member.
104  ///
105  /// Data member Access_level is optional with default eTMgr_ACL_AccessLevel_public;
106  /// its type is defined as 'typedef int TAccess_level'
107  /// @return
108  /// - true, if a value has been assigned.
109  /// - false, otherwise.
110  bool IsSetAccess_level(void) const;
111 
112  /// Check if it is safe to call GetAccess_level method.
113  ///
114  /// @return
115  /// - true, if the data member is getatable.
116  /// - false, otherwise.
117  bool CanGetAccess_level(void) const;
118 
119  /// Reset Access_level data member.
120  void ResetAccess_level(void);
121 
122  /// Assign default value to Access_level data member.
123  void SetDefaultAccess_level(void);
124 
125  /// Get the Access_level member data.
126  ///
127  /// @return
128  /// Copy of the member data.
129  TAccess_level GetAccess_level(void) const;
130 
131  /// Assign a value to Access_level data member.
132  ///
133  /// @param value
134  /// Value to assign
135  void SetAccess_level(TAccess_level value);
136 
137  /// Assign a value to Access_level data member.
138  ///
139  /// @return
140  /// Reference to the data value.
141  TAccess_level& SetAccess_level(void);
142 
143  /// Check if a value has been assigned to Access_key data member.
144  ///
145  /// Data member Access_key is optional;
146  /// its type is defined as 'typedef string TAccess_key'
147  /// @return
148  /// - true, if a value has been assigned.
149  /// - false, otherwise.
150  bool IsSetAccess_key(void) const;
151 
152  /// Check if it is safe to call GetAccess_key method.
153  ///
154  /// @return
155  /// - true, if the data member is getatable.
156  /// - false, otherwise.
157  bool CanGetAccess_key(void) const;
158 
159  /// Reset Access_key data member.
160  void ResetAccess_key(void);
161 
162  /// Get the Access_key member data.
163  ///
164  /// @return
165  /// Reference to the member data.
166  const TAccess_key& GetAccess_key(void) const;
167 
168  /// Assign a value to Access_key data member.
169  ///
170  /// @param value
171  /// Value to assign
172  void SetAccess_key(const TAccess_key& value);
173  void SetAccess_key(TAccess_key&& value);
174 
175  /// Assign a value to Access_key data member.
176  ///
177  /// @return
178  /// Reference to the data value.
179  TAccess_key& SetAccess_key(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];
193  string m_Access_key;
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 true;
215 }
216 
217 inline
219 {
221  m_set_State[0] &= ~0x3;
222 }
223 
224 inline
226 {
228 }
229 
230 inline
232 {
233  return m_Access_level;
234 }
235 
236 inline
238 {
240  m_set_State[0] |= 0x3;
241 }
242 
243 inline
245 {
246 #ifdef _DEBUG
247  if (!IsSetAccess_level()) {
248  memset(&m_Access_level,UnassignedByte(),sizeof(m_Access_level));
249  }
250 #endif
251  m_set_State[0] |= 0x1;
252  return m_Access_level;
253 }
254 
255 inline
257 {
258  return ((m_set_State[0] & 0xc) != 0);
259 }
260 
261 inline
263 {
264  return IsSetAccess_key();
265 }
266 
267 inline
269 {
270  if (!CanGetAccess_key()) {
271  ThrowUnassigned(1);
272  }
273  return m_Access_key;
274 }
275 
276 inline
278 {
280  m_set_State[0] |= 0xc;
281 }
282 
283 inline
285 {
286  m_Access_key = std::forward<CTMgr_TrackACL_Permission_Base::TAccess_key>(value);
287  m_set_State[0] |= 0xc;
288 }
289 
290 inline
292 {
293 #ifdef _DEBUG
294  if (!IsSetAccess_key()) {
296  }
297 #endif
298  m_set_State[0] |= 0x4;
299  return m_Access_key;
300 }
301 
302 ///////////////////////////////////////////////////////////
303 ////////////////// end of inline methods //////////////////
304 ///////////////////////////////////////////////////////////
305 
306 
307 
308 
309 
310 END_objects_SCOPE // namespace ncbi::objects::
311 
313 
314 
315 #endif // OBJECTS_TRACKMGR_TMGR_TRACKACL_PERMISSION_BASE_HPP
User-defined methods of the data storage class.
Base class for all serializable objects.
Definition: serialbase.hpp:150
CTMgr_TrackACL_Permission_Base –.
static char UnassignedByte(void)
Definition: serialbase.hpp:181
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
TAccess_level GetAccess_level(void) const
Get the Access_level member data.
CTMgr_TrackACL_Permission_Base(const CTMgr_TrackACL_Permission_Base &)
CTMgr_TrackACL_Permission_Base & operator=(const CTMgr_TrackACL_Permission_Base &)
bool IsSetAccess_level(void) const
Check if a value has been assigned to Access_level data member.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
bool IsSetAccess_key(void) const
Check if a value has been assigned to Access_key data member.
TAccess_key & SetAccess_key(void)
Assign a value to Access_key data member.
void ResetAccess_level(void)
Reset Access_level data member.
bool CanGetAccess_level(void) const
Check if it is safe to call GetAccess_level method.
TAccess_level & SetAccess_level(void)
Assign a value to Access_level data member.
bool CanGetAccess_key(void) const
Check if it is safe to call GetAccess_key method.
const TAccess_key & GetAccess_key(void) const
Get the Access_key member data.
void SetDefaultAccess_level(void)
Assign default value to Access_level data member.
@ eTMgr_ACL_AccessLevel_public
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Defines to provide correct exporting from DLLs in Windows.
#define NCBI_TRACKMGR_EXPORT
Modified on Wed Sep 04 14:58:30 2024 by modify_doxy.py rev. 669887