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

Go to the SVN repository for this file.

1 #ifndef OBJECTS_OBJMGR_IMPL___SYNONYMS__HPP
2 #define OBJECTS_OBJMGR_IMPL___SYNONYMS__HPP
3 
4 /* $Id: synonyms.hpp 64506 2014-09-18 14:47:47Z vasilche $
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: Aleksey Grichenko
30  *
31  * File Description:
32  * Set of seq-id synonyms for CScope cache
33  *
34  */
35 
36 #include <corelib/ncbiobj.hpp>
38 #include <vector>
39 #include <utility>
40 
43 
44 class CBioseq_ScopeInfo;
45 class CBioseq_Handle;
46 
47 ////////////////////////////////////////////////////////////////////
48 //
49 // CSynonymsSet::
50 //
51 // Set of seq-id synonyms for CScope cache
52 //
53 
55 {
56 public:
58  typedef vector<value_type> TIdSet;
60 
61  CSynonymsSet(void);
62  ~CSynonymsSet(void);
63 
64  const_iterator begin(void) const;
65  const_iterator end(void) const;
66  bool empty(void) const;
67 
68  static CSeq_id_Handle GetSeq_id_Handle(const const_iterator& iter);
69 
70  void AddSynonym(const value_type& syn);
71  bool ContainsSynonym(const CSeq_id_Handle& id) const;
72 
73 private:
74  // Prohibit copy functions
77 
79 };
80 
81 /////////////////////////////////////////////////////////////////////
82 //
83 // Inline methods
84 //
85 /////////////////////////////////////////////////////////////////////
86 
87 
88 inline
90 {
91  return m_IdSet.begin();
92 }
93 
94 
95 inline
97 {
98  return m_IdSet.end();
99 }
100 
101 
102 inline
103 bool CSynonymsSet::empty(void) const
104 {
105  return m_IdSet.empty();
106 }
107 
108 
111 
112 #endif /* OBJECTS_OBJMGR_IMPL___SYNONYMS__HPP */
CBioseq_Handle –.
CObject –.
Definition: ncbiobj.hpp:180
const_iterator end(void) const
Definition: synonyms.hpp:96
vector< value_type > TIdSet
Definition: synonyms.hpp:58
CSynonymsSet(const CSynonymsSet &)
bool empty(void) const
Definition: synonyms.hpp:103
CSeq_id_Handle value_type
Definition: synonyms.hpp:57
TIdSet::const_iterator const_iterator
Definition: synonyms.hpp:59
CSynonymsSet & operator=(const CSynonymsSet &)
TIdSet m_IdSet
Definition: synonyms.hpp:78
const_iterator begin(void) const
Definition: synonyms.hpp:89
parent_type::const_iterator const_iterator
Definition: set.hpp:79
#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_XOBJMGR_EXPORT
Definition: ncbi_export.h:1307
constexpr bool empty(list< Ts... >) noexcept
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Modified on Sat Feb 24 07:47:22 2024 by modify_doxy.py rev. 669887