Coverage Report

Created: 2026-06-14 06:47

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libzmq/src/gather.cpp
Line
Count
Source
1
/* SPDX-License-Identifier: MPL-2.0 */
2
3
#include "precompiled.hpp"
4
#include "macros.hpp"
5
#include "gather.hpp"
6
#include "err.hpp"
7
#include "msg.hpp"
8
#include "pipe.hpp"
9
10
zmq::gather_t::gather_t (class ctx_t *parent_, uint32_t tid_, int sid_) :
11
0
    socket_base_t (parent_, tid_, sid_, true)
12
0
{
13
0
    options.type = ZMQ_GATHER;
14
0
}
15
16
zmq::gather_t::~gather_t ()
17
0
{
18
0
}
19
20
void zmq::gather_t::xattach_pipe (pipe_t *pipe_,
21
                                  bool subscribe_to_all_,
22
                                  bool locally_initiated_)
23
0
{
24
0
    LIBZMQ_UNUSED (subscribe_to_all_);
25
0
    LIBZMQ_UNUSED (locally_initiated_);
26
27
0
    zmq_assert (pipe_);
28
0
    _fq.attach (pipe_);
29
0
}
30
31
void zmq::gather_t::xread_activated (pipe_t *pipe_)
32
0
{
33
0
    _fq.activated (pipe_);
34
0
}
35
36
void zmq::gather_t::xpipe_terminated (pipe_t *pipe_)
37
0
{
38
0
    _fq.pipe_terminated (pipe_);
39
0
}
40
41
int zmq::gather_t::xrecv (msg_t *msg_)
42
0
{
43
0
    int rc = _fq.recvpipe (msg_, NULL);
44
45
    // Drop any messages with more flag
46
0
    while (rc == 0 && msg_->flags () & msg_t::more) {
47
        // drop all frames of the current multi-frame message
48
0
        rc = _fq.recvpipe (msg_, NULL);
49
50
0
        while (rc == 0 && msg_->flags () & msg_t::more)
51
0
            rc = _fq.recvpipe (msg_, NULL);
52
53
        // get the new message
54
0
        if (rc == 0)
55
0
            rc = _fq.recvpipe (msg_, NULL);
56
0
    }
57
58
0
    return rc;
59
0
}
60
61
bool zmq::gather_t::xhas_in ()
62
0
{
63
0
    return _fq.has_in ();
64
0
}