ProteoWizard
pwiz
data
common
BinaryIndexStream.hpp
Go to the documentation of this file.
1
//
2
// $Id$
3
//
4
//
5
// Original author: Matt Chambers <matt.chambers .@. vanderbilt.edu>
6
//
7
// Copyright 2009 Vanderbilt University - Nashville, TN 37232
8
//
9
// Licensed under the Apache License, Version 2.0 (the "License");
10
// you may not use this file except in compliance with the License.
11
// You may obtain a copy of the License at
12
//
13
// http://www.apache.org/licenses/LICENSE-2.0
14
//
15
// Unless required by applicable law or agreed to in writing, software
16
// distributed under the License is distributed on an "AS IS" BASIS,
17
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
// See the License for the specific language governing permissions and
19
// limitations under the License.
20
//
21
22
#ifndef _BINARYINDEX_HPP_
23
#define _BINARYINDEX_HPP_
24
25
26
#include "
Index.hpp
"
27
#include <iostream>
28
29
30
namespace
pwiz
{
31
namespace
data {
32
33
34
/// index implementation in a stream (intended for fstreams but any iostream works);
35
/// find(string id) is O(logN);
36
/// find(ordinal index) is O(1);
37
/// memory footprint is negligible
38
class
PWIZ_API_DECL
BinaryIndexStream
:
public
Index
39
{
40
public
:
41
42
BinaryIndexStream
(boost::shared_ptr<std::iostream> indexStreamPtr);
43
44
virtual
void
create(std::vector<Entry>& entries);
45
virtual
size_t
size()
const
;
46
virtual
EntryPtr
find(
const
std::string&
id
)
const
;
47
virtual
EntryPtr
find(
size_t
index)
const
;
48
49
private
:
50
class
Impl;
51
boost::shared_ptr<Impl>
impl_
;
52
};
53
54
55
}
// namespace data
56
}
// namespace pwiz
57
58
59
#endif // _BINARYINDEX_HPP_
Index.hpp
pwiz
Definition:
ChromatogramList_Filter.hpp:36
PWIZ_API_DECL
#define PWIZ_API_DECL
Definition:
Export.hpp:32
pwiz::data::BinaryIndexStream
index implementation in a stream (intended for fstreams but any iostream works); find(string id) is O...
Definition:
BinaryIndexStream.hpp:38
pwiz::data::BinaryIndexStream::impl_
boost::shared_ptr< Impl > impl_
Definition:
BinaryIndexStream.hpp:50
pwiz::data::Index
generic interface for creating and using an index on a stream of serialized objects
Definition:
Index.hpp:39
pwiz::data::Index::EntryPtr
boost::shared_ptr< Entry > EntryPtr
Definition:
Index.hpp:53
Generated by
1.8.17