/[PAMELA software]/PamCut/PamCutBase/PamCutBase.cpp
ViewVC logotype

Diff of /PamCut/PamCutBase/PamCutBase.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by pam-fi, Fri May 29 10:10:28 2009 UTC revision 1.4 by pam-fi, Tue Oct 27 10:24:02 2009 UTC
# Line 70  PamCut& PamCut::operator=(const PamCut & Line 70  PamCut& PamCut::operator=(const PamCut &
70  /* ************************ *  /* ************************ *
71   *     PAMCUTCOLLECTION   *     PAMCUTCOLLECTION
72   * ************************ */   * ************************ */
73    PamCutCollection::~PamCutCollection(){
74    
75  void PamCutCollection::AddCut(PamCut &cut) {    if (_owns){
76    _cuts.push_back(&cut);      for (unsigned int i = 0; i < _cuts.size(); i++)
77          if (_cuts[i] != NULL){
78            delete _cuts[i];
79            _cuts[i] = NULL;
80          }
81      }
82    }
83    
84    
85    void PamCutCollection::AddCut(PamCut *cut) {
86      _cuts.push_back(cut);
87  }  }
88    
89  int PamCutCollection::Check(PamLevel2 *event) {  int PamCutCollection::Check(PamLevel2 *event) {
# Line 122  PamCut *PamCutCollection::GetCut(unsigne Line 133  PamCut *PamCutCollection::GetCut(unsigne
133      return _cuts[iCut];      return _cuts[iCut];
134  }  }
135    
136    PamCut *PamCutCollection::GetCut(const char *cutName) {
137      if (_cuts.size() == 0)
138        return NULL;
139      for (unsigned int i = 0; i < _cuts.size(); i++){
140        if (strcmp(_cuts[i]->GetName(), cutName) == 0)
141          return _cuts[i];
142      }
143    
144      return NULL;
145    }
146    
147  unsigned int PamCutCollection::GetSize() {  unsigned int PamCutCollection::GetSize() {
148    return (unsigned int) _cuts.size();    return (unsigned int) _cuts.size();
149    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.23