43 auto&
x = ctx.outputs().make<
XYZ>(
Output{
"TST",
"POINT", 0});
45 auto&
y = ctx.outputs().make<
XYZ>(
Output{
"TST",
"POINTS", 0}, 1000);
47 y[999] =
XYZ{1, 2, 3};
49 auto&
h = ctx.outputs().make<TH1F>(
Output{
"TST",
"HISTO"},
"h",
"test", 100, -10., 10.);
51 std::vector<XYZ>
v{1000};
53 v[999] =
XYZ{1, 2, 3};
54 ctx.outputs().snapshot(
Output{
"TST",
"VECTOR"},
v);
55 v[999] =
XYZ{2, 3, 4};
64 ctx.outputs().snapshot(
Output{
"TST",
"LINEARIZED"}, p);
65 v[999] =
XYZ{3, 4, 5};
67 TNamed named(
"named",
"a named test object");
68 ctx.outputs().snapshot(
Output{
"TST",
"OBJECT"}, named);
77 InputSpec{
"linearized",
"TST",
"LINEARIZED"},
84 auto h = ctx.inputs().get<TH1F*>(
"histo");
86 XYZ const&
x = ctx.inputs().get<
XYZ>(
"point");
88 auto ref1 = ctx.inputs().get(
"points");
89 gsl::span<XYZ>
c = DataRefUtils::as<XYZ>(ref1);
93 assert(
c[999].
x == 1);
94 assert(
c[999].
y == 2);
95 assert(
c[999].
z == 3);
96 auto ref2 = ctx.inputs().get(
"vector");
97 gsl::span<XYZ>
c2 = DataRefUtils::as<XYZ>(ref2);
100 assert(
c2[0].
z == 3);
101 assert(
c2[999].
x == 1);
102 assert(
c2[999].
y == 2);
103 assert(
c2[999].
z == 3);
104 auto ref3 = ctx.inputs().get(
"linearized");
105 gsl::span<XYZ> c3 = DataRefUtils::as<XYZ>(ref3);
106 assert(c3[0].
x == 1);
107 assert(c3[0].
y == 2);
108 assert(c3[0].
z == 3);
109 assert(c3[999].
x == 2);
110 assert(c3[999].
y == 3);
111 assert(c3[999].
z == 4);
112 ctx.services().get<
ControlService>().readyToQuit(QuitRequest::All);
113 auto o = ctx.inputs().get<TNamed*>(
"object");
114 assert(strcmp(
o->GetName(),
"named") == 0 &&
115 strcmp(
o->GetTitle(),
"a named test object") == 0);