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

How to write unsigned int in a message. More...

#include <data_stream_message.h>

Static Public Member Functions

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

Detailed Description

How to write unsigned int in a message.

Definition at line 122 of file data_stream_message.h.

Member Function Documentation

◆ data_stream() [1/2]

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

Save the unsigned int 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 391 of file data_stream_message.cpp.

391  {
392  const char* srcByte = (const char*)&data;
393  memcpy(ds, srcByte, sizeof(unsigned int));
394  ds += sizeof(unsigned int);
395  return true;
396 }

◆ data_stream() [2/2]

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

Save the unsigned int 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 404 of file data_stream_message.cpp.

404  {
405  const char* srcByte = (const char*)data;
406  memcpy(ds, srcByte, sizeof(unsigned int)*nbElement);
407  ds += sizeof(unsigned int)*nbElement;
408  return true;
409 }

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