51 for (
auto it = mMessages.rbegin(); it != mMessages.rend(); ++it) {
52 const auto* hd = (*it)->header();
53 if (hd->dataOrigin == spec.
origin && hd->dataDescription == spec.
description && hd->subSpecification == spec.
subSpec) {
57 for (
auto it = mScheduledMessages.rbegin(); it != mScheduledMessages.rend(); ++it) {
58 const auto* hd = (*it)->header();
59 if (hd->dataOrigin == spec.
origin && hd->dataDescription == spec.
description && hd->subSpecification == spec.
subSpec) {
144 auto const* header =
message->header();
145 if (header ==
nullptr) {
146 throw std::logic_error(
"No valid header message found");
148 mScheduledMessages.emplace_back(std::move(
message));
149 if (mDispatchControl.
dispatch !=
nullptr) {
151 if (mDispatchControl.
trigger ==
nullptr || mDispatchControl.
trigger(*header)) {
152 std::vector<fair::mq::Parts> outputsPerChannel;
154 for (
auto&
message : mScheduledMessages) {
155 fair::mq::Parts parts =
message->finalize();
157 assert(parts.Size() == 2);
158 for (
auto& part : parts) {
163 auto& parts = outputsPerChannel[ci];
164 if (parts.Size() == 0) {
170 mScheduledMessages.clear();
o2::header::Stack * findMessageHeaderStack(const Output &spec)
static constexpr int DefaultChannelIndex
void schedule(Messages::value_type &&message)
int countDeviceOutputs(bool excludeDPLOrigin=false) const
int64_t addToCache(std::unique_ptr< fair::mq::Message > &message)
o2::header::DataHeader * findMessageHeader(const Output &spec)
return the headers of the 1st (from the end) matching message checking first in mMessages then in mSc...
std::unique_ptr< fair::mq::Message > cloneFromCache(int64_t id) const
fair::mq::MessagePtr createMessage(RouteIndex routeIndex, int index, size_t size)
o2::framework::DataProcessingHeader * findMessageDataProcessingHeader(const Output &spec)
void pruneFromCache(int64_t id)