| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*************************************** | ||
| 2 | Auteur : Pierre Aubert | ||
| 3 | Mail : pierre.aubert@lapp.in2p3.fr | ||
| 4 | Licence : CeCILL-C | ||
| 5 | ****************************************/ | ||
| 6 | |||
| 7 | #include "data_stream_size.h" | ||
| 8 | |||
| 9 | |||
| 10 | ///Get the size of a type bool | ||
| 11 | /** @param[out] ds : size of the type | ||
| 12 | * @param data : data to be used | ||
| 13 | * @return true on success, false otherwise | ||
| 14 | */ | ||
| 15 | 1 | bool DataStream<size_t, DataStreamMode::WRITE, bool>::data_stream(size_t & ds, bool & data){ | |
| 16 | 1 | ds += sizeof(bool); | |
| 17 | 1 | return true; | |
| 18 | } | ||
| 19 | |||
| 20 | ///Get the size of a type bool | ||
| 21 | /** @param[out] ds : size of the type | ||
| 22 | * @param data : data to be used | ||
| 23 | * @param nbElement : number of element of the data | ||
| 24 | * @return true on success, false otherwise | ||
| 25 | */ | ||
| 26 | 138 | bool DataStream<size_t, DataStreamMode::WRITE, bool>::data_stream(size_t & ds, bool * data, size_t nbElement){ | |
| 27 | 138 | ds += sizeof(bool)*nbElement; | |
| 28 | 138 | return true; | |
| 29 | } | ||
| 30 | |||
| 31 | |||
| 32 | ///Get the size of a std::string | ||
| 33 | /** @param[out] ds : size of the std::string | ||
| 34 | * @param data : data to be used | ||
| 35 | * @return true on success, false otherwise | ||
| 36 | */ | ||
| 37 | 4 | bool DataStream<size_t, DataStreamMode::WRITE, std::string>::data_stream(size_t & ds, std::string & data){ | |
| 38 | 4 | ds += data.size() + sizeof(size_t); //Number of char + sizeof(size_t) to store the number of char | |
| 39 | 4 | return true; | |
| 40 | } | ||
| 41 | |||
| 42 | |||
| 43 |