| 90 | { |
| 91 | public: |
| 92 | BlrParseWrapper(MemoryPool& pool, jrd_rel* relation, CompilerScratch* view_csb, |
| 93 | CompilerScratch** csb_ptr, const bool trigger, USHORT flags) |
| 94 | : m_csbPtr(csb_ptr) |
| 95 | { |
| 96 | if (!(csb_ptr && (m_csb = *csb_ptr))) |
| 97 | { |
| 98 | m_csb = FB_NEW_POOL(pool) CompilerScratch(pool); |
| 99 | m_csb->csb_g_flags |= flags; |
| 100 | } |
| 101 | |
| 102 | // If there is a request ptr, this is a trigger. Set up contexts 0 and 1 for |
| 103 | // the target relation |
| 104 | |
| 105 | if (trigger) |
| 106 | { |
| 107 | StreamType stream = m_csb->nextStream(); |
| 108 | CompilerScratch::csb_repeat* t1 = CMP_csb_element(m_csb, 0); |
| 109 | t1->csb_flags |= csb_used | csb_active | csb_trigger; |
| 110 | t1->csb_relation = relation; |
| 111 | t1->csb_stream = stream; |
| 112 | |
| 113 | stream = m_csb->nextStream(); |
| 114 | t1 = CMP_csb_element(m_csb, 1); |
| 115 | t1->csb_flags |= csb_used | csb_active | csb_trigger; |
| 116 | t1->csb_relation = relation; |
| 117 | t1->csb_stream = stream; |
| 118 | } |
| 119 | else if (relation) |
| 120 | { |
| 121 | CompilerScratch::csb_repeat* t1 = CMP_csb_element(m_csb, 0); |
| 122 | t1->csb_stream = m_csb->nextStream(); |
| 123 | t1->csb_relation = relation; |
| 124 | t1->csb_flags = csb_used | csb_active; |
| 125 | } |
| 126 | |
| 127 | if (view_csb) |
| 128 | { |
| 129 | CompilerScratch::rpt_itr ptr = view_csb->csb_rpt.begin(); |
| 130 | // AB: csb_n_stream replaced by view_csb->csb_rpt.getCount(), because there could |
| 131 | // be more then just csb_n_stream-numbers that hold data. |
| 132 | // Certainly csb_stream (see PAR_context where the context is retrieved) |
| 133 | const CompilerScratch::rpt_const_itr end = view_csb->csb_rpt.end(); |
| 134 | for (StreamType stream = 0; ptr != end; ++ptr, ++stream) |
| 135 | { |
| 136 | CompilerScratch::csb_repeat* t2 = CMP_csb_element(m_csb, stream); |
| 137 | t2->csb_relation = ptr->csb_relation; |
| 138 | t2->csb_procedure = ptr->csb_procedure; |
| 139 | t2->csb_stream = ptr->csb_stream; |
| 140 | t2->csb_flags = ptr->csb_flags & csb_used; |
| 141 | } |
| 142 | m_csb->csb_n_stream = view_csb->csb_n_stream; |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | operator CompilerScratch*() |
| 147 | { |
nothing calls this directly
no test coverage detected