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

How to read short from a message. More...

#include <data_stream_message.h>

Static Public Member Functions

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

Detailed Description

How to read short from a message.

Definition at line 42 of file data_stream_message.h.

Member Function Documentation

◆ data_stream() [1/2]

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

Read the short in the message.

Parameters
[out]ds: message to be read
[out]data: data to be set
Returns
true on success, false otherwise

Definition at line 116 of file data_stream_message.cpp.

116  {
117  char* srcByte = (char*)&data;
118  memcpy(srcByte, ds, sizeof(short));
119  ds += sizeof(short);
120  return true;
121 }

◆ data_stream() [2/2]

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

Read the short in the message.

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

Definition at line 129 of file data_stream_message.cpp.

129  {
130  char* srcByte = (char*)data;
131  memcpy(srcByte, ds, sizeof(short)*nbElement);
132  ds += sizeof(short)*nbElement;
133  return true;
134 }

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