EmbeddedProto  2.0.0
EmbeddedProto is a C++ Protocol Buffer implementation specifically suitable for microcontrollers.
MessageInterface.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Embedded AMS B.V. - All Rights Reserved
3  *
4  * This file is part of Embedded Proto.
5  *
6  * Embedded Proto is open source software: you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as published
8  * by the Free Software Foundation, version 3 of the license.
9  *
10  * Embedded Proto is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with Embedded Proto. If not, see <https://www.gnu.org/licenses/>.
17  *
18  * For commercial and closed source application please visit:
19  * <https://EmbeddedProto.com/license/>.
20  *
21  * Embedded AMS B.V.
22  * Info:
23  * info at EmbeddedProto dot com
24  *
25  * Postal address:
26  * Johan Huizingalaan 763a
27  * 1066 VH, Amsterdam
28  * the Netherlands
29  */
30 
31 #ifndef _MESSAGE_INTERFACE_H_
32 #define _MESSAGE_INTERFACE_H_
33 
34 #include "WireFormatter.h"
35 #include "Fields.h"
36 #include "Errors.h"
37 
38 #include <cstdint>
39 
40 
41 namespace EmbeddedProto
42 {
43 
45 {
46  public:
47 
48  MessageInterface() = default;
49 
50  virtual ~MessageInterface() = default;
51 
52  // TODO doc
53  Error serialize_with_id(uint32_t field_number, ::EmbeddedProto::WriteBufferInterface& buffer) const final;
54 
56 
59  virtual void clear() = 0;
60 
61 };
62 
63 } // End of namespace EmbeddedProto
64 
65 #endif // _MESSAGE_INTERFACE_H_
EmbeddedProto::Field
Definition: Fields.h:45
Fields.h
Errors.h
EmbeddedProto::MessageInterface::clear
virtual void clear()=0
Clear the content of this message and set it to it's default state.
EmbeddedProto::MessageInterface::serialize_with_id
Error serialize_with_id(uint32_t field_number, ::EmbeddedProto::WriteBufferInterface &buffer) const final
EmbeddedProto
Definition: Errors.h:34
EmbeddedProto::MessageInterface
Definition: MessageInterface.h:44
EmbeddedProto::WriteBufferInterface
The pure virtual definition of a message buffer used for writing .
Definition: WriteBufferInterface.h:46
EmbeddedProto::Error
Error
This enumeration defines errors which can occur during serialization and deserialization.
Definition: Errors.h:38
EmbeddedProto::MessageInterface::~MessageInterface
virtual ~MessageInterface()=default
WireFormatter.h
EmbeddedProto::MessageInterface::MessageInterface
MessageInterface()=default