summaryrefslogtreecommitdiff
path: root/bin/Hash_Map_Manager_Helper
blob: f65cd5846847c54c8ce3bdcbedc7bec7aa5a9a7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#! /bin/sh

#
# $Id$
#

#
# This script uses Hash_Map_Manager.pl.
#

#
# This script helps in fixing the template instantiations changes
# required by the new design of ACE_Hash_Map_Manager.  
#
# Note that this script is not a 100% fool proof: 
#
# (a) It uses commas to delimit the types in ACE_Hash_Map_Manager<X,
# Y, Z>.  If X, Y, or Z are complicated types containing commas (e.g.,
# T<a, b>), this script will not work. Also, all template parameters
# are assumed to be on the same line.
#
# In the case where this script will not work, here are the cookbook,
# do-it-yourself instructions: 
#
# ACE_Hash_Map_Entry<X, Y>
#
# changes to:
#
# ACE_Hash_Map_Entry<X, Y>
# ACE_Hash<X>
# ACE_Equal_To<X>
#
#
# ACE_Hash_Map_Iterator_Base<X, Y, Z>
#
# changes to:
#
# ACE_Hash_Map_Iterator_Base_Ex<X, Y, ACE_Hash<X>, ACE_Equal_To<X>, Z>
#
#
# ACE_Hash_Map_Manager<X, Y, Z>
#
# changes to:
#
# ACE_Hash_Map_Manager<X, Y, Z>
# ACE_Hash_Map_Manager_Ex<X, Y, ACE_Hash<X>, ACE_Equal_To<X>, Z>
#
#
# ACE_Hash_Map_Iterator<X, Y, Z>
#
# changes to:
#
# ACE_Hash_Map_Iterator<X, Y, Z>
# ACE_Hash_Map_Iterator_Ex<X, Y, ACE_Hash<X>, ACE_Equal_To<X>, Z>
#
#
# ACE_Hash_Map_Reverse_Iterator<X, Y, Z>
#
# changes to:
#
# ACE_Hash_Map_Reverse_Iterator<X, Y, Z>
# ACE_Hash_Map_Reverse_Iterator_Ex<X, Y, ACE_Hash<X>, ACE_Equal_To<X>, Z>


# (b) The second problem is for g++ users (version lower than
# 2.8). g++ is broken such that if you explicitly instantiate
# templates, it will ignore template specialization.  Therefore if you
# are using the template instantiation provided in ACE for ACE_Hash
# and ACE_Equal_To, don't instantiate those templates.

for file in `find . -type f \( -name "*.i" -o -name "*.h" -o -name "*.cpp" \) -print | xargs egrep -l "template[ \t]*class[ \t]*ACE_Hash_Map_Manager"`
do
    echo Fixing template instantiations in $file
    perl $ACE_ROOT/bin/Hash_Map_Manager.pl $file > $file.new
    mv $file.new $file
done