Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 41 of file test_namedfactory.cxx.
45 make_SomeConcrete_factory();
47 auto ins = WireCell::Factory::lookup<ISomeComponent>(
"SomeConcrete");
48 AssertMsg(ins,
"Failed to lookup 'SomeConcrete' with interface 'ISomeComponent'");
49 info(
"Got SomeConcrete @ {:p}", (
void*)ins.get());
50 info(
"Got bogus @ {:p}", (
void*)std::shared_ptr<ISomeComponent>().
get());
55 auto should_fail = WireCell::Factory::lookup<ISomeComponent>(
"NothingNamedThis");
59 info(
"^^^ Successfully failed to lookup a nonexistent component");
63 info(
"Should not hear anything from this failed find_tn");
64 std::shared_ptr<ISomeComponent>
ptr 65 = WireCell::Factory::find_maybe_tn<ISomeComponent>(
"SomeConcrete:doesnotexist");
66 AssertMsg(ptr==
nullptr,
"Got non null for nonexistent named component");
67 info(
"Success. Next, 'find' should be successful");
68 std::shared_ptr<ISomeComponent> ptr2
69 = WireCell::Factory::find_maybe_tn<ISomeComponent>(
"SomeConcrete");
70 debug(
"Got ptr2 @ {:p}", (
void*)ptr2.get());
71 AssertMsg(ptr2 !=
nullptr,
"Got null for existing component");
void log(source_loc source, level::level_enum lvl, const char *fmt, const Args &...args)