Project
Loading...
Searching...
No Matches
StringContext.h
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#ifndef O2_FRAMEWORK_STRINGCONTEXT_H_
12#define O2_FRAMEWORK_STRINGCONTEXT_H_
13
17#include <vector>
18#include <string>
19#include <memory>
20
21#include <fairmq/FwdDecls.h>
22
23namespace o2::framework
24{
25
30{
31 public:
33
35 : mProxy(proxy)
36 {
37 }
38
39 struct MessageRef {
40 std::unique_ptr<fair::mq::Message> header;
41 std::unique_ptr<std::string> payload;
43 };
44
45 using Messages = std::vector<MessageRef>;
46
47 void addString(std::unique_ptr<fair::mq::Message> header,
48 std::unique_ptr<std::string> s,
49 RouteIndex routeIndex);
50
51 Messages::iterator begin()
52 {
53 return mMessages.begin();
54 }
55
56 Messages::iterator end()
57 {
58 return mMessages.end();
59 }
60
61 size_t size()
62 {
63 return mMessages.size();
64 }
65
66 void clear();
67
68 private:
69 FairMQDeviceProxy& mProxy;
70 Messages mMessages;
71};
72
73} // namespace o2::framework
74#endif // O2_FRAMEWORK_STRINGCONTEXT_H_
StringContext(FairMQDeviceProxy &proxy)
Messages::iterator end()
void addString(std::unique_ptr< fair::mq::Message > header, std::unique_ptr< std::string > s, RouteIndex routeIndex)
std::vector< MessageRef > Messages
static constexpr ServiceKind service_kind
Messages::iterator begin()
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
ServiceKind
The kind of service we are asking for.
std::unique_ptr< fair::mq::Message > header
std::unique_ptr< std::string > payload