17using out_t = std::tuple<float, float>;
27 :
is2f_merger_base( name, pSvcLocator, { {
"InputInts", {
"firstInt",
"secondInt" } }, {
"Scale",
"scale" } },
28 {
"Output",
"scaledSum" } ) {}
32 info() <<
"input locations: " << inputLocation( 0 ) <<
", " << inputLocation<1>() <<
endmsg;
33 info() <<
"input location sizes: " << inputLocationSize( 0 ) <<
", " << inputLocationSize( 1 ) <<
endmsg;
35 info() <<
"i: " << i <<
" ";
38 info() <<
"scale: " << scale <<
endmsg;
48 { {
"InputInts", {
"firstInt",
"secondInt" } }, {
"Scale",
"scale" } } ) {}
52 for (
auto i : is ) { sum += i; }
53 info() <<
"consumed scaled sum: " << sum * scale <<
" from " << inputLocation( 0 ) <<
" and " << inputLocation<1>()
62 :
is2ff_merger_base( name, pSvcLocator, {
"InputInts", {
"firstInt",
"secondInt" } },
63 { {
"O1",
"firstFloat" }, {
"O2",
"secondFloat" } } ) {}
69 info() <<
"i: " << i <<
" ";
83 { {
"InputInts", {
"firstInt",
"secondInt" } }, {
"Scale",
"scale" } },
84 { {
"O1",
"firstFloat" }, {
"O2",
"secondFloat" } } ) {}
87 float sum = 0, product = 1;
90 info() <<
"i: " << i <<
" ";
94 info() <<
"scale: " << scale <<
endmsg;
95 return { sum * scale, product * scale };
104 { {
"O1",
"firstFloat" }, {
"O2",
"secondFloat" } } ) {}
107 float f1 = 1, f2 = 1;
109 for (
auto i : is ) {
110 info() <<
"i: " << i <<
" ";
115 auto filter_passed = f1 > 10;
116 info() <<
"Filter " << ( filter_passed ?
"passed" :
"failed" ) <<
endmsg;
117 return { filter_passed, f1, f2 };
126 { {
"InputInts", {
"firstInt",
"secondInt" } }, {
"Scale",
"scale" } },
127 { {
"O1",
"firstFloat" }, {
"O2",
"secondFloat" } } ) {}
130 float product = 1, inverse = 1;
132 for (
auto i : is ) {
133 info() <<
"i: " << i <<
" ";
137 info() <<
"scale: " << scale <<
endmsg;
140 auto filter_passed = product > 10;
141 info() <<
"Filter " << ( filter_passed ?
"passed" :
"failed" ) <<
endmsg;
142 return { filter_passed, product, inverse };
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
#define DECLARE_COMPONENT(type)
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
details::MergingTransformer< Signature, Traits_, details::isLegacy< Traits_ > > MergingTransformer
details::MergingTransformer< Signature, Traits_, details::isLegacy< Traits_ > > MergingConsumer
is2f_merger_with_scalar(std::string const &name, ISvcLocator *pSvcLocator)
float operator()(ints const &is, int const &scale) const override
is2ff_merger_filter_with_scalar(std::string const &name, ISvcLocator *pSvcLocator)
filter_out_t operator()(ints const &is, int const &scale) const override
filter_out_t operator()(ints const &is) const override
is2ff_merger_filter(std::string const &name, ISvcLocator *pSvcLocator)
out_t operator()(ints const &is, int const &scale) const override
is2ff_merger_with_scalar(std::string const &name, ISvcLocator *pSvcLocator)
out_t operator()(ints const &is) const override
is2ff_merger(std::string const &name, ISvcLocator *pSvcLocator)
void operator()(ints const &is, int const &scale) const override
is_merger_consumer_with_scalar(std::string const &name, ISvcLocator *pSvcLocator)