more doc about the repairer dispatcher

This commit is contained in:
nojhan 2011-10-26 15:35:04 +02:00
commit 7acaa0beab

View file

@ -38,23 +38,31 @@ Authors:
* of indexes). * of indexes).
* *
* Only work on EOT that implements the "push_back( EOT::AtomType )" and * Only work on EOT that implements the "push_back( EOT::AtomType )" and
* "operator[](uint)" and "at(uint)" methods. * "operator[](uint)" and "at(uint)" methods (i.e. random access containers).
* *
* Expects _addresses_ of the repairer operators. * Expects _addresses_ of the repairer operators.
* *
* Use the second template type if you want a different container to store
* indexes. You can use any iterable. For example, you may want to use a set if
* you need to be sure that indexes are use only once:
* edoRepairerDispatcher<EOT, std::set<unsigned int> > rpd;
* std::set<unsigned int> idx(1,1);
* idx.insert(2);
* rpd.add( idx, &repairer );
*
* @example t-dispatcher-round.cpp * @example t-dispatcher-round.cpp
* *
* @ingroup Repairers * @ingroup Repairers
*/ */
template < typename EOT, typename ICT = std::vector<unsigned int> >
template < typename EOT >
class edoRepairerDispatcher class edoRepairerDispatcher
: public edoRepairer<EOT>, : public edoRepairer<EOT>,
std::vector< std::vector<
std::pair< std::vector< unsigned int >, edoRepairer< EOT >* > std::pair< ICT, edoRepairer< EOT >* >
> >
{ {
public: public:
//! Empty constructor //! Empty constructor
edoRepairerDispatcher() : edoRepairerDispatcher() :
std::vector< std::vector<
@ -63,7 +71,7 @@ public:
{} {}
//! Constructor with a single index set and repairer operator //! Constructor with a single index set and repairer operator
edoRepairerDispatcher( std::vector<unsigned int> idx, edoRepairer<EOT>* op ) : edoRepairerDispatcher( IndexContainer idx, edoRepairer<EOT>* op ) :
std::vector< std::vector<
std::pair< std::vector< unsigned int >, edoRepairer< EOT >* > std::pair< std::vector< unsigned int >, edoRepairer< EOT >* >
>() >()
@ -72,7 +80,7 @@ public:
} }
//! Add more indexes set and their corresponding repairer operator address to the list //! Add more indexes set and their corresponding repairer operator address to the list
void add( std::vector<unsigned int> idx, edoRepairer<EOT>* op ) void add( IndexContainer idx, edoRepairer<EOT>* op )
{ {
assert( idx.size() > 0 ); assert( idx.size() > 0 );
assert( op != NULL ); assert( op != NULL );