VTK  9.3.1
VTXvtkBase.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
4 /*
5  * VTXvtkBase.h : abstract class for schemas of type
6  * [VTK XML file formats schemas]
7  * (https://vtk.org/wp-content/uploads/2015/04/file-formats.pdf)
8  * Provide common functionality.
9  *
10  * Created on: May 6, 2019
11  * Author: William F Godoy godoywf@ornl.gov
12  */
13 
14 #ifndef VTK_IO_ADIOS2_VTX_SCHEMA_VTK_VTXvtkBase_h
15 #define VTK_IO_ADIOS2_VTX_SCHEMA_VTK_VTXvtkBase_h
16 
17 #include "VTX/common/VTXTypes.h"
18 #include "VTX/schema/VTXSchema.h"
19 
20 #include <map>
21 #include <set>
22 #include <string>
23 #include <vector>
24 
25 namespace vtx
26 {
27 namespace schema
28 {
29 VTK_ABI_NAMESPACE_BEGIN
30 
31 class VTXvtkBase : public VTXSchema
32 {
33 public:
34  VTXvtkBase(
35  const std::string& type, const std::string& schema, adios2::IO& io, adios2::Engine& engine);
36 
37  // can't use = default, due to forward class not defined
38  ~VTXvtkBase() override;
39 
40 protected:
41  std::vector<types::Piece> Pieces;
42 
43  const static std::set<std::string> TIMENames;
44  const static std::set<std::string> SpecialNames;
45  const static std::map<types::DataSetType, std::string> DataSetTypes;
46 
47  void DoFill(vtkMultiBlockDataSet* multiBlock, size_t step) override = 0;
48  void ReadPiece(size_t step, size_t pieceID) override = 0;
49 
50  bool ReadDataSets(types::DataSetType type, size_t step, size_t pieceID);
51 
52  void Init() override = 0;
53  void InitTimes() final;
54 
55  std::string DataSetType(types::DataSetType type) const noexcept;
56 };
57 
58 VTK_ABI_NAMESPACE_END
59 } // end namespace schema
60 } // end namespace vtx
61 
62 #endif /* VTK_IO_ADIOS2_VTX_SCHEMA_VTK_VTXvtkBase_h */
static const std::set< std::string > SpecialNames
Definition: VTXvtkBase.h:44
void ReadPiece(size_t step, size_t pieceID) override=0
void Init() override=0
Abstract common class to supported ADIOS2 schemas.
Definition: VTXSchema.h:31
bool ReadDataSets(types::DataSetType type, size_t step, size_t pieceID)
std::string DataSetType(types::DataSetType type) const noexcept
std::vector< types::Piece > Pieces
Definition: VTXvtkBase.h:41
Composite dataset that organizes datasets into blocks.
static const std::set< std::string > TIMENames
Definition: VTXvtkBase.h:43
VTXvtkBase(const std::string &type, const std::string &schema, adios2::IO &io, adios2::Engine &engine)
static const std::map< types::DataSetType, std::string > DataSetTypes
Definition: VTXvtkBase.h:45
void DoFill(vtkMultiBlockDataSet *multiBlock, size_t step) override=0