Project
Loading...
Searching...
No Matches
ChannelConfigurationPolicyHelpers.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
13#include <functional>
14#include <string>
16
17namespace o2::framework
18{
19
21 [](std::string const&, std::string const&) { return true; };
22
24 const char* name)
25{
26 std::string nameString = name;
27
28 return [nameString](std::string const& producerId, std::string const&) -> bool { return producerId == nameString; };
29}
30
32 const char* name)
33{
34 std::string nameString = name;
35
36 return [nameString](std::string const&, std::string const& consumerId) -> bool { return consumerId == nameString; };
37}
38
40{
41 return [spec](InputChannelSpec& channel) {
42 channel.method = ChannelMethod::Connect;
43 channel.type = ChannelType::Sub;
44 channel.rateLogging = spec.rateLogging;
45 channel.recvBufferSize = spec.recvBufferSize;
46 channel.sendBufferSize = spec.sendBufferSize;
47 channel.ipcPrefix = spec.ipcPrefix;
48 };
49}
50
52{
53 return [spec](OutputChannelSpec& channel) {
54 channel.method = ChannelMethod::Bind;
55 channel.type = ChannelType::Pub;
56 channel.rateLogging = spec.rateLogging;
57 channel.recvBufferSize = spec.recvBufferSize;
58 channel.sendBufferSize = spec.sendBufferSize;
59 channel.ipcPrefix = spec.ipcPrefix;
60 };
61}
62
64{
65 return [spec](InputChannelSpec& channel) {
66 channel.method = ChannelMethod::Connect;
67 channel.type = ChannelType::Pull;
68 channel.rateLogging = spec.rateLogging;
69 channel.recvBufferSize = spec.recvBufferSize;
70 channel.sendBufferSize = spec.sendBufferSize;
71 channel.ipcPrefix = spec.ipcPrefix;
72 };
73}
74
76{
77 return [spec](OutputChannelSpec& channel) {
78 channel.method = ChannelMethod::Bind;
79 channel.type = ChannelType::Push;
80 channel.rateLogging = spec.rateLogging;
81 channel.recvBufferSize = spec.recvBufferSize;
82 channel.sendBufferSize = spec.sendBufferSize;
83 channel.ipcPrefix = spec.ipcPrefix;
84 };
85}
86
88{
89 return [spec](InputChannelSpec& channel) {
90 channel.method = ChannelMethod::Connect;
91 channel.type = ChannelType::Pair;
92 channel.rateLogging = spec.rateLogging;
93 channel.recvBufferSize = spec.recvBufferSize;
94 channel.sendBufferSize = spec.sendBufferSize;
95 channel.ipcPrefix = spec.ipcPrefix;
96 };
97}
98
100{
101 return [spec](OutputChannelSpec& channel) {
102 channel.method = ChannelMethod::Bind;
103 channel.type = ChannelType::Pair;
104 channel.rateLogging = spec.rateLogging;
105 channel.recvBufferSize = spec.recvBufferSize;
106 channel.sendBufferSize = spec.sendBufferSize;
107 channel.ipcPrefix = spec.ipcPrefix;
108 };
109}
110
111} // namespace o2::framework
GLuint const GLchar * name
Definition glcorearb.h:781
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
static PolicyMatcher matchAny
Catch all policy, used by the last rule.
static OutputChannelModifier pushOutput(FairMQChannelConfigSpec const &spec)
Makes the passed output channel bind and push.
std::function< void(InputChannelSpec &spec)> InputChannelModifier
static InputChannelModifier pullInput(FairMQChannelConfigSpec const &spec)
Makes the passed input channel connect and pull.
static OutputChannelModifier pairOutput(FairMQChannelConfigSpec const &spec)
Makes the passed output channel bind and pair.
static InputChannelModifier pairInput(FairMQChannelConfigSpec const &spec)
Makes the passed input channel connect and pair.
std::function< bool(std::string const &producer, std::string const &consumer)> PolicyMatcher
static OutputChannelModifier publishOutput(FairMQChannelConfigSpec const &spec)
Makes the passed output channel bind and subscribe.
std::function< void(OutputChannelSpec &spec)> OutputChannelModifier
static InputChannelModifier subscribeInput(FairMQChannelConfigSpec const &spec)
Makes the passed input channel connect and subscribe.