NCBI C++ ToolKit
annot_object_index.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: annot_object_index.cpp 74559 2016-09-13 11:58:16Z ivanov $
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 * Author: Eugene Vasilchenko
27 *
28 * File Description:
29 * AnnotObject indexes structures
30 *
31 */
32 
33 #include <ncbi_pch.hpp>
36 
39 
40 
42  : m_Indexed(false)
43 {
44 }
45 
46 
48  : m_Name(name), m_Indexed(false)
49 {
50 }
51 
52 
54  : m_Name(info.m_Name), m_Indexed(false)
55 {
56 }
57 
58 
60 {
61 }
62 
63 
65 {
66  _ASSERT(!IsIndexed());
67  m_Name = name;
68 }
69 
70 
72 {
73  m_Keys.clear();
74  m_Indexed = false;
75 }
76 
77 
79 {
80  _ASSERT(m_Keys.empty());
81  m_Keys.reserve(size);
82 }
83 
84 
86 {
87  m_Infos.push_back(info);
88 }
89 
90 
92  const SAnnotObject_Index& /*index*/)
93 {
94  m_Keys.push_back(key);
95 }
96 
97 
99 {
100  m_Keys.pop_back();
101 }
102 
103 
105 {
106  TObjectKeys keys(m_Keys.begin(), m_Keys.end());
107  keys.swap(m_Keys);
108 }
109 
110 
#define false
Definition: bool.h:36
#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
static MDB_envinfo info
Definition: mdb_load.c:37
const struct ncbi::grid::netcache::search::fields::SIZE size
const struct ncbi::grid::netcache::search::fields::KEY key
bool IsIndexed(void) const
void SetName(const CAnnotName &name)
void AddInfo(const CAnnotObject_Info &info)
void ReserveMapSize(size_t size)
vector< SAnnotObject_Key > TObjectKeys
void AddMap(const SAnnotObject_Key &key, const SAnnotObject_Index &index)
#define _ASSERT
Modified on Tue Jul 23 17:46:58 2024 by modify_doxy.py rev. 669887