PhoenixPresentation  2.0.0
Set of cmake function to automate presentation generation
data_stream_message.cpp
Go to the documentation of this file.
1 /***************************************
2  Auteur : Pierre Aubert
3  Mail : pierre.aubert@lapp.in2p3.fr
4  Licence : CeCILL-C
5 ****************************************/
6 
7 
8 #include "data_stream_message.h"
9 
10 
12 
17  char* srcByte = (char*)&data;
18  memcpy(srcByte, ds, sizeof(bool));
19  ds += sizeof(bool);
20  return true;
21 }
22 
24 
30  char* srcByte = (char*)data;
31  memcpy(srcByte, ds, sizeof(bool)*nbElement);
32  ds += sizeof(bool)*nbElement;
33  return true;
34 }
35 
37 
42  const char* srcByte = (const char*)&data;
43  memcpy(ds, srcByte, sizeof(bool));
44  ds += sizeof(bool);
45  return true;
46 }
47 
49 
55  const char* srcByte = (const char*)data;
56  memcpy(ds, srcByte, sizeof(bool)*nbElement);
57  ds += sizeof(bool)*nbElement;
58  return true;
59 }
60 
61 
62 
63 
64 
66 
71  size_t nbElement(0lu);
73  if(nbElement == 0lu || !b){return b;}
74  data.resize(nbElement);
75  memcpy((DataStreamIter)data.data(), ds, nbElement);
76  ds += nbElement;
77  return b;
78 }
79 
80 
82 
87  size_t nbElement(data.size());
89  if(nbElement == 0lu || !b){return b;}
90  memcpy(ds, (const DataStreamIter)data.data(), nbElement);
91  ds += nbElement;
92  return b;
93 }
94 
95 
DataStreamType * DataStreamIter
static bool data_stream(Stream &ds, T &data)
Dummy function to catch if a type is not specialised.