// ClusterContainer.h #ifndef ClusterContainer_H #define ClusterContainer_H // Cluster container is a generic container for clusters. // It allows lists of clusters to be passed around in an // arbitray container. It is expected that subclasses // will provide internal methods to access the clusters in // forms that allow faster access by ClusterFilters. // // The subclass ClusterContainerStandard holds the clusters // in the same form as they are returned and so is ideal // for applications when no filtering will take place. // For example the last filter in a chain might return this // type of container. #include "trfbase/Hit.h" namespace trf { class ClusterContainer { public: // typedefs typedef ClusterList::size_type size_type; public: // methods // Destructor. virtual ~ClusterContainer(); // Return container size; virtual size_type size() const = 0; // Add a cluster to the collection. virtual void add_cluster(const ClusterPtr& pclu) = 0; // Append clusters to the list. virtual void add_clusters(const ClusterList& clusters); // Empty the container. virtual void drop_clusters() = 0; // Return the list of clusters in standard form. // Subclasses are expected to maintain the referenced ClusterList // and not modify it once this method is called. virtual const ClusterList& get_clusters() const = 0; // Make a new empty container of the same type as this container. virtual ClusterContainer* new_empty_container() const = 0; }; } // end namespace trf #endif