Пример #1
0
 void abstract_block_model::ok(block& blk) {
     if (currentblockiteator != end()) currentblockiteator->set_ok();
     currentblockiteator++;
     parcel_iterator endit = blk.end();
     endit++;
     for (parcel_iterator it = blk.begin(); it != endit; ++it) {
         if (it->first->isvalue()) {
             if (!it->first->error()) {
                 switch (SUPER_TYPE(it->first->type())) {
                     case TYPE_EVENT:
                     {
                         executr->write_val_event(it->second, it->first->value_event());
                         break;
                     }
                     case TYPE_REPORT:
                     {
                         executr->write_val_report(it->second, it->first->value_report());
                         break;
                     }
                     default:
                     {
                         executr->write_val(it->second, it->first->value());
                     }
                 }
             }
         }
         if (it->first->error()) {
             executr->error(it->second, it->first->error());
         }
     }
 }
Пример #2
0
 bool abstract_block_model::next(block& blk) {
     if (needgenerate) {
         currentblockiteator = begin();
     }
     if (blocks.empty()) return false;
     if (currentblockiteator == end()) currentblockiteator = begin();
     blk = (*currentblockiteator);
     parcel_iterator bgn = blk.begin();
     parcel_iterator ed = blk.end();
     if (check_block_active(blk, bgn, ed)) {
         if (bgn != blk.begin()) blk.begin(bgn);
         if (ed != blk.end()) blk.end(ed);
         return true;
     }
     currentblockiteator++;
     return false;
 }
Пример #3
0
 bool abstract_block_model::check_block_active(block& blk, parcel_iterator& bgn, parcel_iterator& ed) {
     parcel_iterator strt = blk.begin();
     parcel_iterator stpit = blk.end();
     if (IN_SMPLSET(intf->type(strt->second)))
         return true;
     if (blk.begin() == stpit) {
         return check_parcel_active(strt);
     }
     ++stpit;
     for (parcel_iterator it = blk.begin(); it != stpit; ++it) {
         if (!check_parcel_active(it)) ++bgn;
         else {
             if (it != ed) {
                 for (it = ed; it != bgn; --it) {
                     if (!check_parcel_active(it)) ed--;
                     else return true;
                 }
             }
             return true;
         }
     }
     return false;
 }