@@ -40,51 +40,51 @@ namespace sio
4040 virtual int64_t get_int () const
4141 {
4242 assert (false );
43- return 0 ;
43+ return 0 ;
4444 }
4545
4646 virtual double get_double () const
4747 {
4848 assert (false );
49- return 0 ;
49+ return 0 ;
5050 }
5151
5252 virtual string const & get_string () const
5353 {
5454 assert (false );
5555 static string s_empty_string;
56- s_empty_string.clear ();
56+ s_empty_string.clear ();
5757 return s_empty_string;
5858 }
5959
6060 virtual shared_ptr<const string> const & get_binary () const
6161 {
6262 assert (false );
6363 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;
6666 }
6767
6868 virtual const vector<ptr>& get_vector () const
6969 {
7070 assert (false );
71- static vector<ptr> s_empty_vector;
71+ static vector<ptr> s_empty_vector;
7272 s_empty_vector.clear ();
73- return s_empty_vector;
73+ return s_empty_vector;
7474 }
7575
7676 virtual vector<ptr>& get_vector ()
7777 {
7878 assert (false );
79- static vector<ptr> s_empty_vector;
79+ static vector<ptr> s_empty_vector;
8080 s_empty_vector.clear ();
8181 return s_empty_vector;
8282 }
8383
8484 virtual const map<string,message::ptr>& get_map () const
8585 {
8686 assert (false );
87- static map<string,message::ptr> s_empty_map;
87+ static map<string,message::ptr> s_empty_map;
8888 s_empty_map.clear ();
8989 return s_empty_map;
9090 }
@@ -93,11 +93,11 @@ namespace sio
9393 {
9494 assert (false );
9595 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;
9898 }
9999 private:
100- flag _flag;
100+ flag _flag;
101101
102102 protected:
103103 message (flag f):_flag(f){}
@@ -108,7 +108,7 @@ namespace sio
108108 int64_t _v;
109109 protected:
110110 int_message (int64_t v)
111- :message(flag_integer),_v(v)
111+ :message(flag_integer),_v(v)
112112 {
113113 }
114114
@@ -128,7 +128,7 @@ namespace sio
128128 {
129129 double _v;
130130 double_message (double v)
131- :message(flag_double),_v(v)
131+ :message(flag_double),_v(v)
132132 {
133133 }
134134
@@ -148,7 +148,7 @@ namespace sio
148148 {
149149 string _v;
150150 string_message (string const & v)
151- :message(flag_string),_v(v)
151+ :message(flag_string),_v(v)
152152 {
153153 }
154154 public:
@@ -167,7 +167,7 @@ namespace sio
167167 {
168168 shared_ptr<const string> _v;
169169 binary_message (shared_ptr<const string> const & v)
170- :message(flag_binary),_v(v)
170+ :message(flag_binary),_v(v)
171171 {
172172 }
173173 public:
@@ -243,9 +243,9 @@ namespace sio
243243 list (message::ptr const & message)
244244 {
245245 if (message)
246- {
247- m_vector.push_back (message);
248- }
246+ {
247+ m_vector.push_back (message);
248+ }
249249 }
250250
251251 list (string& text)
@@ -256,25 +256,25 @@ namespace sio
256256 list (const char * text)
257257 {
258258 if (text)
259- {
260- m_vector.push_back (string_message::create (text));
261- }
259+ {
260+ m_vector.push_back (string_message::create (text));
261+ }
262262 }
263263
264264 list (shared_ptr<const string> const & binary)
265265 {
266266 if (binary)
267- {
268- m_vector.push_back (binary_message::create (binary));
269- }
267+ {
268+ m_vector.push_back (binary_message::create (binary));
269+ }
270270 }
271271
272272 void push (message::ptr const & message)
273273 {
274274 if (message)
275- {
276- m_vector.push_back (message);
277- }
275+ {
276+ m_vector.push_back (message);
277+ }
278278 }
279279
280280 void insert (size_t pos,message::ptr const & message)
@@ -303,42 +303,6 @@ namespace sio
303303 private:
304304 vector<message::ptr> m_vector;
305305 };
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- }
342306}
343307
344308#endif
0 commit comments