/* * IndexSetContainer.hpp * * Created on: Jul 3, 2012 * Author: heber */ #ifndef INDEXSETCONTAINER_HPP_ #define INDEXSETCONTAINER_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include #include "IndexSet.hpp" #include "SortedVector.hpp" class IndexSetContainerTest; /** * As the IndexSet is supposed to appear in many maps and Containers as it may * be contained in other IndexSet's, we store it always as a shared_ptr. This * Container is then responsible that the ordering within the container still * allows for fast access due to sorted appearance not by order in memory but * order defined by IndexSet comparison operators. * */ //!> typedef for IndexSet instances stored in SortedVector class IndexSetContainer : public SortedVector { //!> grant unit test access to protected members of SortedVector friend class IndexSetContainerTest; public: //!> typedef for IndexSetContainer wrapped in shared_ptr typedef boost::shared_ptr ptr; /** Constructor from an unsorted vector of instances. * * @param _container unsorted vector of instances */ IndexSetContainer(const SortedVector::Container_t &_container) : SortedVector(_container) {} /** Constructor from an unsorted vector of instances. * * @param _container unsorted vector of instances */ IndexSetContainer(const std::vector &_container) : SortedVector(_container) {} /** Constructor from a single instance. * * @param _instance single instance */ IndexSetContainer(IndexSet::ptr &_instance) : SortedVector(_instance) {} }; //!> typedef for IndexSet instance stored as shared_ptr in SortedVector typedef IndexSetContainer::T_ptr IndexSet_ptr; #endif /* INDEXSETCONTAINER_HPP_ */