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

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

#include <data_stream_message.h>

+ Inheritance diagram for DataStream< DataStreamIter, DataStreamMode::WRITE, bool >:
+ Collaboration diagram for DataStream< DataStreamIter, DataStreamMode::WRITE, 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)
 Save the bool in the message.
 
static bool data_stream (DataStreamIter &ds, bool *data, size_t nbElement)
 Save 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 write bool in a message.

Definition at line 23 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::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}
Generic DataStream class.

◆ data_stream() [3/4]

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}

◆ 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: