summaryrefslogtreecommitdiff
path: root/implementation/message/include/payload_impl.hpp
blob: 54d7097a91a5bcbea9d4e5c3ef6dce7e6e235d14 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright (C) 2014 BMW Group
// Author: Lutz Bichler (lutz.bichler@bmw.de)
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef VSOMEIP_PAYLOAD_IMPL_HPP
#define VSOMEIP_PAYLOAD_IMPL_HPP

#include <vsomeip/payload.hpp>

namespace vsomeip {

class serializer;
class deserializer;

class payload_impl: public payload {
public:
	payload_impl();
	payload_impl(const byte_t *_data, uint32_t _size);
	payload_impl(const std::vector< byte_t > &_value);
	payload_impl(const payload_impl& _payload);
	virtual ~payload_impl();

	bool operator == (const payload &_other);

	byte_t * get_data();
	const byte_t * get_data() const;
	length_t get_length() const;

	void set_capacity(length_t _capacity);

	void set_data(const byte_t *_data, length_t _length);
	void set_data(const std::vector< byte_t > &_data);

	bool serialize(serializer *_to) const;
	bool deserialize(deserializer *_from);

private:
	std::vector< byte_t > data_;
};

} // namespace vsomeip

#endif // VSOMEIP_PAYLOAD_IMPL_HPP