VTK
ADIOSAttribute.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: ADIOSAttribute.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15#ifndef _ADIOSAttribute_h
16#define _ADIOSAttribute_h
17
18#include <string>
19#include <vector>
20
21#include <adios_read.h>
22
23#include "ADIOSUtilities.h"
24
25namespace ADIOS
26{
27
29{
30public:
31 Attribute(ADIOS_FILE *f, int id);
33
34 const int& GetId() const;
35 const ADIOS_DATATYPES& GetType() const;
36 const std::string& GetName(void) const;
37
38 template<typename T>
39 const T GetValue() const
40 {
41 ReadError::TestEq(this->Type, Type::NativeToADIOS<T>(), "Invalid type");
42
43 return *reinterpret_cast<const T*>(this->Value);
44 }
45
46protected:
47 int Id;
48 ADIOS_DATATYPES Type;
50 void* Value;
51};
52template<> const std::string Attribute::GetValue<std::string>() const;
53
54} // End namespace ADIOS
55#endif // _ADIOSAttribute_h
56// VTK-HeaderTest-Exclude: ADIOSAttribute.h
ADIOS_DATATYPES Type
const T GetValue() const
Attribute(ADIOS_FILE *f, int id)
const int & GetId() const
const std::string & GetName(void) const
const ADIOS_DATATYPES & GetType() const
std::string Name
static void TestEq(const T &expected, const T &actual, const std::string &msg="")
@ string
Definition: vtkX3D.h:490