~raghavendra-prabhu/percona-xtradb-cluster/release-5.5.30-galera-2.x

« back to all changes in this revision

Viewing changes to galerautils/src/gu_serialize.hpp

  • Committer: Raghavendra D Prabhu
  • Date: 2013-04-12 15:26:34 UTC
  • mfrom: (95.2.24 2.x)
  • Revision ID: raghavendra.prabhu@percona.com-20130412152634-2y2u0swshf5fie2x
Merge lp:galera-2.x upto revision 150.

Following bugs are fixed:

lp:1166065
lp:1164992

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
    template <typename TO, typename FROM>
62
62
    inline size_t
63
63
    __private_serialize(const FROM& f,
64
 
                           byte_t* const buf, size_t const buflen, size_t const offset)
65
 
        throw (Exception)
 
64
                        byte_t* const buf, size_t const buflen, size_t const offset)
 
65
 
66
66
    {
67
67
        BOOST_STATIC_ASSERT(std::numeric_limits<TO>::is_integer);
68
68
        BOOST_STATIC_ASSERT(std::numeric_limits<FROM>::is_integer);
77
77
    template <typename FROM, typename TO>
78
78
    inline size_t
79
79
    __private_unserialize(const byte_t* const buf, size_t const buflen, size_t const offset,
80
 
                             TO& t)
81
 
        throw (Exception)
 
80
                          TO& t)
82
81
    {
83
82
        BOOST_STATIC_ASSERT(std::numeric_limits<TO>::is_integer);
84
83
        BOOST_STATIC_ASSERT(std::numeric_limits<FROM>::is_integer);
94
93
                                      byte_t* const buf,
95
94
                                      size_t  const buflen,
96
95
                                      size_t  const offset)
97
 
        throw (Exception)
98
96
    {
99
97
        return __private_serialize<uint8_t>(t, buf, buflen, offset);
100
98
    }
104
102
                                        size_t const buflen,
105
103
                                        size_t const offset,
106
104
                                        T& t)
107
 
        throw (Exception)
108
105
    {
109
106
        return __private_unserialize<uint8_t>(buf, buflen, offset, t);
110
107
    }
114
111
                                      byte_t* const buf,
115
112
                                      size_t  const buflen,
116
113
                                      size_t  const offset)
117
 
        throw (Exception)
118
114
    {
119
115
        return __private_serialize<uint16_t>(t, buf, buflen, offset);
120
116
    }
124
120
                                        size_t const buflen,
125
121
                                        size_t const offset,
126
122
                                        T& t)
127
 
        throw (Exception)
128
123
    {
129
124
        return __private_unserialize<uint16_t>(buf, buflen, offset, t);
130
125
    }
134
129
                                      byte_t* const buf,
135
130
                                      size_t  const buflen,
136
131
                                      size_t  const offset)
137
 
        throw (Exception)
138
132
    {
139
133
        return __private_serialize<uint32_t>(t, buf, buflen, offset);
140
134
    }
144
138
                                        size_t const buflen,
145
139
                                        size_t const offset,
146
140
                                        T& t)
147
 
        throw (Exception)
148
141
    {
149
142
        return __private_unserialize<uint32_t>(buf, buflen, offset, t);
150
143
    }
154
147
                                      byte_t* const buf,
155
148
                                      size_t  const buflen,
156
149
                                      size_t  const offset)
157
 
        throw (Exception)
158
150
    {
159
151
        return __private_serialize<uint64_t>(t, buf, buflen, offset);
160
152
    }
164
156
                                        size_t const buflen,
165
157
                                        size_t const offset,
166
158
                                        T& t)
167
 
        throw (Exception)
168
159
    {
169
160
        return __private_unserialize<uint64_t>(buf, buflen, offset, t);
170
161
    }