/[PAMELA software]/PamCut/Collections/SmartCollection/SmartCollection.cpp
ViewVC logotype

Annotation of /PamCut/Collections/SmartCollection/SmartCollection.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Fri May 29 10:10:31 2009 UTC (15 years, 6 months ago) by pam-fi
Branch: MAIN
Changes since 1.1: +8 -8 lines
Previous commit was outdated; fixed.

1 pam-fi 1.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 pam-fi 1.2 void SmartCollection::Setup(PamLevel2 *events) {
26 pam-fi 1.1 PamCutCollection::Setup(events);
27    
28 pam-fi 1.2 for (unsigned int i = 0; i < _actions.size(); i++) {
29 pam-fi 1.1 _actions[i]->Setup(events);
30     }
31     }
32    
33 pam-fi 1.2 void SmartCollection::Finalize() {
34 pam-fi 1.1 PamCutCollection::Finalize();
35    
36 pam-fi 1.2 for (unsigned int i = 0; i < _actions.size(); i++) {
37 pam-fi 1.1 _actions[i]->Finalize();
38     }
39     }
40    
41 pam-fi 1.2 void SmartCollection::OnGood(PamLevel2 *event) {
42 pam-fi 1.1 PamCutCollection::OnGood(event);
43    
44 pam-fi 1.2 for (unsigned int i = 0; i < _actions.size(); i++) {
45 pam-fi 1.1 _actions[i]->OnGood(event);
46     }
47     }
48    
49 pam-fi 1.2 void SmartCollection::OnBad(PamLevel2 *event, int selectionResult) {
50 pam-fi 1.1 PamCutCollection::OnBad(event, selectionResult);
51    
52 pam-fi 1.2 for (unsigned int i = 0; i < _actions.size(); i++) {
53 pam-fi 1.1 _actions[i]->OnBad(event, selectionResult);
54     }
55     }

  ViewVC Help
Powered by ViewVC 1.1.23