Commit c135b81c authored by berenger-bramas's avatar berenger-bramas
Browse files

Use the FNoCopyable where needed.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@326 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 977ba14c
...@@ -3,15 +3,16 @@ ...@@ -3,15 +3,16 @@
// [--License--] // [--License--]
#include "FSubOctree.hpp" #include "FSubOctree.hpp"
#include "FTreeCoordinate.hpp"
#include "../Utils/FDebug.hpp" #include "../Utils/FDebug.hpp"
#include "../Utils/FGlobal.hpp" #include "../Utils/FGlobal.hpp"
#include "../Utils/F3DPosition.hpp" #include "../Utils/F3DPosition.hpp"
#include "../Utils/FMath.hpp" #include "../Utils/FMath.hpp"
#include "FTreeCoordinate.hpp" #include "../Utils/FNoCopyable.hpp"
#include "../Utils/FAssertable.hpp" #include "../Utils/FAssertable.hpp"
/** /**
* @author Berenger Bramas (berenger.bramas@inria.fr) * @author Berenger Bramas (berenger.bramas@inria.fr)
* @class FOctree * @class FOctree
...@@ -30,10 +31,10 @@ ...@@ -30,10 +31,10 @@
* Cell must extend extend {FExtendPosition,FExtendMortonIndex} * Cell must extend extend {FExtendPosition,FExtendMortonIndex}
*/ */
template< class ParticleClass, class CellClass, class ContainerClass, class LeafClass> template< class ParticleClass, class CellClass, class ContainerClass, class LeafClass>
class FOctree : protected FAssertable { class FOctree : protected FAssertable, public FNoCopyable {
FReal*const boxWidthAtLevel; //< to store the width of each boxs at all levels FReal*const boxWidthAtLevel; //< to store the width of each boxs at all levels
const int height; //< tree height const int height; //< tree height
const int subHeight; //< tree height const int subHeight; //< tree height
const int leafIndex; //< index of leaf int array const int leafIndex; //< index of leaf int array
...@@ -45,15 +46,6 @@ class FOctree : protected FAssertable { ...@@ -45,15 +46,6 @@ class FOctree : protected FAssertable {
const FReal boxWidth; //< the space system width const FReal boxWidth; //< the space system width
/** Forbiden copy operator */
FOctree& operator=(const FOctree&) {
return *this;
}
/** Forbiden copy constructor */
FOctree(const FOctree&) {
}
/** /**
* Get morton index from a position for the leaf leavel * Get morton index from a position for the leaf leavel
* @param inPosition position to compute * @param inPosition position to compute
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "../Utils/FComplexe.hpp" #include "../Utils/FComplexe.hpp"
#include "../Utils/FMath.hpp" #include "../Utils/FMath.hpp"
#include "../Utils/FTrace.hpp" #include "../Utils/FTrace.hpp"
#include "../Utils/FNoCopyable.hpp"
#include <iostream> #include <iostream>
...@@ -36,7 +37,7 @@ static const int FMB_Info_P = 12; ...@@ -36,7 +37,7 @@ static const int FMB_Info_P = 12;
* Needs cell to extend {FExtendFmbCell} * Needs cell to extend {FExtendFmbCell}
*/ */
template< class ParticleClass, class CellClass, class ContainerClass> template< class ParticleClass, class CellClass, class ContainerClass>
class FFmbKernels { class FFmbKernels : public FNoAssignement {
protected: protected:
// _GRAVITATIONAL_ // _GRAVITATIONAL_
...@@ -622,8 +623,6 @@ protected: ...@@ -622,8 +623,6 @@ protected:
precomputeM2L(); precomputeM2L();
} }
/** Forbiden copy operator */
FFmbKernels& operator=(const FFmbKernels&){ return *this; }
public: public:
FFmbKernels(const int inTreeHeight, const FReal inTreeWidth) : FFmbKernels(const int inTreeHeight, const FReal inTreeWidth) :
......
...@@ -4,12 +4,13 @@ ...@@ -4,12 +4,13 @@
#include "../Utils/FGlobal.hpp" #include "../Utils/FGlobal.hpp"
#include "../Utils/FComplexe.hpp" #include "../Utils/FComplexe.hpp"
#include "../Utils/FSpherical.hpp" #include "../Utils/FSpherical.hpp"
#include "../Utils/FNoCopyable.hpp"
/** This class compute the spherical harmonic. /** This class compute the spherical harmonic.
* It computes the inner, outter, and legendre. * It computes the inner, outter, and legendre.
*/ */
class FHarmonic { class FHarmonic : public FNoAssignement {
const int devP; //< P const int devP; //< P
const int expSize; //< Exponen Size const int expSize; //< Exponen Size
...@@ -112,9 +113,6 @@ class FHarmonic { ...@@ -112,9 +113,6 @@ class FHarmonic {
} }
} }
/** Forbid copy operator */
FHarmonic& operator=(const FHarmonic&){ return *this;}
public: public:
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// Constructor & Accessor // Constructor & Accessor
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// [--License--] // [--License--]
#include "FGlobal.hpp" #include "FGlobal.hpp"
#include "FNoCopyable.hpp"
#ifndef SCALFMM_USE_DEBUG #ifndef SCALFMM_USE_DEBUG
...@@ -29,7 +30,7 @@ ...@@ -29,7 +30,7 @@
* FDEBUG( FDebug::Controller << "I want to debug " << toto << "\n"; ) * FDEBUG( FDebug::Controller << "I want to debug " << toto << "\n"; )
* </code> * </code>
*/ */
class FDebug{ class FDebug : public FNoCopyable {
private: private:
std::ostream* stream; //< Standart c++ ostream std::ostream* stream; //< Standart c++ ostream
...@@ -52,22 +53,6 @@ private: ...@@ -52,22 +53,6 @@ private:
if(this->stream != &std::cout) delete(this->stream); if(this->stream != &std::cout) delete(this->stream);
} }
/**
* Copy constructor forbiden
* @param other the source class to copy
*/
FDebug(const FDebug& ){}
/**
* Copy constructor forbiden
* @param other the source class to copy
* @return this a reference to the current class
*/
FDebug& operator=(const FDebug& ){
return *this;
}
public: public:
static FDebug Controller; //< Singleton static FDebug Controller; //< Singleton
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <cstdio> #include <cstdio>
#include "FGlobal.hpp" #include "FGlobal.hpp"
#include "FNoCopyable.hpp"
#include "FMath.hpp" #include "FMath.hpp"
...@@ -184,16 +185,13 @@ public: ...@@ -184,16 +185,13 @@ public:
/** This class is used to put all the usual method /** This class is used to put all the usual method
* related mpi comm * related mpi comm
*/ */
class FComm { class FComm : public FNoCopyable {
int rank; //< rank related to the comm int rank; //< rank related to the comm
int nbProc; //< nb proc in this group int nbProc; //< nb proc in this group
MPI_Comm communicator; //< current mpi communicator MPI_Comm communicator; //< current mpi communicator
MPI_Group group; //< current mpi group MPI_Group group; //< current mpi group
// Forbid copy
FComm(const FComm&){}
FComm& operator=(const FComm&){return *this;}
// reset : get rank and nb proc from mpi // reset : get rank and nb proc from mpi
void reset(){ void reset(){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment