25#include <boost/lexical_cast.hpp>
33 using boost::lexical_cast;
48 virtual operator string ()
const =0;
66 operator string()
const override
68 return "Impl-"+lexical_cast<string> (ii);
108 cout << theFact(ONE) << endl;
109 cout << theFact(TWO) << endl;
110 cout << theFact(THR) << endl;
111 cout << theFact(FOU) << endl;
116 CHECK (isSameObject(o1,o2));
118 TestFactory anotherFact;
119 CHECK (isnil (anotherFact));
122 TestFactory::Singleton<Implementation<ONE>> anotherSingletonHolder (anotherFact,ONE);
124 CHECK (isSameObject(o2,o3));
Convenience shortcut for automatically setting up a production line, to fabricate a singleton instanc...
Factory for creating a family of objects by ID.
Target object to be instantiated as Singleton Allocates a variable amount of additional heap memory a...
Framework for building a configurable factory, to generate families of related objects.
TestFactory theFact
Factory instance for the tests...
string showSizeof(size_t siz, string name)
for printing sizeof().
Implementation namespace for support and library code.
basic_ostream< char, char_traits< char > > ostream
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.
bool isnil(lib::time::Duration const &dur)
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
A collection of frequently used helper functions to support unit testing.
#define VERIFY_ERROR(ERROR_ID, ERRONEOUS_STATEMENT)
Macro to verify that a statement indeed raises an exception.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...