-
Notifications
You must be signed in to change notification settings - Fork 0
/
MetaTypes_8hpp-source.html
139 lines (129 loc) · 12.2 KB
/
MetaTypes_8hpp-source.html
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<html>
<head>
<meta name="keywords" content="0MQ, ZeroMQ, C++, multipart, message, library, open source, ZmqMessage" />
<meta name="description" content="ZmqMessage is free open source C++ library for sending and receiving ZeroMQ multipart messages"/>
<meta name="google-site-verification" content="0EvtpfjffSrc0fDV9ubKQVfq3IV55KY5d59hXHg9M34" />
<title>ZmqMessage: include/zmqmessage/MetaTypes.hpp Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<style>
/* must override a few items to get the style background color */
</style>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-25607292-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<table class="zm_headbar">
<tr>
<td>
<span><a href="index.html">Overview</a></span>
<span><a href="zm_tutorial.html">Tutorial</a></span>
<span><a href="namespaceZmqMessage.html">API reference</a></span>
<span><a href="examples.html">Examples</a></span>
<span><a href="zm_build.html">Build</a></span>
<span><a href="https://github.com/zmqmessage/zmqmessage/">Download</a></span>
</td>
<td align="right" class="zm_greynote">ZmqMessage 0.1 - 21 Oct 2011</td>
</tr></table>
<hr style="height: 3px;">
<!-- Generated by Doxygen 1.4.7 -->
<h1>include/zmqmessage/MetaTypes.hpp</h1><a href="MetaTypes_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
<a name="l00009"></a>00009 <span class="preprocessor">#ifndef ZMQMESSAGE_METATYPES_HPP_</span>
<a name="l00010"></a>00010 <span class="preprocessor"></span><span class="preprocessor">#define ZMQMESSAGE_METATYPES_HPP_</span>
<a name="l00011"></a>00011 <span class="preprocessor"></span>
<a name="l00012"></a>00012 <span class="keyword">namespace </span>ZmqMessage
<a name="l00013"></a>00013 {
<a name="l00019"></a>00019 <span class="keyword">namespace </span>Private
<a name="l00020"></a>00020 {
<a name="l00021"></a>00021 <span class="keyword">template</span> <<span class="keywordtype">bool</span>, <span class="keyword">class</span> T = <span class="keywordtype">void</span>>
<a name="l00022"></a><a class="code" href="structZmqMessage_1_1Private_1_1EnableIf.html">00022</a> <span class="keyword">struct </span><a class="code" href="structZmqMessage_1_1Private_1_1EnableIf.html">EnableIf</a> {};
<a name="l00023"></a>00023
<a name="l00024"></a>00024 <span class="keyword">template</span> <<span class="keyword">class</span> T>
<a name="l00025"></a><a class="code" href="structZmqMessage_1_1Private_1_1EnableIf_3_01true_00_01T_01_4.html#85839119ec58cbd219720d07ba676906">00025</a> <span class="keyword">struct </span><a class="code" href="structZmqMessage_1_1Private_1_1EnableIf.html">EnableIf</a><true, T> { <span class="keyword">typedef</span> T type; };
<a name="l00026"></a>00026
<a name="l00027"></a>00027 <span class="keyword">template</span> <<span class="keywordtype">bool</span>, <span class="keyword">class</span> T = <span class="keywordtype">void</span>>
<a name="l00028"></a><a class="code" href="structZmqMessage_1_1Private_1_1DisableIf.html">00028</a> <span class="keyword">struct </span><a class="code" href="structZmqMessage_1_1Private_1_1DisableIf.html">DisableIf</a> {};
<a name="l00029"></a>00029
<a name="l00030"></a>00030 <span class="keyword">template</span> <<span class="keyword">class</span> T>
<a name="l00031"></a><a class="code" href="structZmqMessage_1_1Private_1_1DisableIf_3_01false_00_01T_01_4.html#1508e5ee30909855ea9ea176df0ba4c3">00031</a> <span class="keyword">struct </span><a class="code" href="structZmqMessage_1_1Private_1_1DisableIf.html">DisableIf</a><false, T> { <span class="keyword">typedef</span> T type; };
<a name="l00032"></a>00032
<a name="l00033"></a>00033 <span class="keyword">template</span> <<span class="keyword">class</span> T>
<a name="l00034"></a><a class="code" href="structZmqMessage_1_1Private_1_1IsStr.html">00034</a> <span class="keyword">struct </span><a class="code" href="structZmqMessage_1_1Private_1_1IsStr.html">IsStr</a>
<a name="l00035"></a>00035 {
<a name="l00036"></a><a class="code" href="structZmqMessage_1_1Private_1_1IsStr.html#c702a4daaa937abd1f0e19c937eff080">00036</a> <span class="keyword">typedef</span> <span class="keywordtype">char</span> <a class="code" href="structZmqMessage_1_1Private_1_1IsStr.html#c702a4daaa937abd1f0e19c937eff080">Yes</a>;
<a name="l00037"></a><a class="code" href="structZmqMessage_1_1Private_1_1IsStr_1_1No.html#a6d057dd924b911f2942cbc875bd4481">00037</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ <span class="keywordtype">char</span> c[2]; } <a class="code" href="structZmqMessage_1_1Private_1_1IsStr_1_1No.html">No</a>;
<a name="l00038"></a>00038
<a name="l00039"></a>00039 <span class="keyword">template</span> <<span class="keyword">typename</span> U, size_t (U::*LengthFn)() const = &U::length>
<a name="l00040"></a>00040 <span class="keyword">struct </span>LengthTraits;
<a name="l00041"></a>00041 <span class="keyword">template</span> <<span class="keyword">typename</span> U, const <span class="keywordtype">char</span>* (U::*DataFn)() const = &U::data>
<a name="l00042"></a>00042 <span class="keyword">struct </span>DataTraits;
<a name="l00043"></a>00043
<a name="l00044"></a>00044 <span class="keyword">template</span> <<span class="keyword">typename</span> U>
<a name="l00045"></a>00045 <span class="keyword">static</span> <a class="code" href="structZmqMessage_1_1Private_1_1IsStr_1_1No.html">No</a> <a class="code" href="structZmqMessage_1_1Private_1_1IsStr.html#99c818fcbf774fa2655966c37fa83f86">check_str</a>(...);
<a name="l00046"></a>00046
<a name="l00047"></a>00047 <span class="keyword">template</span> <<span class="keyword">typename</span> U>
<a name="l00048"></a>00048 <span class="keyword">static</span> <a class="code" href="structZmqMessage_1_1Private_1_1IsStr.html#c702a4daaa937abd1f0e19c937eff080">Yes</a> <a class="code" href="structZmqMessage_1_1Private_1_1IsStr.html#99c818fcbf774fa2655966c37fa83f86">check_str</a>(LengthTraits<U>*, DataTraits<U>*);
<a name="l00049"></a>00049
<a name="l00050"></a><a class="code" href="structZmqMessage_1_1Private_1_1IsStr.html#54e78d28d252b207dcfcb8d56d0f37d0">00050</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> <a class="code" href="structZmqMessage_1_1Private_1_1IsStr.html#54e78d28d252b207dcfcb8d56d0f37d0">value</a> = (<span class="keyword">sizeof</span>(check_str<T>(0, 0)) == <span class="keyword">sizeof</span>(<a class="code" href="structZmqMessage_1_1Private_1_1IsStr.html#c702a4daaa937abd1f0e19c937eff080">Yes</a>));
<a name="l00051"></a>00051 };
<a name="l00052"></a>00052
<a name="l00053"></a>00053 <span class="keyword">template</span> <<span class="keyword">class</span> T>
<a name="l00054"></a><a class="code" href="structZmqMessage_1_1Private_1_1IsRaw.html">00054</a> <span class="keyword">struct </span><a class="code" href="structZmqMessage_1_1Private_1_1IsRaw.html">IsRaw</a>
<a name="l00055"></a>00055 {
<a name="l00056"></a><a class="code" href="structZmqMessage_1_1Private_1_1IsRaw.html#4c9260e9c59726d360e272fd83c02a41">00056</a> <span class="keyword">typedef</span> <span class="keywordtype">char</span> <a class="code" href="structZmqMessage_1_1Private_1_1IsRaw.html#4c9260e9c59726d360e272fd83c02a41">Yes</a>;
<a name="l00057"></a><a class="code" href="structZmqMessage_1_1Private_1_1IsRaw_1_1No.html#7d7505f44fe1a9eae126b11b0ad7a964">00057</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ <span class="keywordtype">char</span> c[2]; } <a class="code" href="structZmqMessage_1_1Private_1_1IsRaw_1_1No.html">No</a>;
<a name="l00058"></a>00058
<a name="l00059"></a>00059 <span class="keyword">template</span> <<span class="keyword">typename</span> U>
<a name="l00060"></a>00060 <span class="keyword">static</span> <a class="code" href="structZmqMessage_1_1Private_1_1IsRaw_1_1No.html">No</a> <a class="code" href="structZmqMessage_1_1Private_1_1IsRaw.html#6e04ddee07ac828aeafc5d88977aa029">check_mark</a>(...);
<a name="l00061"></a>00061
<a name="l00062"></a>00062 <span class="keyword">template</span> <<span class="keyword">typename</span> U>
<a name="l00063"></a>00063 <span class="keyword">static</span> <a class="code" href="structZmqMessage_1_1Private_1_1IsRaw.html#4c9260e9c59726d360e272fd83c02a41">Yes</a> <a class="code" href="structZmqMessage_1_1Private_1_1IsRaw.html#6e04ddee07ac828aeafc5d88977aa029">check_mark</a>(<span class="keyword">typename</span> U::raw_mark* = 0);
<a name="l00064"></a>00064
<a name="l00065"></a><a class="code" href="structZmqMessage_1_1Private_1_1IsRaw.html#bea1d345db5eda4c62c7ba7609d1c0ee">00065</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> <a class="code" href="structZmqMessage_1_1Private_1_1IsRaw.html#bea1d345db5eda4c62c7ba7609d1c0ee">value</a> = (<span class="keyword">sizeof</span>(check_mark<T>(0)) == <span class="keyword">sizeof</span>(<a class="code" href="structZmqMessage_1_1Private_1_1IsRaw.html#4c9260e9c59726d360e272fd83c02a41">Yes</a>));
<a name="l00066"></a>00066 };
<a name="l00067"></a>00067 }
<a name="l00068"></a>00068 }
<a name="l00069"></a>00069
<a name="l00076"></a><a class="code" href="MetaTypes_8hpp.html#708fa0f56f2cde439b40a924f99be335">00076</a> <span class="preprocessor">#define ZMQMESSAGE_BINARY_TYPE(type_name) \</span>
<a name="l00077"></a>00077 <span class="preprocessor">namespace ZmqMessage \</span>
<a name="l00078"></a>00078 <span class="preprocessor">{ \</span>
<a name="l00079"></a>00079 <span class="preprocessor"> namespace Private \</span>
<a name="l00080"></a>00080 <span class="preprocessor"> { \</span>
<a name="l00081"></a>00081 <span class="preprocessor"> template <> \</span>
<a name="l00082"></a>00082 <span class="preprocessor"> struct IsRaw<type_name> \</span>
<a name="l00083"></a>00083 <span class="preprocessor"> { \</span>
<a name="l00084"></a>00084 <span class="preprocessor"> static const bool value = true; \</span>
<a name="l00085"></a>00085 <span class="preprocessor"> }; \</span>
<a name="l00086"></a>00086 <span class="preprocessor"> } \</span>
<a name="l00087"></a>00087 <span class="preprocessor">}</span>
<a name="l00088"></a>00088 <span class="preprocessor"></span>
<a name="l00095"></a><a class="code" href="MetaTypes_8hpp.html#0a4d424739f1cd0a10687051060289ed">00095</a> <span class="preprocessor">#define ZMQMESSAGE_TEXT_TYPE(type_name) \</span>
<a name="l00096"></a>00096 <span class="preprocessor">namespace ZmqMessage \</span>
<a name="l00097"></a>00097 <span class="preprocessor">{ \</span>
<a name="l00098"></a>00098 <span class="preprocessor"> namespace Private \</span>
<a name="l00099"></a>00099 <span class="preprocessor"> { \</span>
<a name="l00100"></a>00100 <span class="preprocessor"> template <> \</span>
<a name="l00101"></a>00101 <span class="preprocessor"> struct IsRaw<type_name> \</span>
<a name="l00102"></a>00102 <span class="preprocessor"> { \</span>
<a name="l00103"></a>00103 <span class="preprocessor"> static const bool value = false; \</span>
<a name="l00104"></a>00104 <span class="preprocessor"> }; \</span>
<a name="l00105"></a>00105 <span class="preprocessor"> } \</span>
<a name="l00106"></a>00106 <span class="preprocessor">}</span>
<a name="l00107"></a>00107 <span class="preprocessor"></span>
<a name="l00108"></a>00108
<a name="l00109"></a>00109
<a name="l00110"></a>00110 <span class="preprocessor">#endif </span><span class="comment">/* ZMQMESSAGE_METATYPES_HPP_ */</span>
</pre></div>
<hr style="height: 3px;">
<div class="zm_greynote">
ZmqMessage 0.1 — open source software, <a href="mailto:[email protected]">[email protected]</a>
</div>
</body>
</html>