Skip to content

Commit

Permalink
Add Transformer compilation test for stream producers
Browse files Browse the repository at this point in the history
  • Loading branch information
makortel committed Jan 3, 2025
1 parent ab76956 commit 9fb7223
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions FWCore/Framework/test/stream_producer_t.cppunit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,44 @@ class testStreamProducer : public CppUnit::TestFixture {
m_globalEndLuminosityBlockSummaryCalled = false;
}
};

class TransformProd : public edm::stream::EDProducer<edm::Transformer> {
public:
TransformProd(edm::ParameterSet const&) {
token_ = produces<float>();
registerTransform(token_, [](float iV) { return int(iV); });
}

void produce(edm::Event& iEvent, edm::EventSetup const&) final {
//iEvent.emplace(token_, 3.625);
}

private:
edm::EDPutTokenT<float> token_;
};

class TransformAsyncProd : public edm::stream::EDProducer<edm::Transformer> {
public:
struct IntHolder {
IntHolder() : value_(0) {}
IntHolder(int iV) : value_(iV) {}
int value_;
};
TransformAsyncProd(edm::ParameterSet const&) {
token_ = produces<float>();
registerTransformAsync(
token_,
[](float iV, edm::WaitingTaskWithArenaHolder iHolder) { return IntHolder(iV); },
[](IntHolder iWaitValue) { return iWaitValue.value_; });
}

void produce(edm::Event& iEvent, edm::EventSetup const&) final {
//iEvent.emplace(token_, 3.625);
}

private:
edm::EDPutTokenT<float> token_;
};
};
unsigned int testStreamProducer::BasicProd::m_count = 0;
unsigned int testStreamProducer::GlobalProd::m_count = 0;
Expand Down

0 comments on commit 9fb7223

Please sign in to comment.