• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dedicate-project / beast / 83ba6ee4-64d8-4300-bcbc-007a3bb86324

pending completion
83ba6ee4-64d8-4300-bcbc-007a3bb86324

Pull #9

circleci

fairlight1337
Large block of Doxygen comments added
Pull Request #9: Adding pipeline applications

1197 of 1197 new or added lines in 21 files covered. (100.0%)

2837 of 3042 relevant lines covered (93.26%)

13117.4 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.37
/src/pipe.cpp
1
#include <beast/pipe.hpp>
2

3
// Standard
4
#include <stdexcept>
5

6
namespace beast {
7

8
Pipe::Pipe(uint32_t max_candidates, uint32_t input_slots, uint32_t output_slots)
49✔
9
    : max_candidates_{max_candidates} {
49✔
10
  inputs_.resize(input_slots);
49✔
11
  outputs_.resize(output_slots);
49✔
12
}
49✔
13

14
void Pipe::addInput(uint32_t slot_index, const std::vector<unsigned char>& candidate) {
492✔
15
  inputs_[slot_index].push_back(candidate);
492✔
16
}
492✔
17

18
bool Pipe::inputHasSpace(uint32_t slot_index) const {
461✔
19
  return inputs_[slot_index].size() < max_candidates_;
461✔
20
}
21

22
std::vector<unsigned char> Pipe::drawInput(uint32_t slot_index) {
464✔
23
  if (inputs_[slot_index].empty()) {
464✔
24
    throw std::underflow_error("No input candidates available to draw.");
1✔
25
  }
26

27
  std::vector<unsigned char> item = inputs_[slot_index].front();
463✔
28
  inputs_[slot_index].pop_front();
463✔
29

30
  return item;
463✔
31
}
32

33
bool Pipe::hasOutput(uint32_t slot_index) const { return !outputs_[slot_index].empty(); }
69✔
34

35
Pipe::OutputItem Pipe::drawOutput(uint32_t slot_index) {
61✔
36
  if (outputs_[slot_index].empty()) {
61✔
37
    throw std::underflow_error("No output candidates available to draw.");
1✔
38
  }
39

40
  OutputItem item = outputs_[slot_index].front();
60✔
41
  outputs_[slot_index].pop_front();
60✔
42

43
  return item;
60✔
44
}
45

46
uint32_t Pipe::getInputSlotAmount(uint32_t slot_index) const { return inputs_[slot_index].size(); }
12✔
47

48
uint32_t Pipe::getOutputSlotAmount(uint32_t slot_index) const {
5✔
49
  return outputs_[slot_index].size();
5✔
50
}
51

52
bool Pipe::inputsAreSaturated() const {
2✔
53
  bool saturated = true;
2✔
54
  for (uint32_t idx = 0; idx < getInputSlotCount() && saturated; ++idx) {
4✔
55
    saturated &= getInputSlotAmount(idx) >= max_candidates_;
2✔
56
  }
57
  return saturated;
2✔
58
}
59

60
bool Pipe::outputsAreSaturated() const {
2✔
61
  if (getOutputSlotCount() == 0) {
2✔
62
    return false;
×
63
  }
64
  bool saturated = true;
2✔
65
  for (uint32_t idx = 0; idx < getOutputSlotCount() && saturated; ++idx) {
4✔
66
    saturated &= getOutputSlotAmount(idx) >= max_candidates_;
2✔
67
  }
68
  return saturated;
2✔
69
}
70

71
} // namespace beast
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc