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

dedicate-project / beast / 3ba971e4-2004-46a3-b2d0-8a6d687db0d1

pending completion
3ba971e4-2004-46a3-b2d0-8a6d687db0d1

Pull #9

circleci

fairlight1337
Repaired context menu popping up
Pull Request #9: Adding pipeline applications

1225 of 1225 new or added lines in 24 files covered. (100.0%)

2850 of 3071 relevant lines covered (92.8%)

12345.72 hits per line

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

86.0
/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)
44✔
9
    : max_candidates_{max_candidates} {
44✔
10
  inputs_.resize(input_slots);
44✔
11
  outputs_.resize(output_slots);
44✔
12
}
44✔
13

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

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

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

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

30
  return item;
213✔
31
}
32

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

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

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

43
  return item;
69✔
44
}
45

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

50
uint32_t Pipe::getOutputSlotAmount(uint32_t slot_index) const {
16✔
51
  return static_cast<uint32_t>(outputs_[slot_index].size());
16✔
52
}
53

54
bool Pipe::inputsAreSaturated() const {
2✔
55
  for (uint32_t idx = 0; idx < getInputSlotCount(); ++idx) {
3✔
56
    if (getInputSlotAmount(idx) < max_candidates_) {
2✔
57
      return false;
1✔
58
    }
59
  }
60
  return true;
1✔
61
}
62

63
bool Pipe::outputsAreSaturated() const {
2✔
64
  const uint32_t outputSlotCount = getOutputSlotCount();
2✔
65
  if (outputSlotCount == 0) {
2✔
66
    return false;
×
67
  }
68
  for (uint32_t idx = 0; idx < outputSlotCount; ++idx) {
3✔
69
    if (getOutputSlotAmount(idx) < max_candidates_) {
2✔
70
      return false;
1✔
71
    }
72
  }
73
  return true;
1✔
74
}
75

76
void Pipe::storeOutput(uint32_t slot_index, const OutputItem& output) {
×
77
  if (slot_index >= outputs_.size()) {
×
78
    throw std::invalid_argument("Slot index for output too large");
×
79
  }
80
  outputs_[slot_index].push_back(output);
×
81
}
×
82

83
void Pipe::storeOutput(uint32_t slot_index, OutputItem&& output) {
94✔
84
  if (slot_index >= outputs_.size()) {
94✔
85
    throw std::invalid_argument("Slot index for output too large");
×
86
  }
87
  outputs_[slot_index].push_back(std::move(output));
94✔
88
}
94✔
89

90
} // 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