1 |
/* |
2 |
* SmartCollection.cpp |
3 |
* |
4 |
* Created on: 14-mag-2009 |
5 |
* Author: Nicola Mori |
6 |
*/ |
7 |
|
8 |
/*! @file SmartCollection.cpp The SmartCollection class implementation file */ |
9 |
|
10 |
#include "SmartCollection.h" |
11 |
|
12 |
void SmartCollection::AddAction(CollectionAction& action) { |
13 |
_actions.push_back(&action); |
14 |
} |
15 |
|
16 |
CollectionAction *SmartCollection::GetAction(unsigned int iAction) { |
17 |
if (_actions.size() == 0) |
18 |
return NULL; |
19 |
if (iAction < 0 || iAction > _actions.size() - 1) |
20 |
return NULL; |
21 |
else |
22 |
return _actions[iAction]; |
23 |
} |
24 |
|
25 |
void SmartCollection::Setup(PamLevel2 *events){ |
26 |
PamCutCollection::Setup(events); |
27 |
|
28 |
for (unsigned int i = 0; i < GetSize(); i++){ |
29 |
_actions[i]->Setup(events); |
30 |
} |
31 |
} |
32 |
|
33 |
void SmartCollection::Finalize(){ |
34 |
PamCutCollection::Finalize(); |
35 |
|
36 |
for (unsigned int i = 0; i < GetSize(); i++){ |
37 |
_actions[i]->Finalize(); |
38 |
} |
39 |
} |
40 |
|
41 |
void SmartCollection::OnGood(PamLevel2 *event){ |
42 |
PamCutCollection::OnGood(event); |
43 |
|
44 |
for (unsigned int i = 0; i < GetSize(); i++){ |
45 |
_actions[i]->OnGood(event); |
46 |
} |
47 |
} |
48 |
|
49 |
void SmartCollection::OnBad(PamLevel2 *event, int selectionResult){ |
50 |
PamCutCollection::OnBad(event, selectionResult); |
51 |
|
52 |
for (unsigned int i = 0; i < GetSize(); i++){ |
53 |
_actions[i]->OnBad(event, selectionResult); |
54 |
} |
55 |
} |