VTK  9.3.20240422
vtkXdmf3ArrayKeeper.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
16#ifndef vtkXdmf3ArrayKeeper_h
17#define vtkXdmf3ArrayKeeper_h
18
19#include "vtkIOXdmf3Module.h" // For export macro
20#include <map>
21
22class XdmfArray;
23
24VTK_ABI_NAMESPACE_BEGIN
25
26#ifdef _MSC_VER
27#pragma warning(push) // save
28#pragma warning(disable : 4251) // needs to have dll-interface to be used by clients of class
29#endif
30class VTKIOXDMF3_EXPORT vtkXdmf3ArrayKeeper : public std::map<XdmfArray*, unsigned int>
31{
32public:
37
42
47
51 void Insert(XdmfArray* val);
52
57 void Release(bool force);
58
60
61private:
62 unsigned int generation;
63};
64#ifdef _MSC_VER
65#pragma warning(pop) // restore
66#endif
67
68VTK_ABI_NAMESPACE_END
69#endif // vtkXdmf3ArrayKeeper_h
70// VTK-HeaderTest-Exclude: vtkXdmf3ArrayKeeper.h
LRU cache of XDMF Arrays.
~vtkXdmf3ArrayKeeper()
Destructor.
void Insert(XdmfArray *val)
Call whenever you a new XDMF array is accessed.
void Release(bool force)
Call to free all open arrays that are currently open but not in use.
void BumpGeneration()
Call to mark arrays that will be accessed with a new timestamp.
vtkXdmf3ArrayKeeper(const vtkXdmf3ArrayKeeper &)=delete
vtkXdmf3ArrayKeeper()
Constructor.