1 |
|
|
/*************************************** |
2 |
|
|
Auteur : Pierre Aubert |
3 |
|
|
Mail : pierre.aubert@lapp.in2p3.fr |
4 |
|
|
Licence : CeCILL-C |
5 |
|
|
****************************************/ |
6 |
|
|
|
7 |
|
|
#include "phoenix_mock.h" |
8 |
|
|
|
9 |
|
|
///Concatenate vector of message into an other one |
10 |
|
|
/** @param[out] vecOutput : vector of output message |
11 |
|
|
* @param vecInput : vector to be concatenated into vecOutput |
12 |
|
|
*/ |
13 |
|
3 |
void concatenateVecMessage(std::vector<std::vector<char> > & vecOutput, const std::vector<std::vector<char> > vecInput){ |
14 |
✓✓ |
6 |
for(std::vector<std::vector<char> >::const_iterator it(vecInput.begin()); it != vecInput.end(); ++it){ |
15 |
✓ |
3 |
vecOutput.push_back(*it); |
16 |
|
|
} |
17 |
|
|
|
18 |
|
3 |
} |
19 |
|
|
|
20 |
|
|
///Split a vector of messages into an other |
21 |
|
|
/** @param[out] vecOutput : output vector of messages |
22 |
|
|
* @param vecInput : input vector of messages |
23 |
|
|
* @param offsetPart : offset of the first message to be extracted in a split mock |
24 |
|
|
* @param sizePart : size of each split part (number of messages in each part to be split) |
25 |
|
|
*/ |
26 |
|
10 |
void splitVecMessage(std::vector<std::vector<char> > & vecOutput, const std::vector<std::vector<char> > vecInput, |
27 |
|
|
size_t offsetPart, size_t sizePart) |
28 |
|
|
{ |
29 |
|
10 |
size_t maxIndex(std::min(offsetPart + sizePart, vecInput.size())); |
30 |
✓✓ |
20 |
for(size_t i(offsetPart); i < maxIndex; ++i){ |
31 |
|
10 |
vecOutput.push_back(vecInput[i]); |
32 |
|
|
} |
33 |
|
10 |
} |
34 |
|
|
|
35 |
|
|
|
36 |
|
|
|
37 |
|
|
|
38 |
|
|
|