|
const_iterator | cbegin () const |
| Returns a const iterator pointing to the first element in the map. More...
|
|
const_iterator | cend () const |
| Returns a const iterator referring to the past-the-end element in the map. More...
|
|
| NCollection_Map (const Standard_Integer NbBuckets=1, const Handle< NCollection_BaseAllocator > &theAllocator=0L) |
| Constructor. More...
|
|
| NCollection_Map (const NCollection_Map &theOther) |
| Copy constructor. More...
|
|
void | Exchange (NCollection_Map &theOther) |
| Exchange the content of two maps without re-allocations. Notice that allocators will be swapped as well! More...
|
|
NCollection_Map & | Assign (const NCollection_Map &theOther) |
| Assign. This method does not change the internal allocator. More...
|
|
NCollection_Map & | operator= (const NCollection_Map &theOther) |
| Assign operator. More...
|
|
void | ReSize (const Standard_Integer N) |
| ReSize. More...
|
|
Standard_Boolean | Add (const TheKeyType &K) |
| Add. More...
|
|
const TheKeyType & | Added (const TheKeyType &K) |
| Added: add a new key if not yet in the map, and return reference to either newly added or previously existing object. More...
|
|
Standard_Boolean | Contains (const TheKeyType &K) const |
| Contains. More...
|
|
Standard_Boolean | Remove (const TheKeyType &K) |
| Remove. More...
|
|
void | Clear (const Standard_Boolean doReleaseMemory=Standard_True) |
| Clear data. If doReleaseMemory is false then the table of buckets is not released and will be reused. More...
|
|
void | Clear (const Handle< NCollection_BaseAllocator > &theAllocator) |
| Clear data and reset allocator. More...
|
|
| ~NCollection_Map (void) |
| Destructor. More...
|
|
Standard_Integer | Size (void) const |
| Size. More...
|
|
|
Standard_Boolean | IsEqual (const NCollection_Map &theOther) const |
|
Standard_Boolean | Contains (const NCollection_Map &theOther) const |
|
void | Union (const NCollection_Map &theLeft, const NCollection_Map &theRight) |
| Sets this Map to be the result of union (aka addition, fuse, merge, boolean OR) operation between two given Maps The new Map contains the values that are contained either in the first map or in the second map or in both. All previous content of this Map is cleared. This map (result of the boolean operation) can also be passed as one of operands. More...
|
|
Standard_Boolean | Unite (const NCollection_Map &theOther) |
| Apply to this Map the boolean operation union (aka addition, fuse, merge, boolean OR) with another (given) Map. The result contains the values that were previously contained in this map or contained in the given (operand) map. This algorithm is similar to method Union(). Returns True if contents of this map is changed. More...
|
|
void | Intersection (const NCollection_Map &theLeft, const NCollection_Map &theRight) |
| Sets this Map to be the result of intersection (aka multiplication, common, boolean AND) operation between two given Maps. The new Map contains only the values that are contained in both map operands. All previous content of this Map is cleared. This same map (result of the boolean operation) can also be used as one of operands. More...
|
|
Standard_Boolean | Intersect (const NCollection_Map &theOther) |
| Apply to this Map the intersection operation (aka multiplication, common, boolean AND) with another (given) Map. The result contains only the values that are contained in both this and the given maps. This algorithm is similar to method Intersection(). Returns True if contents of this map is changed. More...
|
|
void | Subtraction (const NCollection_Map &theLeft, const NCollection_Map &theRight) |
| Sets this Map to be the result of subtraction (aka set-theoretic difference, relative complement, exclude, cut, boolean NOT) operation between two given Maps. The new Map contains only the values that are contained in the first map operands and not contained in the second one. All previous content of this Map is cleared. More...
|
|
Standard_Boolean | Subtract (const NCollection_Map &theOther) |
| Apply to this Map the subtraction (aka set-theoretic difference, relative complement, exclude, cut, boolean NOT) operation with another (given) Map. The result contains only the values that were previously contained in this map and not contained in this map. This algorithm is similar to method Subtract() with two operands. Returns True if contents of this map is changed. More...
|
|
void | Difference (const NCollection_Map &theLeft, const NCollection_Map &theRight) |
| Sets this Map to be the result of symmetric difference (aka exclusive disjunction, boolean XOR) operation between two given Maps. The new Map contains the values that are contained only in the first or the second operand maps but not in both. All previous content of this Map is cleared. This map (result of the boolean operation) can also be used as one of operands. More...
|
|
Standard_Boolean | Differ (const NCollection_Map &theOther) |
| Apply to this Map the symmetric difference (aka exclusive disjunction, boolean XOR) operation with another (given) Map. The result contains the values that are contained only in this or the operand map, but not in both. This algorithm is similar to method Difference(). Returns True if contents of this map is changed. More...
|
|
Standard_Integer | NbBuckets () const |
| NbBuckets. More...
|
|
Standard_Integer | Extent () const |
| Extent. More...
|
|
Standard_Boolean | IsEmpty () const |
| IsEmpty. More...
|
|
void | Statistics (Standard_OStream &S) const |
| Statistics. More...
|
|
template<class TheKeyType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
class NCollection_Map< TheKeyType, Hasher >
Purpose: Single hashed Map. This Map is used to store and retrieve keys in linear time.
The ::Iterator class can be used to explore the content of the map. It is not wise to iterate and modify a map in parallel.
To compute the hashcode of the key the function HashCode must be defined in the global namespace
To compare two keys the function IsEqual must be defined in the global namespace.
The performance of a Map is conditionned by its number of buckets that should be kept greater to the number of keys. This map has an automatic management of the number of buckets. It is resized when the number of Keys becomes greater than the number of buckets.
If you have a fair idea of the number of objects you can save on automatic resizing by giving a number of buckets at creation or using the ReSize method. This should be consider only for crucial optimisation issues.