Commit bc7df4db authored by PIACIBELLO Cyrille's avatar PIACIBELLO Cyrille
parents 7497595b cb32d3d9
......@@ -41,28 +41,18 @@ public:
}
/** Save the current cell in a buffer */
void save(FBufferWriter& buffer) const{
template <class BufferWriterClass>
void save(BufferWriterClass& buffer) const{
FExtendMortonIndex::save(buffer);
FExtendCoordinate::save(buffer);
}
/** Restore the current cell from a buffer */
void restore(FBufferReader& buffer){
template <class BufferReaderClass>
void restore(BufferReaderClass& buffer){
FExtendMortonIndex::restore(buffer);
FExtendCoordinate::restore(buffer);
}
/** Save the current cell in a buffer */
void save(FMpiBufferWriter& buffer) const{
FExtendMortonIndex::save(buffer);
FExtendCoordinate::save(buffer);
}
/** Restore the current cell from a buffer */
void restore(FMpiBufferReader& buffer){
FExtendMortonIndex::restore(buffer);
FExtendCoordinate::restore(buffer);
}
/** Do nothing */
void resetToInitialState(){
}
......
......@@ -16,8 +16,6 @@
#ifndef FTESTCELL_HPP
#define FTESTCELL_HPP
#include "../Containers/FMpiBufferReader.hpp"
#include "../Containers/FMpiBufferWriter.hpp"
#include "FBasicCell.hpp"
/**
......@@ -64,13 +62,15 @@ public:
/////////////////////////////////////////////////
/** Save the current cell in a buffer */
void save(FBufferWriter& buffer) const{
template <class BufferWriterClass>
void save(BufferWriterClass& buffer) const{
FBasicCell::save(buffer);
buffer << dataDown << dataUp;
}
/** Restore the current cell from a buffer */
void restore(FBufferReader& buffer){
template <class BufferReaderClass>
void restore(BufferReaderClass& buffer){
FBasicCell::restore(buffer);
buffer >> dataDown >> dataUp;
}
......@@ -78,60 +78,27 @@ public:
/////////////////////////////////////////////////
/** Serialize only up data in a buffer */
void serializeUp(FBufferWriter& buffer) const {
template <class BufferWriterClass>
void serializeUp(BufferWriterClass& buffer) const {
buffer << this->dataUp;
}
/** Deserialize only up data in a buffer */
void deserializeUp(FBufferReader& buffer){
template <class BufferReaderClass>
void deserializeUp(BufferReaderClass& buffer){
buffer >> this->dataUp;
}
/** Serialize only down data in a buffer */
void serializeDown(FBufferWriter& buffer) const {
template <class BufferWriterClass>
void serializeDown(BufferWriterClass& buffer) const {
buffer << this->dataDown;
}
/** Deserialize only up data in a buffer */
void deserializeDown(FBufferReader& buffer){
template <class BufferReaderClass>
void deserializeDown(BufferReaderClass& buffer){
buffer >> this->dataDown;
}
/////////////////////////////////////////////////////
/////////////// Test with FMpiBuffer* /////////////
/////////////////////////////////////////////////////
/** Save the current cell in a buffer */
void save(FMpiBufferWriter& buffer) const{
FBasicCell::save(buffer);
buffer << dataDown << dataUp;
}
/** Restore the current cell from a buffer */
void restore(FMpiBufferReader& buffer){
FBasicCell::restore(buffer);
buffer >> dataDown >> dataUp;
}
/////////////////////////////////////////////////
/** Serialize only up data in a buffer */
void serializeUp(FMpiBufferWriter& buffer) const {
buffer << this->dataUp;
}
/** Deserialize only up data in a buffer */
void deserializeUp(FMpiBufferReader& buffer){
buffer >> this->dataUp;
}
/** Serialize only down data in a buffer */
void serializeDown(FMpiBufferWriter& buffer) const {
buffer << this->dataDown;
}
/** Deserialize only up data in a buffer */
void deserializeDown(FMpiBufferReader& buffer){
buffer >> this->dataDown;
}
};
......
......@@ -36,7 +36,7 @@ class FMpiBufferReader {
/** Test and exit if not enought space */
void assertRemainingSpace(const size_t requestedSpace) const {
if(int(currentIndex + requestedSpace) > arrayCapacity){
printf("Error FMpiBufferWriter has not enough space\n");
printf("Error FMpiBufferReader has not enough space\n");
exit(0);
}
}
......
......@@ -19,11 +19,6 @@
#include <string>
#include "../Utils/FGlobal.hpp"
#include "../Containers/FBufferReader.hpp"
#include "../Containers/FBufferWriter.hpp"
#include "../Containers/FMpiBufferReader.hpp"
#include "../Containers/FMpiBufferWriter.hpp"
#include "../Utils/FMath.hpp"
/**
......@@ -251,27 +246,15 @@ public:
}
/** Save current object */
void save(FBufferWriter& buffer) const {
template <class BufferWriterClass>
void save(BufferWriterClass& buffer) const {
buffer << data[0] << data[1] << data[2];
}
/** Retrieve current object */
void restore(FBufferReader& buffer) {
template <class BufferReaderClass>
void restore(BufferReaderClass& buffer) {
buffer >> data[0] >> data[1] >> data[2];
}
/////////////////////////////////////////////////////
/////////////// Test with FMpiBuffer* /////////////
/////////////////////////////////////////////////////
/** Save current object */
void save(FMpiBufferWriter& buffer) const {
buffer << data[0] << data[1] << data[2];
}
/** Retrieve current object */
void restore(FMpiBufferReader& buffer) {
buffer >> data[0] >> data[1] >> data[2];
}
static std::string MortonToBinary(MortonIndex index, int level){
......
......@@ -19,10 +19,6 @@
#include "../Utils/FGlobal.hpp"
#include "../Containers/FTreeCoordinate.hpp"
#include "../Containers/FBufferReader.hpp"
#include "../Containers/FBufferWriter.hpp"
#include "../Containers/FMpiBufferReader.hpp"
#include "../Containers/FMpiBufferWriter.hpp"
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
......@@ -69,27 +65,16 @@ public:
/** Save current object */
void save(FBufferWriter& buffer) const {
template <class BufferWriterClass>
void save(BufferWriterClass& buffer) const {
coordinate.save(buffer);
}
/** Retrieve current object */
void restore(FBufferReader& buffer) {
template <class BufferReaderClass>
void restore(BufferReaderClass& buffer) {
coordinate.restore(buffer);
}
/////////////////////////////////////////////////////
/////////////// Test with FMpiBuffer* /////////////
/////////////////////////////////////////////////////
/** Save current object */
void save(FMpiBufferWriter& buffer) const {
coordinate.save(buffer);
}
/** Retrieve current object */
void restore(FMpiBufferReader& buffer) {
coordinate.restore(buffer);
}
};
......
......@@ -19,11 +19,6 @@
#include "../Utils/FGlobal.hpp"
#include "../Containers/FTreeCoordinate.hpp"
#include "../Containers/FBufferReader.hpp"
#include "../Containers/FBufferWriter.hpp"
#include "../Containers/FMpiBufferReader.hpp"
#include "../Containers/FMpiBufferWriter.hpp"
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
......@@ -62,28 +57,15 @@ public:
}
/** Save current object */
void save(FBufferWriter& buffer) const {
template <class BufferWriterClass>
void save(BufferWriterClass& buffer) const {
buffer << mortonIndex;
}
/** Retrieve current object */
void restore(FBufferReader& buffer) {
template <class BufferReaderClass>
void restore(BufferReaderClass& buffer) {
buffer >> mortonIndex;
}
/////////////////////////////////////////////////////
/////////////// Test with FMpiBuffer* /////////////
/////////////////////////////////////////////////////
/** Save current object */
void save(FMpiBufferWriter& buffer) const {
buffer << mortonIndex;
}
/** Retrieve current object */
void restore(FMpiBufferReader& buffer) {
buffer >> mortonIndex;
}
};
......
......@@ -16,8 +16,6 @@
#ifndef FROTATIONCELL_HPP
#define FROTATIONCELL_HPP
#include "../../Components/FAbstractSerializable.hpp"
#include "../../Components/FAbstractSendable.hpp"
#include "../../Utils/FComplexe.hpp"
#include "../../Utils/FMemUtils.hpp"
......
......@@ -16,9 +16,6 @@
#ifndef FSPHERICALCELL_HPP
#define FSPHERICALCELL_HPP
#include "../../Components/FAbstractSerializable.hpp"
#include "../../Components/FAbstractSendable.hpp"
#include "../../Utils/FComplexe.hpp"
#include "../../Utils/FMemUtils.hpp"
......
......@@ -29,7 +29,6 @@
#include "../../Src/Components/FSimpleLeaf.hpp"
#include "../../Src/Utils/FPoint.hpp"
#include "../../Src/Components/FAbstractSendable.hpp"
#include "../../Src/Components/FTestCell.hpp"
#include "../../Src/Components/FTestKernels.hpp"
......
......@@ -43,8 +43,6 @@
#include "../../Src/Files/FMpiTreeBuilder.hpp"
#include "../../Src/Components/FAbstractSendable.hpp"
/** This program show an example of use of
* the fmm basic algo
......
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