new style peo

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1021 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
canape 2008-02-29 14:08:59 +00:00
commit edb6d65a7b
34 changed files with 407 additions and 386 deletions

View file

@ -51,8 +51,8 @@ template < typename EntityType > class peoMultiStart : public Service
public:
//! @brief Constructor
//! @param AlgorithmType& externalAlgorithm
//! @brief Constructor
//! @param AlgorithmType& externalAlgorithm
template < typename AlgorithmType > peoMultiStart( AlgorithmType& externalAlgorithm )
{
singularAlgorithm = new Algorithm< AlgorithmType >( externalAlgorithm );
@ -60,18 +60,18 @@ template < typename EntityType > class peoMultiStart : public Service
aggregationFunction = new NoAggregationFunction();
}
//! @brief Constructor
//! @param AlgorithmReturnType (*externalAlgorithm)( AlgorithmDataType& )
//! @brief Constructor
//! @param AlgorithmReturnType (*externalAlgorithm)( AlgorithmDataType& )
template < typename AlgorithmReturnType, typename AlgorithmDataType > peoMultiStart( AlgorithmReturnType (*externalAlgorithm)( AlgorithmDataType& ) )
{
singularAlgorithm = new FunctionAlgorithm< AlgorithmReturnType, AlgorithmDataType >( externalAlgorithm );
algorithms.push_back( singularAlgorithm );
aggregationFunction = new NoAggregationFunction();
}
//! @brief Constructor
//! @param std::vector< AlgorithmType* >& externalAlgorithms
//! @param AggregationFunctionType& externalAggregationFunction
//! @brief Constructor
//! @param std::vector< AlgorithmType* >& externalAlgorithms
//! @param AggregationFunctionType& externalAggregationFunction
template < typename AlgorithmType, typename AggregationFunctionType > peoMultiStart( std::vector< AlgorithmType* >& externalAlgorithms, AggregationFunctionType& externalAggregationFunction )
{
for ( unsigned int index = 0; index < externalAlgorithms.size(); index++ )
@ -81,9 +81,9 @@ template < typename EntityType > class peoMultiStart : public Service
aggregationFunction = new AggregationAlgorithm< AggregationFunctionType >( externalAggregationFunction );
}
//! @brief Constructor
//! @param std::vector< AlgorithmReturnType (*)( AlgorithmDataType& ) >& externalAlgorithms
//! @param AggregationFunctionType& externalAggregationFunction
//! @brief Constructor
//! @param std::vector< AlgorithmReturnType (*)( AlgorithmDataType& ) >& externalAlgorithms
//! @param AggregationFunctionType& externalAggregationFunction
template < typename AlgorithmReturnType, typename AlgorithmDataType, typename AggregationFunctionType > peoMultiStart( std::vector< AlgorithmReturnType (*)( AlgorithmDataType& ) >& externalAlgorithms, AggregationFunctionType& externalAggregationFunction )
{
for ( unsigned int index = 0; index < externalAlgorithms.size(); index++ )
@ -93,16 +93,16 @@ template < typename EntityType > class peoMultiStart : public Service
aggregationFunction = new AggregationAlgorithm< AggregationFunctionType >( externalAggregationFunction );
}
//! @brief Destructor
//! @brief Destructor
~peoMultiStart()
{
for ( unsigned int index = 0; index < data.size(); index++ ) delete data[ index ];
for ( unsigned int index = 0; index < algorithms.size(); index++ ) delete algorithms[ index ];
delete aggregationFunction;
for ( unsigned int index = 0; index < algorithms.size(); index++ ) delete algorithms[ index ];
delete aggregationFunction;
}
//! @brief operator on the template type
//! @param Type& externalData
//! @brief operator on the template type
//! @param Type& externalData
template < typename Type > void operator()( Type& externalData )
{
for ( typename Type::iterator externalDataIterator = externalData.begin(); externalDataIterator != externalData.end(); externalDataIterator++ )
@ -114,9 +114,9 @@ template < typename EntityType > class peoMultiStart : public Service
stop();
}
//! @brief operator on the template type
//! @param Type& externalDataBegin
//! @param Type& externalDataEnd
//! @brief operator on the template type
//! @param Type& externalDataBegin
//! @param Type& externalDataEnd
template < typename Type > void operator()( const Type& externalDataBegin, const Type& externalDataEnd )
{
for ( Type externalDataIterator = externalDataBegin; externalDataIterator != externalDataEnd; externalDataIterator++ )
@ -128,32 +128,32 @@ template < typename EntityType > class peoMultiStart : public Service
stop();
}
//! @brief Function realizing packages of data
//! @brief Function realizing packages of data
void packData();
//! @brief Function reconstituting packages of data
void unpackData();
//! @brief Function which executes the algorithm
//! @brief Function which executes the algorithm
void execute();
//! @brief Function realizing packages of the result
//! @brief Function realizing packages of the result
void packResult();
//! @brief Function reconstituting packages of result
//! @brief Function reconstituting packages of result
void unpackResult();
//! @brief Function notifySendingData
//! @brief Function notifySendingData
void notifySendingData();
//! @brief Function notifySendingAllResourceRequests
//! @brief Function notifySendingAllResourceRequests
void notifySendingAllResourceRequests();
private:
//! @param AbstractAlgorithm* singularAlgorithm
//! @param std::vector< AbstractAlgorithm* > algorithms
//! @param AbstractAggregationAlgorithm* aggregationFunction
//! @param EntityType entityTypeInstance
//! @param std::vector< AbstractDataType* > data
//! @param unsigned idx
//! @param unsigned num_term
//! @param unsigned dataIndex
//! @param unsigned functionIndex
//! @param AbstractAlgorithm* singularAlgorithm
//! @param std::vector< AbstractAlgorithm* > algorithms
//! @param AbstractAggregationAlgorithm* aggregationFunction
//! @param EntityType entityTypeInstance
//! @param std::vector< AbstractDataType* > data
//! @param unsigned idx
//! @param unsigned num_term
//! @param unsigned dataIndex
//! @param unsigned functionIndex
template < typename Type > struct DataType;
struct AbstractDataType
{