File: ADIOSVarInfo.h

package info (click to toggle)
vtk7 7.1.1%2Bdfsg1-12
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 125,776 kB
  • sloc: cpp: 1,539,582; ansic: 106,521; python: 78,038; tcl: 47,013; xml: 8,142; yacc: 5,040; java: 4,439; perl: 3,132; lex: 1,926; sh: 1,500; makefile: 122; objc: 83
file content (70 lines) | stat: -rw-r--r-- 2,009 bytes parent folder | download | duplicates (8)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    ADIOSVarInfo.h

  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
// .NAME ADIOSVarInfo - The utility class wrapping the ADIOS_VARINFO struct

#ifndef _ADIOSVarInfo_h
#define _ADIOSVarInfo_h

#include <string>
#include <vector>

#include <adios_read.h>

//----------------------------------------------------------------------------
namespace ADIOS
{

class VarInfo
{
public:
  // Data structure used to hold block index mapping info
  struct StepBlock
  {
    StepBlock() : Step(-1), Block(-1), BlockId(-1) {}
    StepBlock(int s, int b, int i) : Step(s), Block(b), BlockId(i) { }
    int Step;
    int Block;
    int BlockId;
  };

public:
  VarInfo(ADIOS_FILE *f, ADIOS_VARINFO *v);
  virtual ~VarInfo(void);
  void SetName(const std::string& name) { this->Name = name; }

  const int& GetId() const;
  const ADIOS_DATATYPES& GetType() const;
  const std::string& GetName(void) const;
  size_t GetNumSteps(void) const;
  size_t GetNumBlocks(size_t step) const;
  StepBlock* GetNewestBlockIndex(size_t step, size_t pid) const;
  void GetDims(std::vector<size_t>& dims, size_t step, size_t pid) const;

protected:
  int Id;
  ADIOS_DATATYPES Type;
  std::string Name;
  size_t NumSteps;
  size_t NumPids;
  std::vector<std::vector<size_t> > Dims;

  // This maps the absolute time step and process id to a file-local
  // step and block id for reading
  std::vector<StepBlock*> StepBlockIndex;
};

} // End namespace ADIOS
#endif // _ADIOSVarInfo_h
// VTK-HeaderTest-Exclude: ADIOSVarInfo.h