VTK
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
dox
Common
vtkInformationInternals.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkInformationInternals.h
5
6
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7
All rights reserved.
8
See Copyright.txt or http://www.kitware.com/Copyright.htm 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
=========================================================================*/
23
#ifndef __vtkInformationInternals_h
24
#define __vtkInformationInternals_h
25
26
#include "
vtkInformationKey.h
"
27
#include "
vtkObjectBase.h
"
28
29
#define VTK_INFORMATION_USE_HASH_MAP
30
#ifdef VTK_INFORMATION_USE_HASH_MAP
31
# include <vtksys/hash_map.hxx>
32
#else
33
# include <vtksys/stl/map>
34
#endif
35
36
//----------------------------------------------------------------------------
37
class
vtkInformationInternals
38
{
39
public
:
40
typedef
vtkInformationKey
*
KeyType
;
41
typedef
vtkObjectBase
*
DataType
;
42
#ifdef VTK_INFORMATION_USE_HASH_MAP
43
struct
HashFun
44
{
45
size_t
operator()
(
KeyType
key
)
const
46
{
47
return
static_cast<
size_t
>
(key -
KeyType
(0));
48
}
49
};
50
typedef
vtksys::hash_map<KeyType, DataType, HashFun>
MapType
;
51
#else
52
typedef
vtksys_stl::map<KeyType, DataType>
MapType
;
53
#endif
54
MapType
Map
;
55
56
#ifdef VTK_INFORMATION_USE_HASH_MAP
57
vtkInformationInternals
():
Map
(33) {}
58
#endif
59
60
~vtkInformationInternals
()
61
{
62
for
(MapType::iterator i = this->
Map
.begin(); i != this->
Map
.end(); ++i)
63
{
64
if
(
vtkObjectBase
*
value
= i->second)
65
{
66
value
->UnRegister(0);
67
}
68
}
69
}
70
};
71
72
#undef VTK_INFORMATION_USE_HASH_MAP
73
74
#endif
Generated on Thu Mar 13 2014 08:09:45 for VTK by
1.8.1.2