author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Wed, 02 Jul 2008 13:21:56 -0700 | |
changeset 3372 | 184673f59f53 |
parent 1680 | 151684970a80 |
permissions | -rw-r--r-- |
1680
151684970a80
implement the helper IntToType template
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
1 |
#ifndef INT_TO_TYPE_H |
151684970a80
implement the helper IntToType template
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
#define INT_TO_TYPE_H |
151684970a80
implement the helper IntToType template
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
3 |
|
151684970a80
implement the helper IntToType template
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
4 |
namespace ns3 { |
151684970a80
implement the helper IntToType template
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
5 |
|
151684970a80
implement the helper IntToType template
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
6 |
/** |
151684970a80
implement the helper IntToType template
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
7 |
* This trivial template is extremely useful, as explained in |
151684970a80
implement the helper IntToType template
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
8 |
* "Modern C++ Design", p29, section 2.4, |
151684970a80
implement the helper IntToType template
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
9 |
* "Mapping Integral Constants to Types" |
151684970a80
implement the helper IntToType template
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
10 |
*/ |
151684970a80
implement the helper IntToType template
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
11 |
template <int v> |
151684970a80
implement the helper IntToType template
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
12 |
struct IntToType |
151684970a80
implement the helper IntToType template
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
13 |
{ |
3372
184673f59f53
avoid pygccxml warning
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1680
diff
changeset
|
14 |
enum v_e {value = v}; |
1680
151684970a80
implement the helper IntToType template
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
15 |
}; |
151684970a80
implement the helper IntToType template
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
16 |
|
151684970a80
implement the helper IntToType template
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
} // namespace ns3 |
151684970a80
implement the helper IntToType template
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
|
151684970a80
implement the helper IntToType template
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
#endif /* INT_TO_TYPE_H */ |