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

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

#include <data_stream_message.h>

Static Public Member Functions

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

Detailed Description

How to write bool in a message.

Definition at line 23 of file data_stream_message.h.

Member Function Documentation

◆ data_stream() [1/2]

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

Save the bool 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 41 of file data_stream_message.cpp.

41  {
42  const char* srcByte = (const char*)&data;
43  memcpy(ds, srcByte, sizeof(bool));
44  ds += sizeof(bool);
45  return true;
46 }

◆ data_stream() [2/2]

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

Save the bool 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 54 of file data_stream_message.cpp.

54  {
55  const char* srcByte = (const char*)data;
56  memcpy(ds, srcByte, sizeof(bool)*nbElement);
57  ds += sizeof(bool)*nbElement;
58  return true;
59 }

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