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

Diff of /PamCut/PamCutBase/PamCutBase.h

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

revision 1.4 by pam-fi, Wed Jun 17 12:58:00 2009 UTC revision 1.5 by pam-fi, Tue Oct 27 10:24:01 2009 UTC
# Line 22  using namespace std; Line 22  using namespace std;
22  class PamCut {  class PamCut {
23  public:  public:
24    
25    /*! @brief Constructor. */    /*! @brief Constructor.
26       *  @param cutName The cut's name.
27       */
28    PamCut(const char *cutName) :    PamCut(const char *cutName) :
29      _cutName(cutName), _nEv(0), _nGood(0) {      _cutName(cutName), _nEv(0), _nGood(0) {
30    }    }
# Line 172  class PamCutCollection: public PamCut { Line 174  class PamCutCollection: public PamCut {
174  public:  public:
175    
176    /*! @brief Constructor.    /*! @brief Constructor.
177       * The collection can own the cuts, according to the value of the "owns" parameter.
178       * If set to true, the collection will take in charge the duty of destroying cuts and
179       * freeing their memory; users then should not set owns to true and explicitly call
180       * delete for the cuts in the collection. If instead owns is set to false, no destruction
181       * is performed by the collection; in this case, the user should issue the eventual
182       * delete calls.
183     *     *
184     * @param collectionName The collection's name.     * @param collectionName The collection's name.
185       * @param owns If true, the collection will own the cuts, ie., it will
186       *             destroy them in its destructor.
187     */     */
188    PamCutCollection(const char *collectionName) :    PamCutCollection(const char *collectionName, bool owns = true) :
189      PamCut(collectionName) {      PamCut(collectionName), _owns(owns) {
190    }    }
191    
192    /*! @brief Destructor. */    /*! @brief Destructor. */
193    ~PamCutCollection() {    ~PamCutCollection();
   }  
194    
195    /*! @brief Adds a cut to the cut collection    /*! @brief Adds a cut to the cut collection
196     *  This routine adds a cut to the collection. These are stored in a vector in the same order     *  This routine adds a cut to the collection. These are stored in a vector in the same order
197     *  they are inserted (the first cut would be element 0, the second cut element 1 and so on).     *  they are inserted (the first cut would be element 0, the second cut element 1 and so on).
198     *  All the references to a "cut number" or "cut index" will refer to this numbering scheme.     *  All the references to a "cut number" or "cut index" will refer to this numbering scheme.
199     *     *
200     * @param cut The PamCut-derived object to add to the collection.     * @param cut The pointer to a PamCut-derived object to add to the collection.
201     */     */
202    void AddCut(PamCut &cut);    void AddCut(PamCut *cut);
203    
204    /*! @brief The basic selection.    /*! @brief The basic selection.
205     *     *
# Line 271  protected: Line 280  protected:
280    /*! @brief A vector containing pointers to PamCut objects */    /*! @brief A vector containing pointers to PamCut objects */
281    std::vector<PamCut*> _cuts;    std::vector<PamCut*> _cuts;
282    
283      /*! @brief A flag signaling if the collection owns the cuts (ie., if the collection
284       *         will destroy the cuts.
285       */
286      bool _owns;
287  };  };
288    
289  #endif /* PAMCUTBASE_H_ */  #endif /* PAMCUTBASE_H_ */

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

  ViewVC Help
Powered by ViewVC 1.1.23