Orfeo Toolbox  3.16
itkSmapsFileParser.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkSmapsFileParser.h,v $
5  Language: C++
6  Date: $Date: 2008-10-24 18:11:22 $
7  Version: $Revision: 1.1 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkSmapsFileParser_h
18 #define __itkSmapsFileParser_h
19 
20 #include "itkConfigure.h"
21 #include "itkWin32Header.h"
22 #include "itkExceptionObject.h"
23 
24 #include <string>
25 #include <vector>
26 #include <map>
27 #include <istream>
28 #include <iostream>
29 
30 namespace itk {
31 
32 
39 {
40 public:
41  typedef unsigned int MemoryLoadType;
42  virtual ~MapRecord();
45  void Reset(void);
46 
49  std::string m_RecordName;
50 
55  std::map<std::string, MemoryLoadType> m_Tokens;
56 
57 };
58 
64 {
81  friend ITKCommon_EXPORT std::istream& operator>>(std::istream &in, SmapsRecord &record);
82 };
83 
89 {
95  friend ITKCommon_EXPORT std::istream& operator>>(std::istream &in, VMMapSummaryRecord &record);
96 };
97 
103 {
109  friend ITKCommon_EXPORT std::istream& operator>>(std::istream &in, VMMapRecord &record);
110 };
111 
120 {
121 public:
123  typedef unsigned long MemoryLoadType;
124  //todo delete records
125  virtual ~MapData();
126 
128  virtual MemoryLoadType GetHeapUsage() = 0;
130  virtual MemoryLoadType GetStackUsage() = 0;
132  virtual MemoryLoadType GetTotalMemoryUsage();
134  virtual MemoryLoadType GetMemoryUsage( const char * filter, const char * token );
135 
137  bool Empty();
138 protected:
140  void Reset(void);
141 protected:
142  typedef std::vector< MapRecord* > MapRecordVectorType;
143 
146 };
147 
153 {
154 public:
156 
157  virtual ~SmapsData_2_6();
158 
160  virtual MemoryLoadType GetHeapUsage();
162  virtual MemoryLoadType GetStackUsage();
163 
165  friend ITKCommon_EXPORT std::istream& operator>>( std::istream &smapsStream,
166  SmapsData_2_6 &data);
167 
168 protected:
170 };
171 
178 {
179 public:
181  VMMapData_10_2();
182  virtual ~VMMapData_10_2();
183 
185  virtual MemoryLoadType GetHeapUsage();
187  virtual MemoryLoadType GetStackUsage();
188 
190  friend ITKCommon_EXPORT std::istream& operator>>( std::istream &stream,
191  VMMapData_10_2 &data);
192 protected:
194 };
195 
196 
202 template<class TMapData>
204 {
205 public:
206  typedef typename TMapData::MemoryLoadType MemoryLoadType;
207 
208  virtual ~MapFileParser();
213  virtual void ReadFile( const std::string &mapFileLocation = "") = 0;
217  bool Update(void);
218 
222  MemoryLoadType GetHeapUsage();
226  MemoryLoadType GetStackUsage();
230  MemoryLoadType GetTotalMemoryUsage();
234  MemoryLoadType GetMemoryUsage( const char* filter , const char * token = "Size" );
235 
236 protected:
237  std::string m_MapFilePath; //< location of the last loaded Map file
238  TMapData m_MapData; //< data of the loaded smap file
239 };
240 
246 template<class TSmapsDataType>
247 class ITK_EXPORT SmapsFileParser: public MapFileParser<TSmapsDataType>
248 {
249 public:
250  virtual ~SmapsFileParser();
256  virtual void ReadFile( const std::string &mapFileLocation = "");
257 
258 };
259 
264 template<class TVMMapDataType>
265 class ITK_EXPORT VMMapFileParser: public MapFileParser<TVMMapDataType>
266 {
267 public:
268  virtual ~VMMapFileParser();
272  virtual void ReadFile( const std::string &mapFileLocation = "");
273 
274 };
275 
276 } // end namespace itk
277 
278 #ifndef ITK_MANUAL_INSTANTIATION
279 #include "itkSmapsFileParser.txx"
280 #endif
281 
282 #endif // __itkSmapsFileParser_h

Generated at Sun May 19 2013 00:08:10 for Orfeo Toolbox with doxygen 1.8.3.1