--- PamCut/Collections/SmartCollection/SmartCollection.h 2009/06/17 13:02:39 1.5 +++ PamCut/Collections/SmartCollection/SmartCollection.h 2009/10/27 10:24:00 1.7 @@ -46,17 +46,18 @@ /*! @brief Constructor. * * @param collectionName The collection's name. + * @param owns If true, the collection will own the cuts and the actions, ie., it will + * destroy them in its destructor. */ - SmartCollection(const char* collectionName) : - PamCutCollection(collectionName), _actions(0) { + SmartCollection(const char* collectionName, bool owns = true) : + PamCutCollection(collectionName, owns), _actions(0) { } /*! @brief Destructor. */ - ~SmartCollection() { - } + ~SmartCollection(); /*! @brief Adds an action to the SmartCollection */ - virtual void AddAction(CollectionAction& action); + virtual void AddAction(CollectionAction *action); /*! @brief Returns the iAction-th action. * @@ -77,7 +78,7 @@ * * @return The number of actions currently in the collection. */ - unsigned int GetActionsSize(){ + unsigned int GetActionsSize() { return _actions.size(); } @@ -108,8 +109,16 @@ protected: + /*! @brief The vector containing the actions */ std::vector _actions; - std::vector _actionsPositions; + + /*! The vector of actions' positions + * + * An action is placed after N cuts, so that the SmartCollection, after applying N cuts, has to + * perform the action. The numbers N for each action are stored here: the element i is N for the + * i-th action in #_actions. + */ + std::vector _actionsPositions; };