Skip to content
Snippets Groups Projects
Variable.h 1.33 KiB
Newer Older
 * Distributed under the OSI-approved Apache License, Version 2.0.  See
 * accompanying file Copyright.txt for details.
 *
 * Variable.h : template class for self-describing primitive variables
 *
 *  Created on: Oct 6, 2016
 *      Author: William F Godoy
#ifndef ADIOS2_CORE_VARIABLE_H_
#define ADIOS2_CORE_VARIABLE_H_

/// \cond EXCLUDE_FROM_DOXYGEN
wfg's avatar
wfg committed
#include <map>
#include <ostream> //std::ostream in MonitorGroups
#include <string>
#include <vector>
#include "adios2/ADIOSTypes.h"
#include "adios2/core/VariableBase.h"
namespace adios2
 * @param Base (parent) class for template derived (child) class Variable.
template <class T>
class Variable : public VariableBase
    typename TypeInfo<T>::ValueType m_Min;
    typename TypeInfo<T>::ValueType m_Max;
    typename TypeInfo<T>::ValueType m_Value;

    Variable<T>(const std::string &name, const Dims &shape, const Dims &start,
                const Dims &count, const bool constantShape, T *data,
                const bool debugMode);
    ~Variable<T>() = default;

    T *GetData() const noexcept;

    void SetData(const T *) noexcept;

private:
    /** TODO: used for allocating memory from ADIOS2 */
    std::vector<T> m_AllocatedData;

    /** reference to data */
    T *m_Data = nullptr;
} // end namespace adios2
#endif /* ADIOS2_CORE_VARIABLE_H_ */