NCBI C++ ToolKit
cleanup_change.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef CLEANUP___CLEANUP_CHANGE__HPP
2 #define CLEANUP___CLEANUP_CHANGE__HPP
3 
4 /* $Id: cleanup_change.hpp 101118 2023-11-01 16:24:30Z stakhovv $
5 * ===========================================================================
6 *
7 * PUBLIC DOMAIN NOTICE
8 * National Center for Biotechnology Information
9 *
10 * This software/database is a "United States Government Work" under the
11 * terms of the United States Copyright Act. It was written as part of
12 * the author's official duties as a United States Government employee and
13 * thus cannot be copyrighted. This software/database is freely available
14 * to the public for use. The National Library of Medicine and the U.S.
15 * Government have not placed any restriction on its use or reproduction.
16 *
17 * Although all reasonable efforts have been taken to ensure the accuracy
18 * and reliability of the software and data, the NLM and the U.S.
19 * Government do not and cannot warrant the performance or results that
20 * may be obtained by using this software or data. The NLM and the U.S.
21 * Government disclaim all warranties, express or implied, including
22 * warranties of performance, merchantability or fitness for any particular
23 * purpose.
24 *
25 * Please cite the author in any work or product based on this material.
26 *
27 * ===========================================================================
28 *
29 * Author: Robert Smith
30 *
31 * File Description:
32 * Basic Cleanup of CSeq_entries.
33 * .......
34 *
35 */
36 
37 #include <corelib/ncbiobj.hpp>
38 #include <util/compile_time.hpp>
39 
42 
43 /**
44  All the changes made during cleanup.
45  A container of CCleanupChangeItem's.
46 */
48 {
49 public:
50  // If you add to this, also edit sm_ChangeDesc's values in the cleanup.cpp file.
51  // They must be edited together.
52  enum EChanges {
53  eNoChange = 0,
54  // set when strings are changed.
58  // set when lists are sorted or uniqued.
65  // Set when fields are moved or have content changes
77  // Set when fields are rescued
86  // set when locations are repaired
90  // set when MolInfo descriptors are affected
92  // set when prot-xref is removed
94  // set when gene-xref is removed
96  // set when protein feature is added
98  // set when feature is removed
100  // set when feature is moved,
102  // set when qualifier is removed
104  // set when gene xref is created
106  // set when descriptor is removed
108  // set when keyword is removed
149  eCleanDbtag, // 80
166  // set when any other change is made.
168 
169  eNumberofChangeTypes
170  };
171 
172  // all constructors are default
173 
174  bool IsChanged(EChanges e) const { return m_Changes.test(e); }
175  void SetChanged(EChanges e) { m_Changes.set(e); }
176  size_t ChangeCount() const { return m_Changes.size(); }
177  bool Empty() const { return m_Changes.empty(); }
178  operator bool() const { return !m_Changes.empty(); }
179 
180  vector<EChanges> GetAllChanges() const;
181  vector<string_view> GetDescriptions() const;
182 
183  static string_view GetDescription(EChanges e);
184 
185  CCleanupChangeCore& operator |= (const CCleanupChangeCore& other) {
186  m_Changes += other.m_Changes;
187  return *this;
188  }
189  CCleanupChangeCore& operator += (const CCleanupChangeCore& other) { return operator|=(other); }
190 
191 private:
194 };
195 
197 {
198 };
199 
200 
203 
204 #endif /* CLEANUP___CLEANUP_CHANGE__HPP */
All the changes made during cleanup.
bool IsChanged(EChanges e) const
size_t ChangeCount() const
void SetChanged(EChanges e)
CObject –.
Definition: ncbiobj.hpp:180
#define bool
Definition: bool.h:34
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
#define NCBI_CLEANUP_EXPORT
Definition: ncbi_export.h:953
CNcbiMatrix< T > & operator+=(CNcbiMatrix< T > &, const CNcbiMatrix< U > &)
global addition: matrix += matrix
Definition: matrix.hpp:570
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Modified on Wed Sep 04 15:01:05 2024 by modify_doxy.py rev. 669887