27 lines
811 B
C++
27 lines
811 B
C++
// Copyright (2019-2022) Paul Scherrer Institute
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#include "JFJochWriterGroupClient.h"
|
|
|
|
void JFJochWriterGroupClient::AddClient(const std::string &addr) {
|
|
clients.emplace_back();
|
|
clients[clients.size() - 1].Connect(addr);
|
|
}
|
|
|
|
void JFJochWriterGroupClient::Start(const std::vector<std::string> &zmq_push_addr, int64_t series_id) {
|
|
for (int i = 0; i < std::min(zmq_push_addr.size(), clients.size()); i++)
|
|
clients[i].Start(zmq_push_addr[i], series_id);
|
|
}
|
|
|
|
std::vector<JFJochProtoBuf::WriterOutput> JFJochWriterGroupClient::Stop() {
|
|
std::vector<JFJochProtoBuf::WriterOutput> ret;
|
|
for (auto &i: clients)
|
|
ret.push_back(i.Stop());
|
|
return ret;
|
|
}
|
|
|
|
void JFJochWriterGroupClient::Abort() {
|
|
for (auto &i: clients)
|
|
i.Abort();
|
|
}
|