Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
/*
* Distributed under the OSI-approved Apache License, Version 2.0. See
* accompanying file Copyright.txt for details.
*
* ExampleEnginePlugin.h This plugin does nothing but write API calls out to a
* log file.
*
* Created on: Jul 31, 2017
* Author: Chuck Atkins <chuck.atkins@kitware.com>
*/
#ifndef EXAMPLEENGINEPLUGIN_H_
#define EXAMPLEENGINEPLUGIN_H_
#include <fstream>
#include <string>
#include <adios2/ADIOSMPICommOnly.h>
#include <adios2/ADIOSMacros.h>
#include <adios2/ADIOSTypes.h>
#include <adios2/core/IO.h>
#include <adios2/engine/plugin/PluginEngineInterface.h>
namespace adios2
{
/** An engine interface to be used aby the plugin infrastructure */
class ExampleEnginePlugin : public PluginEngineInterface
{
public:
ExampleEnginePlugin(IO &io, const std::string &name,
const OpenMode openMode, MPI_Comm mpiComm);
virtual ~ExampleEnginePlugin();
void Close(const int transportIndex = -1) override;
protected:
void Init() override;
#define declare(T) \
void DoWrite(Variable<T> &variable, const T *values) override;
ADIOS2_FOREACH_TYPE_1ARG(declare)
#undef declare
void DoWrite(VariableCompound &variable, const void *values) override;
private:
std::ofstream m_Log;
};
} // end namespace adios2
#endif /* EXAMPLEENGINEPLUGIN_H_ */