33 using std::placeholders::_1;
56 cout <<
"fabricate("<<base<<
", "<<offset<<
")" << endl;
58 product->
n_ = base*offset;
100 CHECK (
sizeof(theFact) ==
sizeof(DispatcherMap));
102 typedef TestFactory::Product PP;
104 PP p1 = theFact(ONE, 2);
105 PP p2 = theFact(TWO, 3);
106 CHECK (1*2 == p1->n_);
107 CHECK (2*3 == p2->n_);
Factory for creating a family of objects by ID.
void defineProduction(ID id, FUNC &&fun)
to set up a production line, associated with a specific ID
Framework for building a configurable factory, to generate families of related objects.
std::map< prodID, function< Num(int)> > DispatcherMap
Num * fabricateNumberz(int base, int offset)
dummy "factory" function to be invoked
string showSizeof(size_t siz, string name)
for printing sizeof().
Implementation namespace for support and library code.
Test runner and basic definitions for tests.
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
Wrapper taking ownership, by wrapping into smart-ptr.
A collection of frequently used helper functions to support unit testing.