Main Page
Namespaces
Classes
Files
File List
File Members
src
lib
integers.cpp
Go to the documentation of this file.
1
4
/*****************************************************************************
5
** Includes
6
*****************************************************************************/
7
8
#include <
mm_messages/registry.hpp
>
9
#include "../../include/mm_core_msgs/integers.hpp"
10
11
/*****************************************************************************
12
** Namespaces
13
*****************************************************************************/
14
15
namespace
mm_messages
{
16
17
/*****************************************************************************
18
** Implementation
19
*****************************************************************************/
20
21
void
Message<mm_core_msgs::uint8>::encode
(
const
mm_core_msgs::uint8
& s,
ByteArray
& buffer) {
22
// publishers always send empty buffers, but in case others use this
23
if
(!buffer.empty()) {
24
buffer.clear();
25
}
26
buffer.push_back(s);
27
}
28
29
mm_core_msgs::uint8
Message<mm_core_msgs::uint8>::decode
(
const
unsigned
char
* buffer,
const
unsigned
int
& size) {
30
return
*buffer;
31
}
32
}
// namespace mm_messages
33
mm_messages
mm_core_msgs::uint8
unsigned char uint8
Definition:
integers.hpp:25
mm_messages::Message::encode
static void encode(const T &msg, ByteArray &buffer)
mm_messages::ByteArray
std::vector< unsigned char > ByteArray
mm_messages::Message::decode
static T decode(const unsigned char *buffer, const unsigned int &size)
registry.hpp
mm_core_msgs
Author(s): Daniel Stonier
autogenerated on Mon Jun 10 2019 13:52:12