summaryrefslogtreecommitdiff
path: root/common/message.h
blob: 1d6ae8b248eed15800a2ef972cbfc86af0ff7c4d (plain)
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
#ifndef MESSAGE_H
#define MESSAGE_H

#include <boost/shared_ptr.hpp>

#include <stdint.h>
#include <string>

class Message {
	private:
		Message();
		
		std::size_t deserialize_size;
	
	public:
		typedef boost::shared_ptr<Message> p;
		
		static p create();
		
		//! Temporary payload.
		std::string payload;
		
		//! Serialize message.
		std::pair<uint8_t*, std::size_t> serialize();
		
		//! Deserialize message.
		std::size_t deserialize(uint8_t* data, std::size_t bytes);
		
};

#endif