FExtendMortonIndex.hpp 2.22 KB
Newer Older
1
// ===================================================================================
2 3 4 5 6 7 8 9 10 11 12 13 14
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Bérenger Bramas, Matthias Messner
// olivier.coulaud@inria.fr, berenger.bramas@inria.fr
// This software is a computer program whose purpose is to compute the FMM.
//
// This software is governed by the CeCILL-C and LGPL licenses and
// abiding by the rules of distribution of free software.  
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public and CeCILL-C Licenses for more details.
// "http://www.cecill.info". 
// "http://www.gnu.org/licenses".
15
// ===================================================================================
16 17
#ifndef FEXTENDMORTONINDEX_HPP
#define FEXTENDMORTONINDEX_HPP
18

19

20
#include "../Utils/FGlobal.hpp"
21
#include "../Containers/FTreeCoordinate.hpp"
22 23
#include "../Containers/FBufferReader.hpp"
#include "../Containers/FBufferWriter.hpp"
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60

/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
* @class FExtendMortonIndex
* Please read the license
* This class is an extenssion.
* It proposes a mortonIndex.
*/
class FExtendMortonIndex {
protected:
    MortonIndex mortonIndex;    //< Morton index (need by most elements)

public:
    /** Default constructor */
    FExtendMortonIndex() : mortonIndex(0) {
    }

    /** Copy constructor */
    FExtendMortonIndex(const FExtendMortonIndex& other) : mortonIndex(other.mortonIndex) {
    }

    /** Copy operator */
    FExtendMortonIndex& operator=(const FExtendMortonIndex& other) {
        this->mortonIndex = other.mortonIndex;
        return *this;
    }

    /** To get the morton index */
    MortonIndex getMortonIndex() const {
        return this->mortonIndex;
    }

    /** To set the morton index */
    void setMortonIndex(const MortonIndex inMortonIndex) {
        this->mortonIndex = inMortonIndex;
    }

61 62 63 64 65 66 67 68
    /** Save current object */
    void save(FBufferWriter& buffer) const {
        buffer << mortonIndex;
    }
    /** Retrieve current object */
    void restore(FBufferReader& buffer) {
        buffer >> mortonIndex;
    }
69 70 71 72 73
};


#endif //FEXTENDMORTONINDEX_HPP

74