This is the reference documentation of namespace alib::containers
, which holds types of module ALib Containers, which in turn is part of the ALib C++ Library.
Extensive documentation for this module is provided with the Programmer's Manual of this module.
Nested Namespaces: | |
namespace | detail |
Detail namespace of module ALib Containers. | |
Type Index: | |
class | FixedCapacityVector |
class | HashTable |
class | List |
class | LRUCacheTable |
class | SharedPtr |
class | SharedVal |
class | StringTree |
struct | StringTreeNamesAlloc |
struct | StringTreeNamesDynamic |
struct | StringTreeNamesStatic |
struct | TIdentDescriptor |
struct | TPairDescriptor |
struct | TSubsetKeyDescriptor |
Type Definition Index: | |
template<typename T , std::size_t TSize, typename TCompare = std::less<T>> | |
using | FixedSizePriorityQueue = std::priority_queue< T, FixedCapacityVector<T, TSize>, TCompare> |
template<typename TAllocator , typename TKey , typename TMapped , typename THash = std::hash <TKey>, typename TEqual = std::equal_to<TKey>, lang::Caching THashCaching = lang::Caching::Auto, Recycling TRecycling = Recycling::Private> | |
using | HashMap |
template<typename TAllocator , typename T , typename THash = std::hash <T>, typename TEqual = std::equal_to<T>, lang::Caching THashCaching = lang::Caching::Auto, Recycling TRecycling = Recycling::Private> | |
using | HashSet |
template<typename TAllocator , typename TKey , typename TMapped , typename THash = std::hash <TKey>, typename TEqual = std::equal_to<TKey>> | |
using | LRUCacheMap |
template<typename TAllocator , typename T , typename THash = std::hash <T>, typename TEqual = std::equal_to<T>> | |
using | LRUCacheSet |
Enumeration Index: | |
enum class | Recycling { None , Private , Shared } |
Function Index: | |
template<typename THashtable > | |
AString | DbgDumpDistribution (const THashtable &hashtable, bool detailedBucketList) |
template<typename THashtable > | |
AString | DbgDumpHashtable (const THashtable &hashtable) |
template<typename THashtable > | |
std::tuple< double, double, integer, integer > | DbgGetHashTableDistribution (const THashtable &hashtable) |
Variable Index: | |
ALIB_API uinteger | DBG_STATS_STRINGTREE_NAME_OVERFLOWS = 0 |
ALIB_API uinteger | DBG_STATS_STRINGTREE_NAMES = 0 |
using FixedSizePriorityQueue = std::priority_queue< T, FixedCapacityVector<T, TSize>, TCompare> |
Type alias which denotes a std::priority_queue
using a FixedCapacityVector as its underlying container type.
Definition at line 103 of file fixedcapacityvector.hpp.
using HashMap |
This type definition is a shortcut to HashTable, usable if data stored in the container does not include a key-portion, and thus the key to the data is to be separately defined.
To achieve this, this type definition aggregates types TKey and TMapped into a std::pair<TKey,TMapped>
. This is done using special value descriptor type TPairDescriptor.
TAllocator | The allocator type to use, as prototyped with Allocator. |
TKey | The type of the key-portion of the inserted data. This type is published as HashTable::KeyType. |
TMapped | The type of the mapped-portion of the inserted data. This type is published as HashTable::MappedType. |
THash | The hash functor applicable to TKey. Defaults to std::hash<TKey> and is published as HashTable::HashType. |
TEqual | The comparison functor on TKey. Defaults to std::equal_to<TKey> and is published as HashTable::EqualType. |
THashCaching | Determines if hash codes are cached when elements are inserted. Defaults to Caching::Auto, which enables caching if std::is_arithmetic<TKey>::value evaluates to false . |
TRecycling | Denotes the type of recycling that is to be performed. Possible values are None, Private (the default), or Shared. |
Definition at line 2632 of file hashtable.hpp.
using HashSet |
This type definition is a shortcut to HashTable, usable if the full portion of the data stored in the container is used for the comparison of values.
TAllocator | The allocator type to use, as prototyped with Allocator. |
T | The element type stored with this container. This type is published as HashTable::StoredType and type definition HashTable::KeyType becomes a synonym. |
THash | The hash functor applicable to T. Defaults to std::hash<T> and is published as HashTable::HashType. |
TEqual | The comparison functor on T. Defaults to std::equal_to<T> and is published as HashTable::EqualType. |
THashCaching | Determines if hash codes are cached when elements are inserted. Defaults to Caching::Auto, which enables caching if std::is_arithmetic<StoredType>::value evaluates to false . |
TRecycling | Denotes the type of recycling that is to be performed. Possible values are None, Private (the default), or Shared. |
Definition at line 2585 of file hashtable.hpp.
using LRUCacheMap |
This type definition is a shortcut to LRUCacheTable, usable if data stored in the container does not include a key-portion, and thus the key to the data retrievable from the cache has to be separately defined.
To achieve this, this type definition aggregates types TKey and TMapped into a std::pair<TKey,TMapped>
. This is done using special value descriptor type TPairDescriptor.
TAllocator | The allocator type to use, as prototyped with Allocator. |
TKey | The type of the key-portion of the inserted data. This type is published as LRUCacheTable::KeyType. |
TMapped | The type of the mapped-portion of the inserted data. This type is published as LRUCacheTable::MappedType. |
THash | The hash functor applicable to TKey. Defaults to std::hash<TKey> and is published as LRUCacheTable::HashType. |
TEqual | The comparison functor on TKey. Defaults to std::equal_to<TKey> and is published as LRUCacheTable::EqualType. |
Definition at line 671 of file lrucachetable.hpp.
using LRUCacheSet |
This type definition is a shortcut to LRUCacheTable, usable if the full portion of the data stored in the container is used for the comparison of values.
TAllocator | The allocator type to use, as prototyped with Allocator. |
T | The element type stored with this container. This type is published as LRUCacheTable::StoredType and type definition LRUCacheTable::KeyType becomes a synonym. |
THash | The hash functor applicable to T. If void is given, no hashing is performed.Defaults to std::hash<T> and is published as LRUCacheTable::HashType. |
TEqual | The comparison functor on TKey. Defaults to std::equal_to<TKey> and is published as LRUCacheTable::EqualType. |
Definition at line 707 of file lrucachetable.hpp.
|
strong |
This enumeration contains three elements, which denote the type of node-recycling that a container instantiation is deemed to perform. One of these elements is to be set as the value for a corresponding template parameter named TRecycling found in container types of this module.
In the case Shared is given, the container type will expose a type definition named SharedRecyclerType, which can be used to define the external shared recycler object. This object has then to be passed to the constructor of the container instance.
Enumerator | |
---|---|
None | < Denotes that no recycling should be performed. |
Private | < Denotes private recycling. This is usaully the default value. |
Shared | < Denotes shared recycling. |
Definition at line 31 of file recycling.hpp.
|
inline |
Invokes method DbgGetHashTableDistribution and creates human-readable output, ready to be logged or written to the console.
THashtable | A specification of templated type HashTable. Deduced by the compiler by given parameter hashtable. |
hashtable | The hashtable to investigate on. |
detailedBucketList | If true is given, for each bucket a line with its size value and a "size bar" is written. |
Definition at line 2418 of file hashtable.hpp.
|
inline |
Dumps all values of the hash table sorted by buckets. Besides other scenarios of usage, this method allows investigating into how the keys of the table are distributed in the buckets, and thus learn something about the hash algorithm used.
Before invoking this method, specializations of T_Append have to be made and furthermore, boxed values of the type have to be "made appendable" to instances of type AString. The latter is rather simple, if done using this macro during bootstrap.
THashtable | A specification of templated type HashTable. Deduced by the compiler by given parameter hashtable. |
hashtable | The hashtable to investigate on. |
Definition at line 2504 of file hashtable.hpp.
|
inline |
Generates statistics on the given hash table. The meanings of the returned tuple are:
1.0
denotes the gaussian distribution which indicates perfect randomness. However, this value is unlikely (impossible) to be achieved.THashtable | A specification of templated type HashTable. Deduced by the compiler by given parameter hashtable. |
hashtable | The hashtable to investigate on. |
Definition at line 2363 of file hashtable.hpp.
Statistic variable increased by StringTreeNamesDynamic with every creation of a node whose name exceeds the internal string buffer size. With process creation the variable is 0
. A user may reset the variable to inspect percentages of name overflows during certain operations. The variable is not thread safe and used by any instance of class StringTree which uses node handler StringTreeNamesDynamic.
Definition at line 94 of file hashtablebase.cpp.
Statistic variable increased by StringTreeNamesDynamic with every creation of a node. With process creation the variable is 0
. A user may reset the variable to inspect percentages of name overflows during certain operations. The variable is not thread safe and used by any instance of class StringTree which uses node handler StringTreeNamesDynamic.
Definition at line 93 of file hashtablebase.cpp.