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

Go to the SVN repository for this file.

1 #ifndef GUI_OBJUTILS___TAXID_SEL_SET__HPP
2 #define GUI_OBJUTILS___TAXID_SEL_SET__HPP
3 
4 /* $Id: taxid_sel_set.hpp 26143 2012-07-25 19:53:48Z falkrb $
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 CAnyType 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 CAnyType particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Robert Falk
30  *
31  * File Description:
32  *
33  */
34 
35 #include <corelib/ncbistl.hpp>
36 #include <corelib/ncbiobj.hpp>
37 #include <gui/gui_export.h>
38 
39 #include <util/bitset/bm.h>
40 
41 
43 
44 ///////////////////////////////////////////////////////////////////////////////
45 /// Class designed to hold a set of tax-ids represented as (on) bits in
46 /// a bit vector
48 {
49 public:
51  typedef bm::id_t TTaxId;
52 
55 
56  const TBitVec& GetSelectedTaxIds() const { return m_SelectedTaxIds; }
57  TBitVec& GetSelectedTaxIds() { return m_SelectedTaxIds; }
58 
59  void SelectTaxId(TTaxId tid) { m_SelectedTaxIds.set_bit(tid, true); }
60  void DeSelectTaxId(TTaxId tid) { m_SelectedTaxIds.set_bit(tid, false); }
61 
62  bool IsSelected(TTaxId tid) const { return m_SelectedTaxIds[tid]; }
63 
64 protected:
65 
66  /// Bit vector of taxids
68 };
69 
70 
72 
73 #endif // GUI_OBJUTILS___TAXID_SEL_SET__HPP
Compressed bit-vector bvector<> container, set algebraic methods, traversal iterators.
CObject –.
Definition: ncbiobj.hpp:180
Class designed to hold a set of tax-ids represented as (on) bits in a bit vector.
const TBitVec & GetSelectedTaxIds() const
bm::bvector TBitVec
bool IsSelected(TTaxId tid) const
TBitVec & GetSelectedTaxIds()
bm::id_t TTaxId
TBitVec m_SelectedTaxIds
Bit vector of taxids.
void SelectTaxId(TTaxId tid)
void DeSelectTaxId(TTaxId tid)
#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_GUIOBJUTILS_EXPORT
Definition: gui_export.h:512
Defines to provide correct exporting from DLLs in Windows.
unsigned int id_t
Definition: bmconst.h:38
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
The NCBI C++/STL use hints.
Modified on Thu Feb 29 12:23:20 2024 by modify_doxy.py rev. 669887