NCBI C++ ToolKit
Simple_replace_.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 Simple_replace_.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/macro/macro.asn">macro.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/macro/macro.def">macro.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_MACRO_SIMPLE_REPLACE_BASE_HPP
42 #define OBJECTS_MACRO_SIMPLE_REPLACE_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
49 
51 
52 #ifndef BEGIN_objects_SCOPE
53 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
54 # define END_objects_SCOPE END_SCOPE(objects)
55 #endif
56 BEGIN_objects_SCOPE // namespace ncbi::objects::
57 
58 
59 // generated classes
60 
61 
62 /** @addtogroup dataspec_NCBI_Macro
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///
69 /// CSimple_replace_Base --
70 ///
71 
73 {
75 public:
76  // constructor
78  // destructor
79  virtual ~CSimple_replace_Base(void);
80 
81  // type info
83 
84  // types
85  typedef string TReplace;
86  typedef bool TWhole_string;
87  typedef bool TWeasel_to_putative;
88 
89  // member index
90  enum class E_memberIndex {
91  e__allMandatory = 0,
92  e_replace,
95  };
97 
98  // getters
99  // setters
100 
101  /// Check if a value has been assigned to Replace data member.
102  ///
103  /// Data member Replace is optional;
104  /// its type is defined as 'typedef string TReplace'
105  /// @return
106  /// - true, if a value has been assigned.
107  /// - false, otherwise.
108  bool IsSetReplace(void) const;
109 
110  /// Check if it is safe to call GetReplace method.
111  ///
112  /// @return
113  /// - true, if the data member is getatable.
114  /// - false, otherwise.
115  bool CanGetReplace(void) const;
116 
117  /// Reset Replace data member.
118  void ResetReplace(void);
119 
120  /// Get the Replace member data.
121  ///
122  /// @return
123  /// Reference to the member data.
124  const TReplace& GetReplace(void) const;
125 
126  /// Assign a value to Replace data member.
127  ///
128  /// @param value
129  /// Value to assign
130  void SetReplace(const TReplace& value);
131  void SetReplace(TReplace&& value);
132 
133  /// Assign a value to Replace data member.
134  ///
135  /// @return
136  /// Reference to the data value.
137  TReplace& SetReplace(void);
138 
139  /// Check if a value has been assigned to Whole_string data member.
140  ///
141  /// Data member Whole_string is optional with default false;
142  /// its type is defined as 'typedef bool TWhole_string'
143  /// @return
144  /// - true, if a value has been assigned.
145  /// - false, otherwise.
146  bool IsSetWhole_string(void) const;
147 
148  /// Check if it is safe to call GetWhole_string method.
149  ///
150  /// @return
151  /// - true, if the data member is getatable.
152  /// - false, otherwise.
153  bool CanGetWhole_string(void) const;
154 
155  /// Reset Whole_string data member.
156  void ResetWhole_string(void);
157 
158  /// Assign default value to Whole_string data member.
159  void SetDefaultWhole_string(void);
160 
161  /// Get the Whole_string member data.
162  ///
163  /// @return
164  /// Copy of the member data.
165  TWhole_string GetWhole_string(void) const;
166 
167  /// Assign a value to Whole_string data member.
168  ///
169  /// @param value
170  /// Value to assign
172 
173  /// Assign a value to Whole_string data member.
174  ///
175  /// @return
176  /// Reference to the data value.
178 
179  /// Check if a value has been assigned to Weasel_to_putative data member.
180  ///
181  /// Data member Weasel_to_putative is optional with default false;
182  /// its type is defined as 'typedef bool TWeasel_to_putative'
183  /// @return
184  /// - true, if a value has been assigned.
185  /// - false, otherwise.
186  bool IsSetWeasel_to_putative(void) const;
187 
188  /// Check if it is safe to call GetWeasel_to_putative method.
189  ///
190  /// @return
191  /// - true, if the data member is getatable.
192  /// - false, otherwise.
193  bool CanGetWeasel_to_putative(void) const;
194 
195  /// Reset Weasel_to_putative data member.
196  void ResetWeasel_to_putative(void);
197 
198  /// Assign default value to Weasel_to_putative data member.
199  void SetDefaultWeasel_to_putative(void);
200 
201  /// Get the Weasel_to_putative member data.
202  ///
203  /// @return
204  /// Copy of the member data.
206 
207  /// Assign a value to Weasel_to_putative data member.
208  ///
209  /// @param value
210  /// Value to assign
212 
213  /// Assign a value to Weasel_to_putative data member.
214  ///
215  /// @return
216  /// Reference to the data value.
218 
219  /// Reset the whole object
220  virtual void Reset(void);
221 
222 
223 private:
224  // Prohibit copy constructor and assignment operator
227 
228  // data
230  string m_Replace;
233 };
234 
235 /* @} */
236 
237 
238 
239 
240 
241 ///////////////////////////////////////////////////////////
242 ///////////////////// inline methods //////////////////////
243 ///////////////////////////////////////////////////////////
244 inline
246 {
247  return ((m_set_State[0] & 0x3) != 0);
248 }
249 
250 inline
252 {
253  return IsSetReplace();
254 }
255 
256 inline
258 {
259  if (!CanGetReplace()) {
260  ThrowUnassigned(0);
261  }
262  return m_Replace;
263 }
264 
265 inline
267 {
268  m_Replace = value;
269  m_set_State[0] |= 0x3;
270 }
271 
272 inline
274 {
275  m_Replace = std::forward<CSimple_replace_Base::TReplace>(value);
276  m_set_State[0] |= 0x3;
277 }
278 
279 inline
281 {
282 #ifdef _DEBUG
283  if (!IsSetReplace()) {
285  }
286 #endif
287  m_set_State[0] |= 0x1;
288  return m_Replace;
289 }
290 
291 inline
293 {
294  return ((m_set_State[0] & 0xc) != 0);
295 }
296 
297 inline
299 {
300  return true;
301 }
302 
303 inline
305 {
306  m_Whole_string = false;
307  m_set_State[0] &= ~0xc;
308 }
309 
310 inline
312 {
314 }
315 
316 inline
318 {
319  return m_Whole_string;
320 }
321 
322 inline
324 {
326  m_set_State[0] |= 0xc;
327 }
328 
329 inline
331 {
332 #ifdef _DEBUG
333  if (!IsSetWhole_string()) {
334  memset(&m_Whole_string,UnassignedByte(),sizeof(m_Whole_string));
335  }
336 #endif
337  m_set_State[0] |= 0x4;
338  return m_Whole_string;
339 }
340 
341 inline
343 {
344  return ((m_set_State[0] & 0x30) != 0);
345 }
346 
347 inline
349 {
350  return true;
351 }
352 
353 inline
355 {
356  m_Weasel_to_putative = false;
357  m_set_State[0] &= ~0x30;
358 }
359 
360 inline
362 {
364 }
365 
366 inline
368 {
369  return m_Weasel_to_putative;
370 }
371 
372 inline
374 {
376  m_set_State[0] |= 0x30;
377 }
378 
379 inline
381 {
382 #ifdef _DEBUG
383  if (!IsSetWeasel_to_putative()) {
385  }
386 #endif
387  m_set_State[0] |= 0x10;
388  return m_Weasel_to_putative;
389 }
390 
391 ///////////////////////////////////////////////////////////
392 ////////////////// end of inline methods //////////////////
393 ///////////////////////////////////////////////////////////
394 
395 
396 
397 
398 
399 END_objects_SCOPE // namespace ncbi::objects::
400 
402 
403 
404 #endif // OBJECTS_MACRO_SIMPLE_REPLACE_BASE_HPP
Base class for all serializable objects.
Definition: serialbase.hpp:150
CSimple_replace_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
bool IsSetReplace(void) const
Check if a value has been assigned to Replace data member.
bool IsSetWeasel_to_putative(void) const
Check if a value has been assigned to Weasel_to_putative data member.
const TReplace & GetReplace(void) const
Get the Replace member data.
bool CanGetReplace(void) const
Check if it is safe to call GetReplace method.
TReplace & SetReplace(void)
Assign a value to Replace data member.
TWhole_string GetWhole_string(void) const
Get the Whole_string member data.
void ResetReplace(void)
Reset Replace data member.
TWhole_string & SetWhole_string(void)
Assign a value to Whole_string data member.
bool IsSetWhole_string(void) const
Check if a value has been assigned to Whole_string data member.
CSimple_replace_Base(const CSimple_replace_Base &)
CSimple_replace_Base & operator=(const CSimple_replace_Base &)
bool CanGetWeasel_to_putative(void) const
Check if it is safe to call GetWeasel_to_putative method.
virtual void Reset(void)
Reset the whole object.
void ResetWeasel_to_putative(void)
Reset Weasel_to_putative data member.
void SetDefaultWhole_string(void)
Assign default value to Whole_string data member.
void SetDefaultWeasel_to_putative(void)
Assign default value to Weasel_to_putative data member.
TWeasel_to_putative GetWeasel_to_putative(void) const
Get the Weasel_to_putative member data.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
void ResetWhole_string(void)
Reset Whole_string data member.
TWeasel_to_putative & SetWeasel_to_putative(void)
Assign a value to Weasel_to_putative data member.
bool CanGetWhole_string(void) const
Check if it is safe to call GetWhole_string method.
virtual ~CSimple_replace_Base(void)
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Mon Jun 17 05:07:19 2024 by modify_doxy.py rev. 669887