| 40 | // -------------------------- |
| 41 | |
| 42 | BufferedStream::BufferedStream(CompilerScratch* csb, RecordSource* next) |
| 43 | : BaseBufferedStream(csb), |
| 44 | m_next(next), |
| 45 | m_map(csb->csb_pool) |
| 46 | { |
| 47 | fb_assert(m_next); |
| 48 | |
| 49 | m_impure = csb->allocImpure<Impure>(); |
| 50 | m_cardinality = next->getCardinality(); |
| 51 | |
| 52 | StreamList streams; |
| 53 | m_next->findUsedStreams(streams); |
| 54 | |
| 55 | Array<dsc> fields; |
| 56 | |
| 57 | for (StreamList::iterator i = streams.begin(); i != streams.end(); ++i) |
| 58 | { |
| 59 | const StreamType stream = *i; |
| 60 | CompilerScratch::csb_repeat* const tail = &csb->csb_rpt[stream]; |
| 61 | |
| 62 | UInt32Bitmap::Accessor accessor(tail->csb_fields); |
| 63 | |
| 64 | if (accessor.getFirst()) |
| 65 | { |
| 66 | do { |
| 67 | const USHORT id = (USHORT) accessor.current(); |
| 68 | const Format* const format = tail->csb_format; // CMP_format(tdbb, csb, stream); |
| 69 | const dsc* const desc = &format->fmt_desc[id]; |
| 70 | m_map.add(FieldMap(FieldMap::REGULAR_FIELD, stream, id)); |
| 71 | fields.add(*desc); |
| 72 | } while (accessor.getNext()); |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | dsc desc; |
| 77 | |
| 78 | for (StreamList::iterator i = streams.begin(); i != streams.end(); ++i) |
| 79 | { |
| 80 | const StreamType stream = *i; |
| 81 | |
| 82 | desc.makeInt64(0); |
| 83 | m_map.add(FieldMap(FieldMap::TRANSACTION_ID, stream, 0)); |
| 84 | fields.add(desc); |
| 85 | |
| 86 | desc.makeInt64(0); |
| 87 | m_map.add(FieldMap(FieldMap::DBKEY_NUMBER, stream, 0)); |
| 88 | fields.add(desc); |
| 89 | } |
| 90 | |
| 91 | for (StreamList::iterator i = streams.begin(); i != streams.end(); ++i) |
| 92 | { |
| 93 | const StreamType stream = *i; |
| 94 | |
| 95 | desc.makeText(1, CS_BINARY); |
| 96 | m_map.add(FieldMap(FieldMap::DBKEY_VALID, stream, 0)); |
| 97 | fields.add(desc); |
| 98 | } |
| 99 |
nothing calls this directly
no test coverage detected