PhoenixPresentation  2.0.0
Set of cmake function to automate presentation generation
DataStream< DataStreamIter, DataStreamMode::READ, bool > Struct Reference

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

#include <data_stream_message.h>

Static Public Member Functions

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

Detailed Description

How to read bool from a message.

Definition at line 16 of file data_stream_message.h.

Member Function Documentation

◆ data_stream() [1/2]

bool DataStream< DataStreamIter, DataStreamMode::READ, bool >::data_stream ( DataStreamIter ds,
bool &  data 
)
static

Read the bool 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 16 of file data_stream_message.cpp.

16  {
17  char* srcByte = (char*)&data;
18  memcpy(srcByte, ds, sizeof(bool));
19  ds += sizeof(bool);
20  return true;
21 }

◆ data_stream() [2/2]

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

Read the bool 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 29 of file data_stream_message.cpp.

29  {
30  char* srcByte = (char*)data;
31  memcpy(srcByte, ds, sizeof(bool)*nbElement);
32  ds += sizeof(bool)*nbElement;
33  return true;
34 }

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