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 
25 namespace ADIOS
26 {
27 
28 class Attribute
29 {
30 public:
31  Attribute(ADIOS_FILE *f, int id);
32  ~Attribute(void);
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 
46 protected:
47  int Id;
48  ADIOS_DATATYPES Type;
50  void* Value;
51 };
52 template<> const std::string Attribute::GetValue<std::string>() const;
53 
54 } // End namespace ADIOS
55 #endif // _ADIOSAttribute_h
56 // VTK-HeaderTest-Exclude: ADIOSAttribute.h
std::string Name
Attribute(ADIOS_FILE *f, int id)
const std::string & GetName(void) const
const T GetValue() const
static void TestEq(const T &expected, const T &actual, const std::string &msg="")
const ADIOS_DATATYPES & GetType() const
ADIOS_DATATYPES Type
const int & GetId() const