#include <IDMap_AMOS.hh>
Inheritance diagram for AMOS::IDMap_t:
Public Member Functions | |
IDMap_t () | |
Contstructs an empty IDMap_t object. | |
IDMap_t (Size_t buckets) | |
Contstructs an empty IDMap_t object. | |
IDMap_t (const IDMap_t &source) | |
Copy constructor. | |
~IDMap_t () | |
Destroys a IDMap_t object. | |
const_iterator | begin () const |
Returns an IDMap_t::const_iterator to the beginning of the map. | |
const_iterator | end () const |
Returns an IDMap_t::const_iterator to the end of the map. | |
void | clear () |
Clears all object data. | |
void | concat (const IDMap_t &source) |
Concatenate another IDMap onto this one. | |
bool | empty () const |
Returns true if the map is empty. | |
bool | exists (const std::string &key) const |
Check if a certain EID exists in the map. | |
bool | exists (ID_t key) const |
Check if a certain IID exists in the map. | |
Size_t | getBuckets () const |
Returns the current number of buckets being used. | |
virtual NCode_t | getNCode () const |
Get the AMOS NCode type identifier. | |
Size_t | getSize () const |
Get the number of value triples in the map. | |
NCode_t | getType () const |
The type of IDs stored in the map. | |
const HashTriple_t * | insert (ID_t iid, const std::string &eid, ID_t bid=NULL_ID) |
Insert a new EID/IID keyed value into the map. | |
const HashTriple_t * | insert (const std::string &eid, ID_t bid=NULL_ID) |
Insert a new EID keyed value into the map. | |
const HashTriple_t * | insert (ID_t iid, ID_t bid=NULL_ID) |
Insert a new IID keyed value into the map. | |
ID_t | lookupBID (const std::string &key) const |
Lookup the BID associated with an EID key. | |
ID_t | lookupBID (ID_t key) const |
Lookup the BID associated with an IID key. | |
const std::string & | lookupEID (ID_t key) const |
Lookup the EID associated with an IID key. | |
ID_t | lookupIID (const std::string &key) const |
Lookup the IID associated with an EID key. | |
IDMap_t & | operator= (const IDMap_t &source) |
Assignment (copy) operator. | |
virtual void | readMessage (const Message_t &msg) |
Reads in data from a Message object. | |
void | remove (ID_t key) |
Remove an existing value triple from the map by IID key. | |
void | remove (const std::string &key) |
Remove an existing value triple from the map by EID key. | |
void | resize (Size_t min) |
Resize the hash table. | |
virtual void | writeMessage (Message_t &msg) const |
Writes data to a Message object. | |
void | read (std::istream &in) |
Read a tab-delimited IDMap record. | |
void | setType (NCode_t type) |
Set the type of the mapped IDs. | |
void | write (std::ostream &out) const |
Write a tab-delimited IDMap record. | |
Static Public Attributes | |
const NCode_t | NCODE = M_IDMAP |
The NCode type identifier for this object. |
A double hash of IIDs and EIDs to each other and BIDs. Users may lookup an EID or BID via an IID, or may lookup an IID or BID via an EID.
A quick review of the identifier nomenclature: BID is a bank index, EID is an external ID, and IID is an internal AMOS ID. BIDs are physical bank indices; useful only for debugging purposes. IIDs are interger IDs used by AMOS for object links and identification, e.g. retrieving an object from a bank. EIDs are string indentifiers of unlimited length, e.g. sequence names. The empty string is used as an equivalent for NULL EID.
Definition at line 36 of file IDMap_AMOS.hh.
|
Contstructs an empty IDMap_t object. Definition at line 305 of file IDMap_AMOS.hh. References AMOS::NULL_NCODE, and resize(). |
|
Contstructs an empty IDMap_t object.
References AMOS::NULL_NCODE, resize(), and AMOS::Size_t. |
|
Copy constructor. Definition at line 327 of file IDMap_AMOS.hh. References AMOS::NULL_NCODE. |
|
Destroys a IDMap_t object. Definition at line 337 of file IDMap_AMOS.hh. References clear(). |
|
Returns an IDMap_t::const_iterator to the beginning of the map. Constant iterator on all the HashTriple_t values in the map. Will go NULL when at end of list. Test for validity just as you would test a pointer: for ( myitr = mymap.begin( ); mitr; ++ mitr ) Definition at line 350 of file IDMap_AMOS.hh. Referenced by clear(), concat(), AMOS::IDMap_t::const_iterator::const_iterator(), AMOS::IDMap_t::const_iterator::operator++(), resize(), write(), and writeMessage(). |
|
Clears all object data. Clears data, but does not resize the hash table.
References begin(), end(), and AMOS::NULL_NCODE. Referenced by operator=(), read(), readMessage(), resize(), writeMessage(), and ~IDMap_t(). |
|
Concatenate another IDMap onto this one. Has no effect if source is the same IDMap as this one.
References begin(), end(), getSize(), insert(), and resize(). Referenced by operator=(). |
|
Returns true if the map is empty.
Referenced by AMOS::IDMap_t::const_iterator::const_iterator(), insert(), and remove(). |
|
Returns an IDMap_t::const_iterator to the end of the map. Constant iterator on all the HashTriple_t values in the map. Usage similar to STL iterators, i.e. for ( itr = map.begin( ); itr != map.end( ); ++ itr ) Definition at line 363 of file IDMap_AMOS.hh. Referenced by clear(), concat(), AMOS::IDMap_t::const_iterator::operator++(), resize(), write(), and writeMessage(). |
|
Check if a certain IID exists in the map. Returns true if the IID exists, otherwise false. Will always return false if key is NULL_ID.
References AMOS::ID_t. |
|
Check if a certain EID exists in the map. Returns true if the EID exists, otherwise false. Will always return false if key is NULL.
Referenced by readMessage(). |
|
Returns the current number of buckets being used.
References AMOS::Size_t. |
|
Get the AMOS NCode type identifier.
Implements AMOS::IMessagable_t. Definition at line 445 of file IDMap_AMOS.hh. References AMOS::NCode_t. |
|
Get the number of value triples in the map.
References AMOS::Size_t. Referenced by concat(). |
|
The type of IDs stored in the map.
References AMOS::NCode_t. |
|
Insert a new IID keyed value into the map. Inserts a new BID into the map via an IID key. Has no effect if IID is NULL_ID, but BID is permitted to be NULL_ID.
References AMOS::ID_t, insert(), and AMOS::NULL_STRING. |
|
Insert a new EID keyed value into the map. Inserts a new BID into the map via an EID key. Has no effect if EID is NULL, but BID is permitted to be NULL_ID.
References AMOS::ID_t, insert(), and AMOS::NULL_ID. |
|
Insert a new EID/IID keyed value into the map. Inserts a new BID into the map via both an EID and IID key. Has no effect if *both* EID and IID are NULL, but *one* of them and BID are permitted to be NULL. If EID is NULL but IID is not, then a triple will be inserted into the map, keyed only by the IID. If IID is NULL but EID is not, then a triple will be inserted, keyed only by EID. If neither is NULL, then the triple will be keyed by both. If both are NULL, there is no effect.
References AMOS_THROW_ARGUMENT, empty(), getBuckets(), AMOS::ID_t, AMOS::NULL_ID, and resize(). Referenced by concat(), insert(), read(), and readMessage(). |
|
Lookup the BID associated with an IID key.
References AMOS::ID_t, and AMOS::NULL_ID. |
|
Lookup the BID associated with an EID key.
References AMOS::ID_t, and AMOS::NULL_ID. |
|
Lookup the EID associated with an IID key.
References AMOS::ID_t, and AMOS::NULL_STRING. |
|
Lookup the IID associated with an EID key.
References AMOS::ID_t, and AMOS::NULL_ID. |
|
Assignment (copy) operator. Simply clears the current map and calls insert on everything in source. Does not guarantee that getBuckets( ) will equal source.getBuckets( ) after the assignment. Throws an exception if copy failed due to corrupt source map.
|
|
Read a tab-delimited IDMap record. IDMap NCode and size listed on the first line separated by a single space, followed by one tab-delimited triple per line in the order: bid, iid, eid. One of the stream's error bits will be set on failure.
References clear(), AMOS::Encode(), AMOS::ID_t, insert(), resize(), and AMOS::Size_t. |
|
Reads in data from a Message object. Reads the data contained in a Message object and stores it in the Messagable object. Will not complain if incoming message is of the wrong type, will only try and suck out the fields it recognizes. All previous data in the Messagable object will be cleared or overwritten.
Implements AMOS::IMessagable_t. Definition at line 240 of file IDMap_AMOS.cc. References AMOS_THROW_ARGUMENT, clear(), AMOS::Encode(), exists(), AMOS::F_MAP, AMOS::F_OBJECT, AMOS::F_SIZE, AMOS::ID_t, insert(), AMOS::NCODE_SIZE, resize(), and AMOS::Size_t. |
|
Remove an existing value triple from the map by EID key. Removes an existsing value triple from the map. Has no effect if the key does not exist or is NULL. If EID is associated with an IID, the IID key will also be removed.
References empty(), AMOS::ID_t, and AMOS::NULL_ID. |
|
Remove an existing value triple from the map by IID key. Removes an existsing value triple from the map. Has no effect if the key does not exist or is NULL_ID. If IID is associated with an EID, the EID key will also be removed.
References empty(), AMOS::ID_t, and AMOS::NULL_ID. |
|
Resize the hash table. This will cause the hash to reorganize itself and is not recommended as a frequent operation. If request is larger than max number of buckets the max number of buckets will be used. Otherwise, the resulting number of buckets is only guaranteed to be greater than request. Number of buckets will automatically increase whenever an insert operation causes the number of elements to be >= than number of buckets.
References AMOS_THROW, begin(), clear(), end(), getBuckets(), AMOS::NCode_t, and AMOS::Size_t. Referenced by concat(), IDMap_t(), insert(), read(), and readMessage(). |
|
Set the type of the mapped IDs.
References AMOS::NCode_t. |
|
Write a tab-delimited IDMap record. IDMap NCode and size listed on the first line separated by a single space, followed by one tab-delimited triple per line in the order: bid, iid, eid. One of the stream's error bits will be set on failure.
References begin(), AMOS::Decode(), end(), and AMOS::NL_CHAR. |
|
Writes data to a Message object. Writes the data contained in a Messagable object to a Message object. All previous data in the Message will be cleared or overwritten.
Implements AMOS::IMessagable_t. Definition at line 439 of file IDMap_AMOS.cc. References begin(), clear(), AMOS::Decode(), end(), AMOS::F_MAP, AMOS::F_OBJECT, AMOS::F_SIZE, AMOS::NL_CHAR, AMOS::NULL_NCODE, and AMOS::NULL_STRING. |
|
The NCode type identifier for this object. Definition at line 56 of file IDMap_AMOS.cc. |