|
LSSTApplications
1.1.2+25,10.0+13,10.0+132,10.0+133,10.0+224,10.0+41,10.0+8,10.0-1-g0f53050+14,10.0-1-g4b7b172+19,10.0-1-g61a5bae+98,10.0-1-g7408a83+3,10.0-1-gc1e0f5a+19,10.0-1-gdb4482e+14,10.0-11-g3947115+2,10.0-12-g8719d8b+2,10.0-15-ga3f480f+1,10.0-2-g4f67435,10.0-2-gcb4bc6c+26,10.0-28-gf7f57a9+1,10.0-3-g1bbe32c+14,10.0-3-g5b46d21,10.0-4-g027f45f+5,10.0-4-g86f66b5+2,10.0-4-gc4fccf3+24,10.0-40-g4349866+2,10.0-5-g766159b,10.0-5-gca2295e+25,10.0-6-g462a451+1
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