ProteoWizard
Public Member Functions | Private Attributes | List of all members
pwiz::data::MemoryIndex Class Reference

index implementation in memory; find(string id) is O(logN); find(ordinal index) is O(1); memory footprint is basically (number of entries * 2) More...

#include <MemoryIndex.hpp>

Inheritance diagram for pwiz::data::MemoryIndex:
pwiz::data::Index

Public Member Functions

 MemoryIndex ()
 
virtual void create (std::vector< Entry > &entries)
 create the index from specified list of entries; the list is non-const because the index implementation may resort the list More...
 
virtual size_t size () const
 returns the number of entries in the index More...
 
virtual EntryPtr find (const std::string &id) const
 returns the entry for the specified string id, or null if the id is not in the index More...
 
virtual EntryPtr find (size_t index) const
 returns the entry for the specified ordinal index, or null if the ordinal is not in the index More...
 
- Public Member Functions inherited from pwiz::data::Index
virtual ~Index ()
 

Private Attributes

boost::shared_ptr< Impl > impl_
 

Additional Inherited Members

- Public Types inherited from pwiz::data::Index
typedef boost::iostreams::stream_offset stream_offset
 
typedef boost::shared_ptr< EntryEntryPtr
 

Detailed Description

index implementation in memory; find(string id) is O(logN); find(ordinal index) is O(1); memory footprint is basically (number of entries * 2)

Definition at line 37 of file MemoryIndex.hpp.

Constructor & Destructor Documentation

§ MemoryIndex()

pwiz::data::MemoryIndex::MemoryIndex ( )

Member Function Documentation

§ create()

virtual void pwiz::data::MemoryIndex::create ( std::vector< Entry > &  entries)
virtual

create the index from specified list of entries; the list is non-const because the index implementation may resort the list

Implements pwiz::data::Index.

Referenced by test().

§ size()

virtual size_t pwiz::data::MemoryIndex::size ( ) const
virtual

returns the number of entries in the index

Implements pwiz::data::Index.

Referenced by test().

§ find() [1/2]

virtual EntryPtr pwiz::data::MemoryIndex::find ( const std::string &  id) const
virtual

returns the entry for the specified string id, or null if the id is not in the index

Implements pwiz::data::Index.

Referenced by test().

§ find() [2/2]

virtual EntryPtr pwiz::data::MemoryIndex::find ( size_t  index) const
virtual

returns the entry for the specified ordinal index, or null if the ordinal is not in the index

Implements pwiz::data::Index.

Member Data Documentation

§ impl_

boost::shared_ptr<Impl> pwiz::data::MemoryIndex::impl_
private

Definition at line 49 of file MemoryIndex.hpp.


The documentation for this class was generated from the following file: