|
LSSTApplications
8.0.0.0+107,8.0.0.1+13,9.1+18,9.2,master-g084aeec0a4,master-g0aced2eed8+6,master-g15627eb03c,master-g28afc54ef9,master-g3391ba5ea0,master-g3d0fb8ae5f,master-g4432ae2e89+36,master-g5c3c32f3ec+17,master-g60f1e072bb+1,master-g6a3ac32d1b,master-g76a88a4307+1,master-g7bce1f4e06+57,master-g8ff4092549+31,master-g98e65bf68e,master-ga6b77976b1+53,master-gae20e2b580+3,master-gb584cd3397+53,master-gc5448b162b+1,master-gc54cf9771d,master-gc69578ece6+1,master-gcbf758c456+22,master-gcec1da163f+63,master-gcf15f11bcc,master-gd167108223,master-gf44c96c709
LSSTDataManagementBasePackage
|
A set of up to NumEntries elements of type EntryT, hashed by an integer identifier. More...
#include <ChunkManagerImpl.h>
Public Member Functions | |
| HashedSet () | |
| EntryT * | find (int const id) |
| Returns a pointer to the entry with the given identifier, or null if there is no such entry. More... | |
| EntryT const * | find (int const id) const |
| Returns a pointer to the entry with the given identifier, or null if there is no such entry. More... | |
| EntryT * | insert (int const id) |
| std::pair< EntryT *, bool > | findOrInsert (int const id) |
| bool | erase (int const id) |
| int | size () const |
| int | space () const |
| EntryT * | begin () |
| EntryT const * | begin () const |
| EntryT * | end () |
| EntryT const * | end () const |
Private Member Functions | |
| BOOST_STATIC_ASSERT (NumEntries > 0 &&(NumEntries &(NumEntries-1))==0) | |
| BOOST_STATIC_ASSERT (NumEntries< INT_MAX) | |
| EntryT const * | doFind (int const id) const |
Private Attributes | |
| int | _hashTable [2 *NumEntries] |
| int | _free |
| int | _size |
| EntryT | _entries [NumEntries] |
A set of up to NumEntries elements of type EntryT, hashed by an integer identifier.
The hash table implementation is chained and intrusive – requirements follow:
Definition at line 72 of file ChunkManagerImpl.h.
| lsst::ap::detail::HashedSet< EntryT, NumEntries >::HashedSet | ( | ) |
Definition at line 71 of file ChunkManagerImpl.cc.
|
inline |
Returns a pointer to the beginning of the underlying array of entries. Not all array entries will correspond to HashedSet entries : invalid entries - those that do not correspond to an entry that has been added to the set via insert() or findOrInsert() - are marked with an id value of -1.
Definition at line 112 of file ChunkManagerImpl.h.
|
inline |
Definition at line 115 of file ChunkManagerImpl.h.
|
private |
|
private |
|
private |
Returns a pointer to the entry with the given identifier, or null if there is no such entry.
| [in] | id | The identifier of the entry to find. |
Definition at line 93 of file ChunkManagerImpl.cc.
|
inline |
Returns a pointer to the end of the underlying array of entries.
Definition at line 120 of file ChunkManagerImpl.h.
|
inline |
Definition at line 123 of file ChunkManagerImpl.h.
| bool lsst::ap::detail::HashedSet< EntryT, NumEntries >::erase | ( | int const | id | ) |
Erases the entry with the given id, returning true if an entry with the given id was found.
| [in] | id | The id of the entry to erase. |
true if an entry with the given id was found (and erased). Definition at line 211 of file ChunkManagerImpl.cc.
|
inline |
Returns a pointer to the entry with the given identifier, or null if there is no such entry.
Definition at line 82 of file ChunkManagerImpl.h.
|
inline |
Returns a pointer to the entry with the given identifier, or null if there is no such entry.
Definition at line 87 of file ChunkManagerImpl.h.
| std::pair< EntryT *, bool > lsst::ap::detail::HashedSet< EntryT, NumEntries >::findOrInsert | ( | int const | id | ) |
Returns a pointer to a preexisting or freshly default-constructed entry with the given identifier, along with a boolean indicating whether the entry was inserted (true) or found (false). The pointer returned is null if and only if a fresh entry was required but there were no free entries available.
| [in] | id | The identifier (unique within this set) of the entry to find or insert. |
true) or found (false). Definition at line 166 of file ChunkManagerImpl.cc.
| EntryT * lsst::ap::detail::HashedSet< EntryT, NumEntries >::insert | ( | int const | id | ) |
Returns a pointer to a freshly initialized entry with the given identifier, or null if an entry with the given identifier already exists.
| [in] | id | The identifier (unique within this set) of the entry to insert. |
Definition at line 115 of file ChunkManagerImpl.cc.
|
inline |
|
inline |
Returns the number of additional entries there is space for in the set
Definition at line 103 of file ChunkManagerImpl.h.
|
private |
Definition at line 131 of file ChunkManagerImpl.h.
|
private |
Definition at line 129 of file ChunkManagerImpl.h.
|
private |
Definition at line 128 of file ChunkManagerImpl.h.
|
private |
Definition at line 130 of file ChunkManagerImpl.h.
1.8.5