Select Git revision
java15.patch
serializer.h 1.28 KiB
/****************************************************************************
** LinkTest **
*****************************************************************************
** Copyright (c) 2008-2022 **
** Forschungszentrum Juelich, Juelich Supercomputing Centre **
** **
** See the file COPYRIGHT in the package base directory for details **
****************************************************************************/
#ifndef LINKTEST_SERIALIZER
#define LINKTEST_SERIALIZER 1
#include <cstddef>
#include <vector>
#include <string>
class Serializer {
public:
template <class T>
void addDataSource(const std::string& description, T * source, const std::size_t& numElements = 1) {
sources.push_back((void *)source);
bytes.push_back(sizeof(T) * numElements);
descriptions.push_back(description);
}
[[nodiscard]] std::size_t getSize() const;
void write(char * dst, int rank) const;
void read( char * src, int rank) const;
private:
std::vector<void *> sources;
std::vector<size_t> bytes;
std::vector<std::string> descriptions;
};
#endif