00001
00002
00003
00004
00005
00006
00007
00010 #include "BlindCutCollection.h"
00011
00012 int BlindCutCollection::Check(PamLevel2 *event){
00013
00014 if (_cuts.size() == 0) {
00015 return CUTOK;
00016 }
00017
00018 int firstFailed = CUTOK;
00019 for (unsigned int icut = 0; icut < _cuts.size(); icut++) {
00020 if (_cuts[icut]->Check(event) != CUTOK && firstFailed == CUTOK) {
00021 firstFailed = icut;
00022 }
00023 }
00024
00025 return firstFailed;
00026
00027 }
00028
00029 int BlindCutCollection::ApplyCut(PamLevel2 *event) {
00030
00031 _nEv++;
00032 if (_cuts.size() == 0) {
00033 _nGood++;
00034 OnGood(event);
00035 return CUTOK;
00036 }
00037
00038 int firstFailed = CUTOK;
00039 for (unsigned int icut = 0; icut < _cuts.size(); icut++) {
00040 if (_cuts[icut]->ApplyCut(event) != CUTOK && firstFailed == CUTOK) {
00041 firstFailed = icut;
00042 }
00043 }
00044
00045 if (firstFailed == CUTOK) {
00046 _nGood++;
00047 OnGood(event);
00048 }
00049 else {
00050 OnBad(event, firstFailed);
00051 }
00052 return firstFailed;
00053 }