87 using DummyID = EntryID<DummyEntity>;
127 uint type_cnt = TypedID::type_count();
128 uint elm_cnt = TypedID::element_count();
130 PDum d1 = TypedID::get<DummyEntity> (
"top");
134 CHECK (type_cnt+1 == TypedID::type_count());
139 CHECK (elm_cnt+2 == TypedID::element_count());
141 DummyID idu = TypedID::getID<DummyEntity> (
"up");
143 CHECK (
"up" == idu.getSym());
152 PInv inventory = asset::Meta::create (Category (META,
"typed-id-test-dummy"));
154 CHECK (0 == inventory->size());
157 CHECK (AssetManager::instance().known (inventory->getID()));
163 CHECK (2 == inventory->size());
165 for_each (inventory->all(), show<BareEntryID> );
173 cout <<
"---" << o << endl;
184 CHECK (1 == top.use_count());
185 CHECK (1 == bot.use_count());
187 VERIFY_ERROR (MISSING_INSTANCE, TypedID::get<DummyEntity> (
"top"));
190 top->registerInstance (top);
191 TypedID::registerInstance<DummyEntity> (bot);
193 PDum d1 = TypedID::get<DummyEntity> (
"top");
197 CHECK (2 == top.use_count());
198 CHECK (1 == bot.use_count());
200 d1 = TypedID::get<DummyEntity> (
"bottom");
204 CHECK (1 == top.use_count());
205 CHECK (2 == bot.use_count());
207 for_each (TypedID::allInstances<DummyEntity>(), show<DummyEntity> );
220 CHECK (2 == TypedID::entry_count<DummyEntity>());
223 CHECK (1 == TypedID::entry_count<DummyEntity>());
224 CHECK (bea == *(TypedID::allInstances<DummyEntity>()));
227 CHECK (0 == TypedID::entry_count<DummyEntity>());
228 CHECK (! (TypedID::get<DummyEntity>(
"beauty")));
229 CHECK (isnil (TypedID::allInstances<DummyEntity>()));
Steam-Layer Interface: Asset Lookup and Organisation.
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Token or Atom with distinct identity.
void verifyAutomaticCleanup()
void verifyRegistration()
void verifyInstanceAccess()
void verifyAssetFrontend()
Bare symbolic and hash ID used for accounting of asset like entries.
Exposing an ID registration cluster as a Meta Asset.
Implementation namespace for support and library code.
Adapter for using this type as a primary type within Lumiera's Steam-Layer.
Lumiera public interface.
Namespace of Session and user visible high-level objects.
Steam-Layer implementation namespace root.
Test runner and basic definitions for tests.
disable_if< can_IterForEach< Container >, FUN > for_each(Container const &coll, FUN doIt)
operate on all elements of a STL container.
bool isnil(lib::time::Duration const &dur)
Customised refcounting smart pointer.
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
Marker types to indicate a literal string and a Symbol.
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.
Frontend for a registration service to associate object identities, symbolic identifiers and types.
Perform operations "for each element" of a collection.