DataStream  1.8.8
DataStream : framework to save/load/serialize/deserialize data
DataStream< char *, DataStreamMode::WRITE, short > Struct Reference

How to write short in a message. More...

#include <data_stream_message.h>

Static Public Member Functions

static bool data_stream (char *&ds, short &data)
 Save the short in the message. More...
 
static bool data_stream (char *&ds, short *data, size_t nbElement)
 Save the short in the message. More...
 

Detailed Description

How to write short in a message.

Definition at line 49 of file data_stream_message.h.

Member Function Documentation

◆ data_stream() [1/2]

bool DataStream< char *, DataStreamMode::WRITE, short >::data_stream ( char *&  ds,
short &  data 
)
static

Save the short in the message.

Parameters
[out]ds: message to be written
data: data to be saved in the message
Returns
true on success, false otherwise

Definition at line 141 of file data_stream_message.cpp.

141  {
142  const char* srcByte = (const char*)&data;
143  memcpy(ds, srcByte, sizeof(short));
144  ds += sizeof(short);
145  return true;
146 }

◆ data_stream() [2/2]

bool DataStream< char *, DataStreamMode::WRITE, short >::data_stream ( char *&  ds,
short *  data,
size_t  nbElement 
)
static

Save the short in the message.

Parameters
[out]ds: message to be written
data: data to be saved in the message
nbElement: number of element of the data
Returns
true on success, false otherwise

Definition at line 154 of file data_stream_message.cpp.

154  {
155  const char* srcByte = (const char*)data;
156  memcpy(ds, srcByte, sizeof(short)*nbElement);
157  ds += sizeof(short)*nbElement;
158  return true;
159 }

The documentation for this struct was generated from the following files: