@@ -40,51 +40,51 @@ namespace sio
40
40
virtual int64_t get_int () const
41
41
{
42
42
assert (false );
43
- return 0 ;
43
+ return 0 ;
44
44
}
45
45
46
46
virtual double get_double () const
47
47
{
48
48
assert (false );
49
- return 0 ;
49
+ return 0 ;
50
50
}
51
51
52
52
virtual string const & get_string () const
53
53
{
54
54
assert (false );
55
55
static string s_empty_string;
56
- s_empty_string.clear ();
56
+ s_empty_string.clear ();
57
57
return s_empty_string;
58
58
}
59
59
60
60
virtual shared_ptr<const string> const & get_binary () const
61
61
{
62
62
assert (false );
63
63
static shared_ptr<const string> s_empty_binary;
64
- s_empty_binary = nullptr ;
65
- return s_empty_binary;
64
+ s_empty_binary = nullptr ;
65
+ return s_empty_binary;
66
66
}
67
67
68
68
virtual const vector<ptr>& get_vector () const
69
69
{
70
70
assert (false );
71
- static vector<ptr> s_empty_vector;
71
+ static vector<ptr> s_empty_vector;
72
72
s_empty_vector.clear ();
73
- return s_empty_vector;
73
+ return s_empty_vector;
74
74
}
75
75
76
76
virtual vector<ptr>& get_vector ()
77
77
{
78
78
assert (false );
79
- static vector<ptr> s_empty_vector;
79
+ static vector<ptr> s_empty_vector;
80
80
s_empty_vector.clear ();
81
81
return s_empty_vector;
82
82
}
83
83
84
84
virtual const map<string,message::ptr>& get_map () const
85
85
{
86
86
assert (false );
87
- static map<string,message::ptr> s_empty_map;
87
+ static map<string,message::ptr> s_empty_map;
88
88
s_empty_map.clear ();
89
89
return s_empty_map;
90
90
}
@@ -93,11 +93,11 @@ namespace sio
93
93
{
94
94
assert (false );
95
95
static map<string,message::ptr> s_empty_map;
96
- s_empty_map.clear ();
97
- return s_empty_map;
96
+ s_empty_map.clear ();
97
+ return s_empty_map;
98
98
}
99
99
private:
100
- flag _flag;
100
+ flag _flag;
101
101
102
102
protected:
103
103
message (flag f):_flag(f){}
@@ -108,7 +108,7 @@ namespace sio
108
108
int64_t _v;
109
109
protected:
110
110
int_message (int64_t v)
111
- :message(flag_integer),_v(v)
111
+ :message(flag_integer),_v(v)
112
112
{
113
113
}
114
114
@@ -128,7 +128,7 @@ namespace sio
128
128
{
129
129
double _v;
130
130
double_message (double v)
131
- :message(flag_double),_v(v)
131
+ :message(flag_double),_v(v)
132
132
{
133
133
}
134
134
@@ -148,7 +148,7 @@ namespace sio
148
148
{
149
149
string _v;
150
150
string_message (string const & v)
151
- :message(flag_string),_v(v)
151
+ :message(flag_string),_v(v)
152
152
{
153
153
}
154
154
public:
@@ -167,7 +167,7 @@ namespace sio
167
167
{
168
168
shared_ptr<const string> _v;
169
169
binary_message (shared_ptr<const string> const & v)
170
- :message(flag_binary),_v(v)
170
+ :message(flag_binary),_v(v)
171
171
{
172
172
}
173
173
public:
@@ -243,9 +243,9 @@ namespace sio
243
243
list (message::ptr const & message)
244
244
{
245
245
if (message)
246
- {
247
- m_vector.push_back (message);
248
- }
246
+ {
247
+ m_vector.push_back (message);
248
+ }
249
249
}
250
250
251
251
list (string& text)
@@ -256,25 +256,25 @@ namespace sio
256
256
list (const char * text)
257
257
{
258
258
if (text)
259
- {
260
- m_vector.push_back (string_message::create (text));
261
- }
259
+ {
260
+ m_vector.push_back (string_message::create (text));
261
+ }
262
262
}
263
263
264
264
list (shared_ptr<const string> const & binary)
265
265
{
266
266
if (binary)
267
- {
268
- m_vector.push_back (binary_message::create (binary));
269
- }
267
+ {
268
+ m_vector.push_back (binary_message::create (binary));
269
+ }
270
270
}
271
271
272
272
void push (message::ptr const & message)
273
273
{
274
274
if (message)
275
- {
276
- m_vector.push_back (message);
277
- }
275
+ {
276
+ m_vector.push_back (message);
277
+ }
278
278
}
279
279
280
280
void insert (size_t pos,message::ptr const & message)
@@ -303,42 +303,6 @@ namespace sio
303
303
private:
304
304
vector<message::ptr> m_vector;
305
305
};
306
-
307
- inline
308
- message::ptr make_message (string const & event_name, message::ptr const & event_args)
309
- {
310
- message::ptr msg_ptr = array_message::create ();
311
- array_message* ptr = static_cast <array_message*>(msg_ptr.get ());
312
- ptr->get_vector ().push_back (string_message::create (event_name));
313
- if (event_args)
314
- {
315
- ptr->get_vector ().push_back (event_args);
316
- }
317
- return msg_ptr;
318
- }
319
-
320
- inline
321
- message::ptr make_message (string const & event_name, string const & single_message)
322
- {
323
- message::ptr msg_ptr = array_message::create ();
324
- array_message* ptr = static_cast <array_message*>(msg_ptr.get ());
325
- ptr->get_vector ().push_back (string_message::create (event_name));
326
- ptr->get_vector ().push_back (string_message::create (single_message));
327
- return msg_ptr;
328
- }
329
-
330
- inline
331
- message::ptr make_message (string const & event_name, shared_ptr<const string> const & single_binary)
332
- {
333
- message::ptr msg_ptr = array_message::create ();
334
- array_message* ptr = static_cast <array_message*>(msg_ptr.get ());
335
- ptr->get_vector ().push_back (string_message::create (event_name));
336
- if (single_binary)
337
- {
338
- ptr->get_vector ().push_back (binary_message::create (single_binary));
339
- }
340
- return msg_ptr;
341
- }
342
306
}
343
307
344
308
#endif
0 commit comments