PhoenixDataStream  1.0.0
Framework to save/load/serialize/deserialize data
Loading...
Searching...
No Matches
DataStream< DataStreamIter, DataStreamMode::READ, bool > Struct Reference

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

#include <data_stream_message.h>

+ Inheritance diagram for DataStream< DataStreamIter, DataStreamMode::READ, bool >:
+ Collaboration diagram for DataStream< DataStreamIter, DataStreamMode::READ, bool >:

Static Public Member Functions

static bool data_stream (DataStreamIter &ds, bool &data)
 Dummy function to catch if a type is not specialised.
 
static bool data_stream (DataStreamIter &ds, bool &data)
 Read the bool in the message.
 
static bool data_stream (DataStreamIter &ds, bool *data, size_t nbElement)
 Read the bool in the message.
 
static bool data_stream (size_t &ds, bool *data, size_t nbElement)
 Dummy function to catch if a type is not specialised.
 

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/4]

static bool DataStream< DataStreamIter, Mode, bool >::data_stream ( DataStreamIter & ds,
bool & data )
inlinestatic

Dummy function to catch if a type is not specialised.

Parameters
ds: Stream to be used (message, file, size)
data: data to be serialised

Definition at line 37 of file data_stream_include.h.

37 {
38 return false;
39 }

◆ data_stream() [2/4]

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}
Generic DataStream class.

◆ data_stream() [3/4]

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}

◆ data_stream() [4/4]

static bool DataStream< DataStreamIter, Mode, bool >::data_stream ( size_t & ds,
bool * data,
size_t nbElement )
inlinestatic

Dummy function to catch if a type is not specialised.

Parameters
ds: Stream to be used (message, file, size)
data: poiunter data to be serialised
nbElement: number of elements in table data

Definition at line 45 of file data_stream_include.h.

45 {
46 return false;
47 }

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