vtkPVMemoryUseInformation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: $RCSfile$
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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 =========================================================================*/
22 #ifndef vtkPVMemoryUseInformation_h
23 #define vtkPVMemoryUseInformation_h
24 
25 #include "vtkPVInformation.h"
26 
27 #include <vector> // needed for std::vector
28 using std::vector;
29 
31 
33 {
34 public:
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
42  void CopyFromObject(vtkObject*) override;
43 
47  void AddInformation(vtkPVInformation*) override;
48 
50 
53  void CopyToStream(vtkClientServerStream*) override;
54  void CopyFromStream(const vtkClientServerStream*) override;
56 
60  size_t GetSize() { return this->MemInfos.size(); }
61  int GetProcessType(size_t i) { return this->MemInfos[i].ProcessType; }
62  int GetRank(size_t i) { return this->MemInfos[i].Rank; }
63  long long GetProcMemoryUse(size_t i) { return this->MemInfos[i].ProcMemUse; }
64  long long GetHostMemoryUse(size_t i) { return this->MemInfos[i].HostMemUse; }
65 
66 protected:
68  ~vtkPVMemoryUseInformation() override;
69 
70 private:
71  class MemInfo
72  {
73  public:
74  MemInfo()
75  : ProcessType(-1)
76  , Rank(0)
77  , ProcMemUse(0)
78  , HostMemUse(0)
79  {
80  }
81  void Print();
82 
83  int ProcessType;
84  int Rank;
85  long long ProcMemUse;
86  long long HostMemUse;
87  };
88  vector<MemInfo> MemInfos;
89 
91  void operator=(const vtkPVMemoryUseInformation&) = delete;
92 };
93 
94 #endif
virtual void CopyFromStream(const vtkClientServerStream *)
Manage a serialized version of the information.
void PrintSelf(ostream &os, vtkIndent indent) override
A vtkClientServerStream serializable container for a single process&#39;s instantaneous memory usage...
Store messages for the interpreter.
#define VTKREMOTINGCORE_EXPORT
virtual void AddInformation(vtkPVInformation *)
Merge another information object.
virtual void CopyToStream(vtkClientServerStream *)=0
Manage a serialized version of the information.
virtual void CopyFromObject(vtkObject *)
Transfer information about a single object into this object.
static vtkObject * New()
size_t GetSize()
access the managed information.
Superclass for information objects.