24#include <unordered_map>
78 buildHashtable<TestDB, TestDB, TestB::UseEmbeddedHash>();
92 CHECK (
sizeof (idDB1) ==
sizeof (idDA) );
96 CHECK (idDA == bb.
getID() );
97 CHECK (idDB1 == idDB2 );
119 CHECK (idOrig == idCopy);
123 template<
class KEY,
class VAL,
class HashFunc>
127 typedef std::unordered_map<KEY, VAL, HashFunc> Hashtable;
131 VAL o1; KEY key1 (o1);
132 VAL o2; KEY key2 (o2);
133 VAL o3; KEY key3 (o3);
139 CHECK (!isSameObject (o1, tab[key1]));
140 CHECK (!isSameObject (o2, tab[key2]));
141 CHECK (!isSameObject (o3, tab[key3]));
143 CHECK (o1.getID() == tab[key1].getID());
144 CHECK (o2.getID() == tab[key2].getID());
145 CHECK (o3.getID() == tab[key3].getID());
147 CHECK (o1.getID() != tab[key2].getID());
148 CHECK (o1.getID() != tab[key3].getID());
149 CHECK (o2.getID() != tab[key3].getID());
Hash implementation based on a lumiera unique object id (LUID) When invoking the default ctor,...
void checkBasicProperties()
A template for generating hash based ID tags carrying compile-time type info.
unsigned char lumiera_uid[16]
storage for a Lumiera unique ID, based on a 128bit random number
void lumiera_uid_copy(lumiera_uid *dest, lumiera_uid *src)
Copy an luid.
HashIndexed< TestB, hash::LuidH > Mixin
Base class to mix in the hash ID facility.
Implementation namespace for support and library code.
Test runner and basic definitions for tests.
bool isSameObject(A const &a, B const &b)
compare plain object identity, based directly on the referee's memory identities.
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
generic hash based ID, corresponding to the base class BA
Hash based ID, typed to a specific subclass of BA.
trivial hash functor using the ID as hash
A Mixin to add a private ID type to the target class, together with storage to hold an instance of th...
friend bool operator==(HashIndexed const &hal, HashIndexed const &har)
equality comparison delegated to the ID implementation
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...