MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / next

Method next

lib/fluxsource/a2rfluxsource.cc:28–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26 }
27
28 std::unique_ptr<const Fluxmap> next() override
29 {
30 nanoseconds_t index = _flux.index;
31 Bytes& asbytes = _flux.flux[_count++];
32 ByteReader br(asbytes);
33
34 auto fluxmap = std::make_unique<Fluxmap>();
35 while (!br.eof())
36 {
37 unsigned aticks = 0;
38 for (;;)
39 {
40 unsigned i = br.read_8();
41 aticks += i;
42 if (i != 0xff)
43 break;
44 }
45
46 nanoseconds_t interval = aticks * 125;
47 if ((index >= 0) && (index < interval))
48 {
49 fluxmap->appendInterval(index);
50 fluxmap->appendIndex();
51 interval -= index;
52 }
53 index -= interval;
54
55 fluxmap->appendInterval(interval / NS_PER_TICK);
56 fluxmap->appendPulse();
57 }
58
59 return fluxmap;
60 }
61
62private:
63 A2Rv2Flux& _flux;

Callers

nothing calls this directly

Calls 2

read_8Method · 0.80
eofMethod · 0.45

Tested by

no test coverage detected