Midge
v3.9.2
Data Processing Framework
test
test_typechain.cc
Go to the documentation of this file.
1
#include <iostream>
2
3
#include "
typechain.hh
"
4
5
#include "typename.hh"
6
7
using
std::cout;
8
using
std::endl;
9
10
namespace
midge
11
{
12
namespace
test
13
{
14
template
<
class
x_type,
class
x_index >
15
class
socket
16
{
17
public
:
18
socket
(
const
std::string& p_name )
19
{
20
cout <<
"<"
<< p_name <<
">: creating socket for <"
<< scarab::demangle(
typeid
(x_type).name()) <<
"> at index <"
<< x_index::value <<
">"
<< endl;
21
}
22
~socket
()
23
{
24
}
25
26
};
27
28
template
<
class
... x_types >
29
class
parent
:
30
public
type_chain
< socket< _type, _index >, 0, x_types... >
31
{
32
public
:
33
parent
() :
34
type_chain
<
socket
<
_type
,
_index
>, 0, x_types... >(
"parent_2"
)
35
{
36
}
37
~parent
()
38
{
39
}
40
};
41
42
}
43
}
44
45
using namespace
midge
;
46
using namespace
midge::test
;
47
48
int
main
()
49
{
50
51
parent< char, short, int >
t_parent_one;
52
53
parent< unsigned char, char, unsigned short, short, unsigned int, int, unsigned long, long, float, double >
t_parent_two;
54
55
return
0;
56
57
}
midge::test::parent
Definition:
test_typechain.cc:29
midge::test
Definition:
test_buffer.cc:18
midge
Definition:
_buffer.hh:11
midge::test::socket
Definition:
test_typechain.cc:15
test
test
Definition:
test_buffer.cc:14
midge::type_chain
Template prototype.
Definition:
typechain.hh:45
midge::test::socket::socket
socket(const std::string &p_name)
Definition:
test_typechain.cc:18
midge::_type
The prototype class that gets replaced by a type.
Definition:
typechain.hh:36
midge::test::parent::~parent
~parent()
Definition:
test_typechain.cc:37
midge::test::parent::parent
parent()
Definition:
test_typechain.cc:33
midge::test::socket::~socket
~socket()
Definition:
test_typechain.cc:22
midge::_index
The prototype class that gets replaced by a type index (or rather the struct that wraps a type's inde...
Definition:
typechain.hh:40
main
int main()
Definition:
test_typechain.cc:48
typechain.hh
Generated by
1.8.13