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 71 72 73 74 75 76 77 78
|
/*=========================================================================
Program: Visualization Toolkit
Module: vtkADIOSDirTree.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.
=========================================================================*/
/**
* @class vtkADIOSDirTree
* @brief A directory tree structure holding ADIOS data
*/
#ifndef vtkADIOSDirTree_h
#define vtkADIOSDirTree_h
#include <map>
#include <string>
#include <vector>
#include "vtkIndent.h"
#include "ADIOSReader.h"
#include "ADIOSScalar.h"
#include "ADIOSVarInfo.h"
class vtkADIOSDirTree
{
public:
vtkADIOSDirTree(const std::string& name);
vtkADIOSDirTree(const ADIOS::Reader &reader);
~vtkADIOSDirTree();
const std::string& GetName() const { return this->Name; }
void PrintSelf(std::ostream& os, vtkIndent indent) const;
/**
* Access a subdirectory
*/
const vtkADIOSDirTree* GetDir(const std::string& dirName) const;
//@{
/**
* Access variables by name
*/
const ADIOS::Scalar* GetScalar(const std::string& varName) const;
const ADIOS::VarInfo* GetArray(const std::string& varName) const;
//@}
//@{
/**
* Access variables all at once
*/
void GetScalars(std::vector<const ADIOS::Scalar*>& vars) const;
void GetArrays(std::vector<const ADIOS::VarInfo*>& vars) const;
//@}
private:
vtkADIOSDirTree* BuildPath(const std::vector<std::string>& path,
size_t startIdx, size_t numComponents);
const vtkADIOSDirTree* GetDir(const std::vector<std::string>& path,
size_t pIdx) const;
const std::string Name;
std::map<std::string, const ADIOS::Scalar*> Scalars;
std::map<std::string, const ADIOS::VarInfo*> Arrays;
std::map<std::string, vtkADIOSDirTree*> SubDirs;
};
#endif
// VTK-HeaderTest-Exclude: vtkADIOSDirTree.h
|